File tree 1 file changed +20
-0
lines changed 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ This program demonstrates a silent signal stack overflow.
2
+
3
+ What it does:
4
+
5
+ Mmap anon memory region mem1 and fill it with '1'.
6
+ Spawn a new thread (triggering mmap of a new signal stack).
7
+ Mmap another anon memory region mem2 and fill it with '2'.
8
+
9
+ Raise a signal. In the signal handler a local array is created and filled with '7'.
10
+ There is a good chance that either mem1 or mem2 gets overwritten by that array.
11
+ We print the last value in both mem1 and mem2 before and after singal handler execution.
12
+
13
+ Expected behavior
14
+ - segfault in the signal handler.
15
+
16
+ Observed behavior
17
+ - on MacOS 10.15.3 mem1 gets partially overwritten (last val1 changes from 1 to 7)
18
+ - on Linux mem2 gets partially overwritten (last val2 changes from 2 to 7)
19
+ - program ends sucessfully (no segfault)
20
+
You can’t perform that action at this time.
0 commit comments