Bug 13562 – [Enh] add permute[=seed] command line argument to dmd

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-10-01T08:47:01Z
Last change time
2024-12-13T18:30:20Z
Assigned to
No Owner
Creator
Walter Bright
Moved to GitHub: dmd#18894 →

Comments

Comment #0 by bugzilla — 2014-10-01T08:47:01Z
Return-Oriented-Programming (ROP) is a common attack method that malware uses to exploit buffer overflows: http://en.wikipedia.org/wiki/Return-oriented_programming It relies on code having predictable contents and being in predictable locations. The compiler often makes potayto-potahto decisions when generating code. By optionally providing a random value to the compiler, it can use that to toss a coin for the decision, making the generated code slightly different - different enough to defeat many ROP attacks. Perturbations can be: changing the stack layout of locals changing the order of register selection changing the scheduling order of instructions weights given to loop variables instruction selection etc. Syntax: -perturb=seed // use seed to guide the compiler's coin toss -perturb // have the compiler generate its own seed, likely by // using the clock. -v will cause this value to be printed default // use a seed value of 0, causing the same behavior the // compiler has now Using this can also shake out compiler bugs by "fuzz" testing of different paths through the compiler. It can help isolate stack corruption code bugs by helping find a more reproducible test case. This switch can be particularly useful for those who are willing to build their apps from source, so that their executable will be different from anybody else's built from the identical source. It shouldn't be hard to implement.
Comment #1 by robert.schadek — 2024-12-13T18:30:20Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18894 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB