|
|
Subscribe / Log in / New account

Randomizing structure layout

Randomizing structure layout

Posted May 15, 2017 12:52 UTC (Mon) by tialaramex (subscriber, #21167)
In reply to: Randomizing structure layout by mb
Parent article: Randomizing structure layout

You seem to have assumed that you'll be the one calling the functions. In some scenarios we may be relying upon somebody else to do the calling, and they may not be inclined to run whichever random function we've actually tampered with in the way we hoped.

The pointers are there because _if_ the corresponding function is used we need to follow the pointer, but their presence doesn't mean anybody is actually obliged to use the function. Furthermore, in some cases function pointers are invoked conditionally. The kernel doesn't do this for simple "If exists then..." tests, which are traditionally done just by checking if the pointer is non-NULL (which will work if you scribble over it) but it does do this in other places, and some people's C code may not follow that style even for "if exists then..." tests so they'd benefit from this feature too.


to post comments


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