Live data from Hacker News

SSHD: Random boot time relinking, OpenBSD

undeadly.org

31–40 of 55 posts

Re: SSHD: Random boot time relinking, OpenBSD

#31
post #29

Takes some dedication to still be using CVS. Do they use another version control system to feed into CVS, or is CVS the tool they use directly?

IIRC they pass around patches on email before committing to CVS. That workflow affords a bit more flexibility.

Re: SSHD: Random boot time relinking, OpenBSD

#32
post #21

Earlier quoted context omitted.

How would you measure that? How would you notice a failed attempt at finding a hole, of stack smashing, etc, if it did not even result in a crash, or any other dysfunction? Not a rhetorical question.

I suppose if someone found a technique in the wild that defeats regular ASLR (even if only sometimes), they could then test that same technique against fine-grained ASLR and evaluate if the FG ASLR was more effective at preventing exploitation.

Any classic buffer overflow/stackssmash can defeat ASLR, it just might take a long time to get lucky guessing addresses. Couldn’t we Monte Carlo this?

Maybe take a known vulnerable exec, create a fuzzing attacker and run it both ways seeing how long it takes to get lucky a few times. The more secure version should take longer.

Re: SSHD: Random boot time relinking, OpenBSD

#33
post #22

I remember how back in MS DOS days polymorphic viruses first appeared, in an attempt to avoid detection by antivirus software (useful and essential back then). Now the tables have turned, and legitimate software has to become somehow polymorphic to thwart attacks by malware.

Yes, the base idea is not that new. I store since years every GO based application I use as small (few kb) source code tree checkout only, no binary at all. At runtime the wrapper compiles a randomized individual one-time-temporary-uniq binary via garble [0].

[0] https://github.com/burrowers/garble

Re: SSHD: Random boot time relinking, OpenBSD

#34
In order to enable relinking, they had to keep around all original .o and .a files, as well as a Makefile. Not a problem for OpenBSD but pretty unusual for binary Linux distros.

I wonder if it is possible to make a relinker which only requires binary output -- so it could be easily incorporated into existing systems.

One way I can think of is to keep relocation/original object information in the debug sections, so that one can reconstruct original object files and re-link them. But I am guessing this will not work with LTO though... Or maybe we can just make a bunch of debug sections and store input object/library files verbatim -- this will at least double the binary size, but will allow for easier relinking.

Re: SSHD: Random boot time relinking, OpenBSD

#35
post #34

In order to enable relinking, they had to keep around all original .o and .a files, as well as a Makefile. Not a problem for OpenBSD but pretty unusual for binary Linux distros. I wonder if it is possible to make a relinker which only requires binary output -- so it could be easily incorporated into existing systems. One way I can think of is to keep relocation/original object information in the debug sections, so th…

I think Facebook BOLT relinks binaries:

https://research.facebook.com/publications/bolt-a-practical-...

https://groups.google.com/g/llvm-dev/c/ef3mKzAdJ7U/m/1shV64B...

Re: SSHD: Random boot time relinking, OpenBSD

#36

Earlier quoted context omitted.

I think I've got a better idea now. So openbsd has ASLR which affects data, code/library, and stack positions. Then this solution works on top of it by reordering symbols within the code. One thing I'm still not sure about is whether the kernel could theoretically do the same reordering at load time using relocatable symbols.

The assembler laid out the code within the sections and generally it's not changed after that (except for targets that do linker relaxation). However with -ffunction-sections the compiler would put each function in its own section which then can be independently relocated.

If each function is in its own section, then all function calls would need to be indirected through the PLT/GOT, even function calls within the same translation unit? Ouch.

Re: SSHD: Random boot time relinking, OpenBSD

#38
post #29

Takes some dedication to still be using CVS. Do they use another version control system to feed into CVS, or is CVS the tool they use directly?

They are working on a git replacement, got (Game Of Trees): http://gameoftrees.org/

So it looks like they are going to move on from CVS eventually.

Post reply on HN