Skip to content

eust/rust_sigstack_overflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

This program demonstrates a silent signal stack overflow.

What it does:

Mmap anon memory region mem1 and fill it with '1'. Spawn a new thread (triggering mmap of a new signal stack). Mmap another anon memory region mem2 and fill it with '2'.

Raise a signal. In the signal handler a local array is created and filled with '7'. There is a good chance that either mem1 or mem2 gets overwritten by that array. We print the last value in both mem1 and mem2 before and after singal handler execution.

Expected behavior

  • segfault in the signal handler.

Observed behavior

  • on MacOS 10.15.3 mem1 gets partially overwritten (last val1 changes from 1 to 7)
  • on Linux mem2 gets partially overwritten (last val2 changes from 2 to 7)
  • program ends sucessfully (no segfault)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages