[Nasm-bugs] [Bug 3392785] New: SEGV in nasm at preproc.c:4310

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Mon Oct 4 07:53:48 PDT 2021


https://bugzilla.nasm.us/show_bug.cgi?id=3392785

            Bug ID: 3392785
           Summary: SEGV in nasm at preproc.c:4310
           Product: NASM
           Version: unspecified
          Hardware: All
                OS: All
            Status: OPEN
          Severity: normal
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: irfanariqzaki at gmail.com
                CC: chang.seok.bae at intel.com, gorcunov at gmail.com,
                    hpa at zytor.com, nasm-bugs at nasm.us
     Obtained from: Built from git using configure

Created attachment 411836
  --> https://bugzilla.nasm.us/attachment.cgi?id=411836&action=edit
poc and full stack trace

Hello,

We are currently working on fuzz testing feature, and we found a **SEGV** on
`nasm`.

The stack traces are as follow:
```
==29876==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc
0x563aca3022a8 bp 0x7ffed3f8e010 sp 0x7ffed3f8dba0 T0)
==29876==The signal is caused by a READ memory access.
==29876==Hint: address points to the zero page.
    #0 0x563aca3022a7 in do_directive asm/preproc.c:4310
    #1 0x563aca310df7 in pp_tokline asm/preproc.c:7264
    #2 0x563aca3113a4 in pp_getline asm/preproc.c:7328
    #3 0x563aca2c7b77 in assemble_file asm/nasm.c:1722
    #4 0x563aca2c30e6 in main asm/nasm.c:717
    #5 0x7f86b6005bf6 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21bf6)
    #6 0x563aca2c0699 in _start (.../nasm-git/install_asan/bin/nasm+0x111699)
```
The full stack trace is attached.

**Step to reproduce**

We configured `nasm` using `CFLAGS="-g -O0 -fsanitize=address" ./configure
--prefix=$(pwd)/` and build it using `make -j10`, and run it with:

```
./nasm -p <attached file> -l -o /dev/null
```
The input file is attached.

**Environment**
- OS: Ubuntu 18.04.5 LTS
- GCC version: gcc 7.5.0
- nasm version: latest commit (3a811508) of master branch in github
([link](https://github.com/netwide-assembler/nasm/tree/3a81150867e2b1379f14e0e68f76d19b091a31b6))

Thank you.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Nasm-bugs mailing list