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

SEGV src/jsiCmds.c:785 in Jsi_CommandPkgOpts #69

Closed
hope-fly opened this issue Dec 24, 2021 · 7 comments
Closed

SEGV src/jsiCmds.c:785 in Jsi_CommandPkgOpts #69

hope-fly opened this issue Dec 24, 2021 · 7 comments

Comments

@hope-fly
Copy link

hope-fly commented Dec 24, 2021

Jsish revision

Commit: 9fa798e

Version: v3.5.0

Build platform

Ubuntu 18.04.5 LTS (Linux 5.4.0-44-generic x86_64)

Build steps
export CFLAGS='-fsanitize=address'
make
Test case
var JSEtest = { 1e+400: '!'.charCodeAt(0) };
String.prototype.trimRight(WebSocket.apply(JSEtest));

Execution steps & Output
$ ./jsish/jsish poc.js

ASAN:DEADLYSIGNAL
=================================================================
==40146==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000010 (pc 0x56121dba5c0c bp 0x0ffff18e704c sp 0x7fff8c7381e0 T0)
==40146==The signal is caused by a READ memory access.
==40146==Hint: address points to the zero page.
    #0 0x56121dba5c0b in Jsi_CommandPkgOpts src/jsiCmds.c:785
    #1 0x56121dccce67 in WebSocketConstructor src/jsiWebSocket.c:3348
    #2 0x56121db0c818 in jsi_FuncCallSub src/jsiProto.c:244
    #3 0x56121db0ed84 in Jsi_FunctionApply src/jsiProto.c:480
    #4 0x56121db0c818 in jsi_FuncCallSub src/jsiProto.c:244
    #5 0x56121ddd671a in jsiFunctionSubCall src/jsiEval.c:796
    #6 0x56121ddd671a in jsiEvalFunction src/jsiEval.c:837
    #7 0x56121ddd671a in jsiEvalCodeSub src/jsiEval.c:1264
    #8 0x56121ddea15e in jsi_evalcode src/jsiEval.c:2204
    #9 0x56121ddee274 in jsi_evalStrFile src/jsiEval.c:2665
    #10 0x56121dadd66a in Jsi_Main src/jsiInterp.c:936
    #11 0x56121e2e203a in jsi_main src/main.c:47
    #12 0x7fde614afbf6 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6)
    #13 0x56121da71969 in _start (/usr/local/bin/jsish+0xe8969)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV src/jsiCmds.c:785 in Jsi_CommandPkgOpts

Credits: Found by OWL337 team.

@hope-fly
Copy link
Author

Which commit fixed this issue, please give some info.

@pcmacdon
Copy link
Owner

pcmacdon commented Dec 27, 2021

Hmm. I've just started using the "Fixes #NN" comment in commits, so it was fossil commit e84958b727
Not sure how to make that a link after the fact. I've updated the comment in fossil, but it doesn't flow through to git.

@pcmacdon
Copy link
Owner

Ok, you can see the comment and link in "Commits" with the link

pcmacdon referenced this issue Dec 27, 2021
FossilOrigin-Name: e84958b727a9abf4209dd7c6d785f065db3bd7fda673743203cf470a05ffbdb8
@hope-fly
Copy link
Author

hope-fly commented Dec 27, 2021 via email

@pcmacdon
Copy link
Owner

Ok, I've edited the comment in "git" and the link flows through that way.
In the future I'll be using the prefix "Fixes", instead of "Fix issue"

@attritionorg
Copy link

Thanks, linking to the fixing commit is very helpful!

@pcmacdon
Copy link
Owner

Sure thing. Are you part of the fuzz group that submitted this and the other 40-ish bugs?

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

3 participants