Self-registration is disabled due to spam issue (mail gorcunov@gmail.com or hpa@zytor.com to create an account)
Bug 3392818 - SEGV on unknown address in NASM
Summary: SEGV on unknown address in NASM
Status: CLOSED FIXED
Alias: None
Product: NASM
Classification: Unclassified
Component: Assembler (show other bugs)
Version: 2.16.xx
Hardware: All All
: Higher severe
Assignee: nobody
URL:
Depends on:
Blocks:
 
Reported: 2022-10-12 09:28 PDT by xudong.c
Modified: 2022-12-07 10:24 PST (History)
5 users (show)

Obtained from: Binary from nasm.us
Generated by: ---
Bug category:
Breaks existing code: ---


Attachments
the POC file. (153 bytes, application/x-zip-compressed)
2022-10-12 09:28 PDT, xudong.c
Details

Note You need to log in before you can comment on or make changes to this bug.
Description xudong.c 2022-10-12 09:28:10 PDT
Created attachment 411857 [details]
the POC file.

Hi, developers of NASM:
I tested the binary nasm and a SEGV crash incurred. The version of NASM is the latest (the newest master branch in github (https://github.com/netwide-assembler/nasm.git), version: NASM version 2.16rc0 compiled on Sep 20 2022) and the operation system is Ubuntu 18.04.6 LTS (docker). The following is the details.


Bug

root@81be2c9c39ff:/# ./../nasm/nasm -f ieee poc_nasm
poc_nasm:1: warning: label alone on a line without a colon might be in error [-w+label-orphan]
AddressSanitizer:DEADLYSIGNAL
=================================================================
==670171==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x00000056e1fb bp 0x7fff0dd490a0 sp 0x7fff0dd48940 T0)
==670171==The signal is caused by a READ memory access.
==670171==Hint: address points to the zero page.
    #0 0x56e1fb in ieee_write_file (/nasm/nasm+0x56e1fb)
    #1 0x56d85c in ieee_cleanup (/nasm/nasm+0x56d85c)
    #2 0x4e629d in main (/nasm/nasm+0x4e629d)
    #3 0x7f9395de0c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
    #4 0x41d119 in _start (/nasm/nasm+0x41d119)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/nasm/nasm+0x56e1fb) in ieee_write_file
==670171==ABORTING



I uploaded the POC in the attachment. Thank you for your time!


Credit
Xudong Cao (NCNIPC of China)
Han Zheng (NCNIPC of China, Hexhive)