|
|
Subscribe / Log in / New account

Ripples from Stack Clash

Ripples from Stack Clash

Posted Jun 30, 2017 6:48 UTC (Fri) by itvirta (guest, #49997)
In reply to: Ripples from Stack Clash by flussence
Parent article: Ripples from Stack Clash

I thought long mode (64-bit mode) only supports flat segments, that contain the whole memory area
from 0 to 2^64. Not just because segmentation isn't used in the ABI, but just that the hardware doesn't support it.
Even if i386-style segmentation would be available, it would require pointers to have the segment id with them
everywhere, which makes them unnecessarily longer (80-bit pointers? Might be somewhat awkward to handle because
of alignment issues etc.)

Now, hypothetically, reserving one bit out of 64 for a stack/heap indicator would give separation without using that much
space, but we would require dedicated arithmetic instructions for pointers so that the usual arithmetic wouldn't be able to
change the indicator bit... Either that, or just go back to having a large unreserved area between the two areas, which kinda
seems like what the fix we have for the current issue.


to post comments


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