4 ms·
If the linker decides something is unused and strips it, then it doesn't have a realistic impact on security. It was proven the function won't be used, so it ca
by viraptor 7y ago
If the linker decides something is unused and strips it, then it doesn't have a realistic impact on security. It was proven the function won't be used, so it can't be exploited even if present.
The only edge case I can think of is if you could use it for ROPing some gadgets from the unused functions, but that's pretty unlikely and the gadgets are usually not that unique.
Most advantages are in performance: smaller size, faster loading, better cache usage.
- beagle3 7y agoROP gadgets, and data strings/buffers - you might have a printf format string to feed into system() that you wouldn’t have had otherwise and might not be able to supply with your shell code; also, ROP gadgets aren’t very unique, but often system and library calls are available in libc() or some other library; approximately 1% of programs I write needs system/exec calls - but it’s always there in libc making it easier to return to / exploit.