Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A NULL pointer dereference in the function find_cc() modules/preprocs/nasm/nasm-pp.c:3815 #170

Open
Clingto opened this issue May 19, 2021 · 0 comments

Comments

@Clingto
Copy link

Clingto commented May 19, 2021

System info:
Ubuntu 16.04.6 LTS, X64, gcc 5.4.0, yasm (latest master 009450c)
Compile Command:

$ ./autogen.sh
make distclean

CC=gcc CXX=g++ CFLAGS="-fsanitize=address -fno-omit-frame-pointer -g" CXXFLAGS="-fsanitize=address -fno-omit-frame-pointer -g" ./configure --prefix=$PWD/build --disable-shared
make -j
make install

Run Command:

$ yasm  $POC

POC file:
https://github.com/Clingto/POC/blob/master/MSA/yasm/yasm-3811-find_cc-null-pointer-deref

ASAN info:

yasm: file name already has no extension: output will be in `yasm.out'
ASAN:SIGSEGV
=================================================================
==14891==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000018 (pc 0x7f8500dab0e4 bp 0x7ffc37b91380 sp 0x7ffc37b91340 T0)
    #0 0x7f8500dab0e3 in find_cc  test/yasm-uaf/SRC_asan/modules/preprocs/nasm/nasm-pp.c:3815
    #1 0x7f8500db0692 in expand_mmac_params  test/yasm-uaf/SRC_asan/modules/preprocs/nasm/nasm-pp.c:3986
    #2 0x7f8500dc08e8 in pp_getline  test/yasm-uaf/SRC_asan/modules/preprocs/nasm/nasm-pp.c:5078
    #3 0x7f8500da9d46 in nasm_preproc_get_line  test/yasm-uaf/SRC_asan/modules/preprocs/nasm/nasm-preproc.c:198
    #4 0x7f8500d9b2ac in nasm_parser_parse  test/yasm-uaf/SRC_asan/modules/parsers/nasm/nasm-parse.c:218
    #5 0x7f8500d8f36b in nasm_do_parse  test/yasm-uaf/SRC_asan/modules/parsers/nasm/nasm-parser.c:66
    #6 0x7f8500d8f36b in nasm_parser_do_parse  test/yasm-uaf/SRC_asan/modules/parsers/nasm/nasm-parser.c:83
    #7 0x402c84 in do_assemble  test/yasm-uaf/SRC_asan/frontends/yasm/yasm.c:521
    #8 0x402c84 in main  test/yasm-uaf/SRC_asan/frontends/yasm/yasm.c:753
    #9 0x7f8503f0482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #10 0x403ee8 in _start ( test/yasm-uaf/bin_asan/bin/yasm+0x403ee8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV  test/yasm-uaf/SRC_asan/modules/preprocs/nasm/nasm-pp.c:3815 find_cc
==14891==ABORTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant