logoalt Hacker News

Joker_vDtoday at 7:38 AM2 repliesview on HN

I wonder how Linux manages without explicit _chkstk? In my experience, it feels like MAP_GROWSDOWN regions have way more than 1 guard page below its start — I can poke like a megabyte lower than its start, and the kernel will grow the memory region into there just fine.


Replies

inigyoutoday at 7:40 AM

It doesn't. This causes the StackClash vulnerability.

show 1 reply
rramadasstoday at 8:40 AM

Preventing stack guard-page hopping - https://lwn.net/Articles/725832/

According to this article, allocation in page sizes with implicit probing is used;

Stack clash mitigation in GCC, Part 3 (-fstack-clash-protection option) - https://developers.redhat.com/blog/2020/05/22/stack-clash-mi...

show 1 reply