Hacker News new | past | comments | ask | show | jobs | submit login

How does that work? Should the kernel walk the stack to change all the saved cookie values of the forked copy? I doubt the kernel even knows where the saved cookie values are stored on the stack. Also, that would make fork quite slow, depending on how the deep the stack was when the fork happened.



The post-fork canary value could be paired with the stack pointer at which it became valid. If not valid, the process could walk a linked list of pre-fork canary and stack pointer pairs, to find the correct value to use. Would be interesting to see the performance hit on such an approach.


Or not. The stack canary is not the only random value reset upon exec.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: