Self-registration is disabled due to spam issue (mail gorcunov@gmail.com or hpa@zytor.com to create an account)
Bug 3392637 - Segmentation Fault in ieee_segment()
Summary: Segmentation Fault in ieee_segment()
Status: RESOLVED FIXED
Alias: None
Product: NASM
Classification: Unclassified
Component: Assembler (show other bugs)
Version: 2.15.xx
Hardware: PC Linux
: Medium normal
Assignee: nobody
URL:
Depends on:
Blocks:
 
Reported: 2019-12-08 20:11 PST by Suhwan
Modified: 2020-11-04 02:16 PST (History)
4 users (show)

Obtained from: Build from source archive using configure
Generated by: ---
Bug category:
Breaks existing code: ---


Attachments
poc (1.97 KB, text/plain)
2019-12-08 20:11 PST, Suhwan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Suhwan 2019-12-08 20:11:41 PST
Created attachment 411751 [details]
poc

Hi, 
I found Segmentation Fault in ieee_segment() at output/outieee.c:705:18
It is triggered in nasm version 2.15 and nasm-2.14.03rc2.
Please run following command

  nasm -f ieee -o /dev/null $PoC

Here's ASAN log

==8545==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00000042e7f0 bp 0x7ffecb7c3590 sp 0x7ffecb7c2d10 T0)
==8545==The signal is caused by a READ memory access.
==8545==Hint: address points to the zero page.
    #0 0x42e7ef in __interceptor_strcmp /tmp/final/llvm.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc
    #1 0x953e76 in ieee_segment nasm-2.15rc0-20191023/output/outieee.c:705:18
    #2 0x5359f7 in process_directives nasm-2.15rc0-20191023/asm/directiv.c:243:23
    #3 0x4f061b in assemble_file nasm-2.15rc0-20191023/asm/nasm.c:1639:17
    #4 0x4f061b in main nasm-2.15rc0-20191023/asm/nasm.c:637
    #5 0x7f0b02e3eb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #6 0x41abc9 in _start (nasm+0x41abc9)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /tmp/final/llvm.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc in __interceptor_strcmp
==8545==ABORTING

NASM version 2.15rc0-20191023 compiled on Dec  9 2019
Comment 1 Cyrill Gorcunov 2020-08-19 01:08:34 PDT
Indeed, this is because name for section doesn't get updated. Since ieee format is not that popular I defer it for a while.
Comment 2 Cyrill Gorcunov 2020-11-03 13:55:09 PST
Bisection pointed to commit 98578071b9d71ecaa2344dd9c185237c1765041e
Comment 3 Cyrill Gorcunov 2020-11-04 02:16:31 PST
fixed in 93c774d482694643cafbc82578ac8b729fb5bc8b