Skip to content

Commit cc3bf80

Browse files
Maciej KotMaciej Kot
Maciej Kot
authored and
Maciej Kot
committed
Create README.md
1 parent a3a8ab0 commit cc3bf80

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+

0 commit comments

Comments
 (0)