[Nasm-bugs] [Bug 3392709] New: memcpy-param-overlap in new_Token asm/preproc.c:1861

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Tue Jul 28 04:16:16 PDT 2020


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

            Bug ID: 3392709
           Summary: memcpy-param-overlap in new_Token asm/preproc.c:1861
           Product: NASM
           Version: 2.15 (development)
          Hardware: All
                OS: All
            Status: OPEN
          Severity: normal
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: prada960808 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: Build from source archive using configure

Created attachment 411798
  --> https://bugzilla.nasm.us/attachment.cgi?id=411798&action=edit
poc

Hi, 
I found a memcpy-param-overlap in new_Token asm/preproc.c:1861
It is triggered in nasm version 2.15rc10.

Please run following command
`nasm -f win64 -o tmp.o $PoC`



==32803==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges
[0x7fde59ebfad0,0x7fde59ebfad5) and [0x7fde59ebfad2, 0x7fde59ebfad7) overlap
    #0 0x7fde5d3d0425  (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x79425)
    #1 0x561ec8fe38b1 in memcpy
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34
    #2 0x561ec8fe38b1 in new_Token asm/preproc.c:1861
    #3 0x561ec8fef7b4 in tokenize asm/preproc.c:1734
    #4 0x561ec901f5b8 in expand_mmac_params asm/preproc.c:5077
    #5 0x561ec90576c3 in pp_tokline asm/preproc.c:6710
    #6 0x561ec90576c3 in pp_getline asm/preproc.c:6779
    #7 0x561ec8ec7dfa in assemble_file asm/nasm.c:1705
    #8 0x561ec8ebd056 in main asm/nasm.c:712
    #9 0x7fde5cf87b96 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #10 0x561ec8ec0129 in _start
(/mnt/hda2/suhwan/add_project/final/FINAL_TEST_ZONE/program/nasm-2.15rc10/install_dir/bin/nasm+0x124129)

0x7fde59ebfad0 is located 720 bytes inside of 262144-byte region
[0x7fde59ebf800,0x7fde59eff800)
allocated by thread T0 here:
    #0 0x7fde5d435d28 in __interceptor_calloc
(/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x561ec8eed766 in nasm_calloc nasmlib/alloc.c:72

0x7fde59ebfad2 is located 722 bytes inside of 262144-byte region
[0x7fde59ebf800,0x7fde59eff800)
allocated by thread T0 here:
    #0 0x7fde5d435d28 in __interceptor_calloc
(/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x561ec8eed766 in nasm_calloc nasmlib/alloc.c:72

SUMMARY: AddressSanitizer: memcpy-param-overlap
(/usr/lib/x86_64-linux-gnu/libasan.so.4+0x79425)
==32803==ABORTING

-- 
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