diff options
author | Xi Ruoyao <xry111@xry111.site> | 2022-09-11 11:35:06 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@xry111.site> | 2022-09-11 11:35:06 +0800 |
commit | e502de1ab04336007ecfff9e534abdaa9b0344d9 (patch) | |
tree | 764a6f4511932ccbef76a2c9c7c45be3fa2431e2 /chapter08 | |
parent | 8d3b2541dab38afe4dfc9cf0adde162070571c56 (diff) |
gcc: some reword of PIE/SSP/ASLR note
Expand tabs to 8 spaces like everywhere else in the book.
Explain that shared libraries are already covered by ASLR, PIE expands
the ASLR to cover the exetutables.
In 2022, stack smashing attackings are mostly constructing a sequence of
faked returning addresses to exectute a series of function already
existing in the programs or libraries itself (ret2lib). Returning into
the code injected by the attacker is almost impossible because on
i686 (with a PAE/NX enabled kernel) or x86_64, running injected code
needs W/X mappings and those are very rare these days.
Diffstat (limited to 'chapter08')
-rw-r--r-- | chapter08/gcc.xml | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml index 171808df2..fe8e767d1 100644 --- a/chapter08/gcc.xml +++ b/chapter08/gcc.xml @@ -108,18 +108,21 @@ cd build</userinput></screen> <note id="pie-ssp-info" xreflabel="note on PIE and SSP"> <para> - PIE (position independent executable) is a technique to produce - binary programs that can be loaded anywhere in memory. Together - with a feature named ASLR (Address Space Layout Randomization), - this allows programs to never have the same memory layout, - thus defeating attacks based on reproducible memory patterns. + PIE (position-independent executable) is a technique to produce + binary programs that can be loaded anywhere in memory. Without PIE, + the security feature named ASLR (Address Space Layout Randomization) + can be applied for the shared libraries, but not the exectutable + itself. Enabling PIE allows ASLR for the executables in addition to + the shared libraries, and mitigates some attacks based on fixed + addresses of sensitive code or data in the executables. </para> <para> SSP (Stack Smashing Protection) is a technique to ensure that the parameter stack is not corrupted. Stack corruption can for example alter the return address of a subroutine, - which would allow transferring control to an attacker program instead - of the original one. + which would allow transferring control to some dangerous code + (existing in the program or shared libraries, or injected by the + attacker somehow) instead of the original one. </para> </note> |