Don'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.
Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
31–40 of 84 posts
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#32Earlier quoted context omitted.
You can bootstrap the compiler. It's a chore but not impossible. More usefully, you can check that your builds are identical to other people's, so at least your compiler isn't uniquely compromised.
> You can bootstrap the compiler. It's a chore but not impossible. And specifically, only one person needs to do this once... I'm surprised there isn't some project doing this...
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#33Earlier quoted context omitted.
You can bootstrap the compiler. It's a chore but not impossible. More usefully, you can check that your builds are identical to other people's, so at least your compiler isn't uniquely compromised.
I don’t think it’s possible since you’d need the original compilers from the 70’s and bootstrap other compilers up to a modern one. Otherwise your existing compiler could taint your new one.
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#34Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#35Earlier quoted context omitted.
It's pretty much what OpenBSD is doing at bootup. 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 withou…
I thought openbsd did it after boot?
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#36I remember my Gentoo days freshman year in college. I spent more time compiling updates than actually using the computer.
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#37Earlier quoted context omitted.
For binary distributions, how about shipping object files and linking them on install with mold? This should be faster than compiling from source, just marginally slower than installing pre-linked binaries, and each build will be as unique as it gets.
The size of the distributed binary gets very large because you're shipping a lot of code that ends up getting eliminated by the linker. Also if you want to do any kind of LTO, then I don't see how you do it in your model. (which is significant for the larger applications like Chrome that have the likely attack surface). Not every binary on the system actually needs this either. Finally, the main problem with this ide…
On another note: automating this on gentoo is cool exercise, but almost certainly if you just build everything locally, the memory layout will be random enough that writing shellcode blindly presents an interesting challenge. (different compiler flags, various probabilistic optimization passes… all that leads to the functions in same object file having different sizes)
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#38I remember my Gentoo days freshman year in college. I spent more time compiling updates than actually using the computer.
Same thing for me. 2003 it was .. and gentoo was a well good entry vehicle into linux
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#39I remember my Gentoo days freshman year in college. I spent more time compiling updates than actually using the computer.
I recall gcc3 -> 4. The prevailing "wisdom" was emerge --deep (etc) world ... twice! My laptop was left for around a week trundling through 1500 odd packages. I think I did system first, twice too. I left it running on a glass table in an unheated study, propped up to allow some better airflow.
One of the great things about Gentoo is that a completely fragged system doesn't faze you anymore. Screwed glibc? Never mind. Broken python? lol! Scrambled portage? Hold my beer.
I have a VM running in the attic that got a bit behind. OK it was around eight? years out of date. I ended up putting in a new portage tree under git and reverting it into the past and then winding it forwards after getting the thing up to date at that point in time. It took quite a while. I could have started again but it was fun to do as an exercise.
Re: Fun with Gentoo: Why don't we just shuffle those ROP gadgets away?
#40Earlier quoted context omitted.
You can bootstrap the compiler. It's a chore but not impossible. More usefully, you can check that your builds are identical to other people's, so at least your compiler isn't uniquely compromised.
I don’t think it’s possible since you’d need the original compilers from the 70’s and bootstrap other compilers up to a modern one. Otherwise your existing compiler could taint your new one.