
KARL – kernel address randomized link (OpenBSD) - brynet
https://marc.info/?l=openbsd-tech&m=149732026405941&w=2
======
protomyth
I like the follow-up message: [https://marc.info/?l=openbsd-
tech&m=149732265506347&w=2](https://marc.info/?l=openbsd-
tech&m=149732265506347&w=2)

 _For those who are curious, here is the surprisingly small diff. No C code._

 _Perhaps in the future some valient soul will add a linker to the bootblocks,
and we can boot a "bsd.a" file. For now this mechanism is easier; we can take
a shot at adding KVA and KPA ASLR to the mix on a per-arch basis._

------
gbrown_
So this seems like a "cheaper" alternative to KASLR? I.E. the kernel gains
randomization without having to make all parts of it play nice with KASLR?

I should dig into the diffs but is link ordering recorded? It seems like this
would be useful to have from a debugging perspective.

Edit: Yes the link ordering is recorded. [http://marc.info/?l=openbsd-
tech&m=149732265506347&w=2](http://marc.info/?l=openbsd-
tech&m=149732265506347&w=2)

~~~
nwmcsween
ASLR randomizes the based address, not per TU.

------
willvarfar
The relative order within a compilation unit is still predictable?

It is a shame that the compiler and linker don't implement randomization
instead. This would be generally useful beyond OpenBSD too.

~~~
verbatim
There have been efforts trying to do the exact opposite of this, and enable
reproducible builds.

Being able to compile code and get the same byte-for-byte result as someone
else (i.e. a distribution shipping you binaries) can help eliminate concerns
about binaries being tampered either accidentally or intentionally. This is a
valuable security feature for some.

~~~
ibotty
If the seed is saved, you get reproducibly randomized builds.

------
reynoldsbd
Could somebody explain the difficulties of implementing true ASLR for the
kernel?

------
unixhero
Loved this.

