SEGV /mjs/mjs.c:13957 in mjs_fprintf
Vincebye opened this issue · 0 comments
Vincebye commented
Environment
Ubuntu 22.04.3 LTS
Affected Version
MJS 2.20.0
Step to reproduce
cd mjs
git checkout b1b6eac6b1e5b830a5cb14f8f4dc690ef3162551
export LDFLAGS="-lpthread -latomic"
./afl-clang -DMJS_MAIN mjs.c -fno-inline -ldl -o mjs-bin -fsanitize=address -g
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
./mjs-bin -f poc.js
Run the poc.js 10~30 times
Contents of PoCfile
print++;
print(1)
ASAN Report
$ ./mjs-bin poc2.js
AddressSanitizer:DEADLYSIGNAL
=================================================================
==20076==ERROR: AddressSanitizer: SEGV on unknown address 0x000091f925c8 (pc 0x561254bf716e bp 0x00008fcd2f20 sp 0x00008fcd2e40 T0)
==20076==The signal is caused by a WRITE memory access.
#0 0x561254bf716e in mjs_fprintf /home/v/jse/mjs/mjs.c:13957
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/v/jse/mjs/mjs.c:13957 in mjs_fprintf
==20076==ABORTING