Openbsd also puts a fair amount of work into removing ROP gadgets. For example. https://marc.info/?l=openbsd-cvs&m=152824407931917
Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
11–20 of 84 posts
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#12Openbsd also puts a fair amount of work into removing ROP gadgets. For example. https://marc.info/?l=openbsd-cvs&m=152824407931917
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#13Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#14I like this idea. I have an idea for something that would be cool, if impractical: Imagine a GCC wrapper that doesn't actually link, but produces a bundle that performs the linking in randomized order in realtime and then runs. I think that you could do this quite well on NixOS, and I'm now intrigued to try to rig up a proof-of-concept when I can find the time. Side-effect: Does not work for libraries without a signi…
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#15I like this idea. I have an idea for something that would be cool, if impractical: Imagine a GCC wrapper that doesn't actually link, but produces a bundle that performs the linking in randomized order in realtime and then runs. I think that you could do this quite well on NixOS, and I'm now intrigued to try to rig up a proof-of-concept when I can find the time. Side-effect: Does not work for libraries without a signi…
That'd make process startup EXTREMELY slow
Truthfully though you're right, using typical linkers, this would be pretty slow; at least a few seconds for large binaries, to minutes for things as large as web browsers. However, for many binaries, linking can be done much faster; mold claims to be only 50% the runtime of using `cp` on the object files, which is fast enough to even re-link Firefox on-the-fly without it being unusable.
You could imagine writing a linker specifically for this case, that encodes information about the object files directly into the resulting bundle.
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#16>> As a side-effect, reproducible builds, which this technique breaks, are less of a concern anyway (because you've compiled your system from source). Reproducible builds verify the source code and build process (including options) were the same. Not sure how important each aspect is. Also, if for some reason you rebuild a dependency, you'll need to relink everything that depends on that. This could get messy, but it…
Isn’t it impossible to have truly from-scratch reproducible builds? IIRC, you have to trust the compiler which can’t be built from scratch.
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#17Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#18Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#19Don't try this with C++, unless you're certain that there are no interdependencies or side-effects in global variable initialisation. The link order (usually) affects the order in which initialisers are executed.
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#20Don't try this with C++, unless you're certain that there are no interdependencies or side-effects in global variable initialisation. The link order (usually) affects the order in which initialisers are executed.
On the contrary: do do this and if you observe your program crashing due to linking order, fix the damn bug.