[Nasm-bugs] [Bug 3392776] New: uninitialized value use

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Tue Aug 10 14:26:39 PDT 2021


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

            Bug ID: 3392776
           Summary: uninitialized value use
           Product: NASM
           Version: 2.16 (development)
          Hardware: All
                OS: All
            Status: OPEN
          Severity: normal
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: xiaobaozidi 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 411823
  --> https://bugzilla.nasm.us/attachment.cgi?id=411823&action=edit
Here is the testcase crashes the program

Found by Andrew Bao and his UninitFuzzer

./nasm -f bin
fuzz_out/crashes/id\:000009\,sig\:06\,src\:002918\,op\:havoc\,rep\:8 -o ./tmp
fuzz_out/crashes/id:000009,sig:06,src:002918,op:havoc,rep:8:1: warning:
unterminated string [-w+other]
fuzz_out/crashes/id:000009,sig:06,src:002918,op:havoc,rep:8:1: error: parser:
instruction expected
fuzz_out/crashes/id:000009,sig:06,src:002918,op:havoc,rep:8:2: error: label or
instruction expected at start of line
fuzz_out/crashes/id:000009,sig:06,src:002918,op:havoc,rep:8:3: error: parser:
instruction expected
fuzz_out/crashes/id:000009,sig:06,src:002918,op:havoc,rep:8:4: error: parser:
instruction expected
fuzz_out/crashes/id:000009,sig:06,src:002918,op:havoc,rep:8:5: warning:
unterminated string [-w+other]
==24719==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x5173fb in parse_line
/home/baod/software_testing/software_test/nasm/asm/parser.c:982:41
    #1 0x4a1ab2 in assemble_file
/home/baod/software_testing/software_test/nasm/asm/nasm.c:1735:13
    #2 0x4a1ab2 in main
/home/baod/software_testing/software_test/nasm/asm/nasm.c:717:9
    #3 0x7fe4e60b0bf6 in __libc_start_main
/build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:310
    #4 0x41c139 in _start
(/home/baod/software_testing/software_test/nasm/nasm+0x41c139)

  Uninitialized value was created by a heap allocation
    #0 0x42a5c3 in malloc
/home/baod/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:901
    #1 0x4b7cc6 in nasm_realloc
/home/baod/software_testing/software_test/nasm/nasmlib/alloc.c:101:32
    #2 0x5c3384 in addtotemp
/home/baod/software_testing/software_test/nasm/asm/eval.c:99:20
    #3 0x5c3384 in finishtemp
/home/baod/software_testing/software_test/nasm/asm/eval.c:108:5
    #4 0x5d11e1 in expr4
/home/baod/software_testing/software_test/nasm/asm/eval.c:190:13
    #5 0x5cf1cc in expr3
/home/baod/software_testing/software_test/nasm/asm/eval.c:563:9
    #6 0x5ce0dc in expr2
/home/baod/software_testing/software_test/nasm/asm/eval.c:537:9
    #7 0x5ccffc in expr1
/home/baod/software_testing/software_test/nasm/asm/eval.c:511:9
    #8 0x5cbf3c in expr0
/home/baod/software_testing/software_test/nasm/asm/eval.c:485:9
    #9 0x5ca480 in rexp3
/home/baod/software_testing/software_test/nasm/asm/eval.c:422:9
    #10 0x5c92dd in rexp2
/home/baod/software_testing/software_test/nasm/asm/eval.c:396:9
    #11 0x5c82bc in rexp1
/home/baod/software_testing/software_test/nasm/asm/eval.c:369:9
    #12 0x5c656d in rexp0
/home/baod/software_testing/software_test/nasm/asm/eval.c:342:9
    #13 0x5c656d in cexpr
/home/baod/software_testing/software_test/nasm/asm/eval.c:305:9
    #14 0x5b7e51 in bexpr
/home/baod/software_testing/software_test/nasm/asm/eval.c:298:12
    #15 0x5b7e51 in evaluate
/home/baod/software_testing/software_test/nasm/asm/eval.c:1032:9
    #16 0x5114e6 in parse_line
/home/baod/software_testing/software_test/nasm/asm/parser.c:959:17
    #17 0x4a1ab2 in assemble_file
/home/baod/software_testing/software_test/nasm/asm/nasm.c:1735:13
    #18 0x4a1ab2 in main
/home/baod/software_testing/software_test/nasm/asm/nasm.c:717:9
    #19 0x7fe4e60b0bf6 in __libc_start_main
/build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:310

SUMMARY: MemorySanitizer: use-of-uninitialized-value
/home/baod/software_testing/software_test/nasm/asm/parser.c:982:41 in
parse_line
Exiting

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


More information about the Nasm-bugs mailing list