-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
I want to catch SIGILL signal or receive "Illegal instruction" on stderr.
The following test code corrupts returning address on stack intensionally, which generates on Linux SIGILL signal on the executable stack or SIGSEGV signal on the non-executable stack, respectively.
void foo(int n) {
long buf[] = {-1};
buf[n] = (long)buf;
}
int main() {
foo(3);
}The executable stack can be set by using execstack -s command and verified by using readelf -l command.
On WSL the above code generates only SIGSEGV signal in both cases. I know mprotect(... PROT_GROWSDOWN) is not supported on WSL, but I think this case should be distinguished.
Metadata
Metadata
Assignees
Labels
No labels