[go: up one dir, main page]

|
|
Log in / Subscribe / Register

Virtually mapped kernel stacks

Virtually mapped kernel stacks

Posted Jul 1, 2016 21:57 UTC (Fri) by nix (subscriber, #2304)
Parent article: Virtually mapped kernel stacks

A doubtless stupid question from someone who never paid that much attention to this area of things: if the thread_info is below the stack and vulnerable to overruns, why not just move it to the top of the stack page and start the stack immediately below it? It's fixed-size, after all, so it should be easy to start the stack pointer right below it. The stack would then grow away from the thread_info, and overruns could not run into it (only underruns, which should be much rarer, one hopes).


to post comments

Virtually mapped kernel stacks

Posted Jul 1, 2016 22:09 UTC (Fri) by corbet (editor, #1) [Link]

The placement at the bottom was initially done so that it could be easily located just by aligning the stack pointer. It's not done that way anymore, so that doesn't matter much. Moving thread_info to the top would make it harder to overwrite, but doesn't solve the other problems that come with having it in that bit of memory. If you're going to change things, it seems better to just move it out entirely.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds