2 ms·
How are you grabbing the address of the place to jump to that calls system? Is the binary not position-independent?
by saagarjha 8y ago
How are you grabbing the address of the place to jump to that calls system? Is the binary not position-independent?
- UncleEntity 8y agoThat makes me wonder...if my binaries are compiled on some fedora buildbot and distributed to everyone then wouldn't they all have the same "randomized" layout?
- saagarjha 8y agoThe randomization I’m talking about is where the binary is loaded into memory, which protects against the issue you’re talking about of everyone having the same binary (and hence, things are at the same address).
- nneonneo 8y agoThe pmap output he shows near the end has Address Kbytes RSS Dirty Mode Mapping 0000000000400000 2460 832 0 r-x-- pdftex 0000000000400000 0 0 0 r-x-- pdftex 0000000000867000 8 8 4 r---- pdftex which means the core pdftex binary does not have PIE (sadly a very common occurrence on Linux). pdftex handles certain TeX functions that invoke external commands, so it has calls to system().
- saagarjha 8y agoAh, I should have seen that. I guess I'm too used to macOS, where you have to go out of your way to compile binaries with PIE so it's basically always enabled.