3 ms·
What do you mean by "as unpredictable as possible"? From the perspective of an application developer I want that dynamic representation to also be predictable.
by zachrose 8y ago
What do you mean by "as unpredictable as possible"?
From the perspective of an application developer I want that dynamic representation to also be predictable.
- d33 8y agohttps://en.wikipedia.org/wiki/Address_space_layout_randomization https://en.wikipedia.org/wiki/Address_space_layout_randomiza...
- lallysingh 8y agoFor someone who's found a way to inject data into your app, you don't want them to know the address of your symbols and data structures.
- tedunangst 8y agoIn other words, computer exploitation is basically hostile debugging.
- yarrel 8y agoEnbugging. ;-)
- lallysingh 8y agoWell, bugfinding :-)
- runlevel1 8y agoIf your debug symbols still work, are you sure you really care?
- adrianratnapala 8y agoYou are probably talking about different kinds of representations. hathawsh meant representation in the sense of memory layout and other low-level details of how application state is encoded. You seem to be talking about the programmer-visible abstractions built out of that layer. Behaviour at that level has to be predictable in order to "maintain correctness", but predictability at the lower level is mostly a help maintaining for the correctness of malware.
- zachrose 8y agoInteresting. Out of curiosity, is there any correlation between programming paradigms and the predictability of of low-level details? I would imagine that a “boring” C program with one big chunk of mutable state would be predictable in this sense. What about programs developed in functional languages with immutable data structures?
- cellularmitosis 8y agoI think the idea is that (ideally) these low level details are unpredictable even for a boring C program. I.e., when the C program calls malloc, it doesn't actually need to know what the exact format of the heap is. And if every running system has a slightly different format of heap and stack, that makes it harder to write exploits which will work across all of that variation. Can't smash the stack if you don't know how its formatted.
- zamalek 8y ago> I would imagine that a “boring” C program with one big chunk of mutable state would be predictable in this sense. It likely wouldn't. ASLR will choose a random load address for the module (.so or .exe), which means that main() wouldn't be at a predetermined address. The heap and stack would similarly have arbitrary offsets. Furthermore, any other modules that get loaded would be at arbitrary addresses. Ultimately, even "hello world" should become extremely randomized, provided ASLR is enabled for the process. ASLR prevents attacks arusing due to known addresses in virtual memory because they are otherwise reliably predictable (just run the program, attach a debugger, and find the addresses that you care about).