Hacker News new | ask | show | jobs
by dcbadacd 2618 days ago
Why doesn't OpenBSD do KASLR?
3 comments

The typical approach of sliding the kernel around only offers limited benefit. One leaked address and you're done.

The current approach, called KARL, relinks the kernel so that while it may load at the same address, symbols internally do not have the same offset. Learning the address of printf will not reveal the address of malloc and so forth. In the context of kernel defense, I would argue this is more effective.

Also, simply as a practical matter, the bootloader and kernel are tightly coupled in ways that make altering the load address a nontrivial endeavor.

Why not both KARL and KASLR though?
KARL also includes a random offset in front of the kernel, and the bootstrap code is unlinked once the machine has booted.

    |---------------kernel-----------------|
    |-boot-|-rnd offset-|--running kernel--|
Nontrivial endeavor.
It does KARL though:

"The difference between the two is that KARL loads a different kernel binary in the same place, while KASLR loads the same binary in random locations. Same goal, different paths."

https://www.bleepingcomputer.com/news/security/openbsd-will-...

You'd be shocked to know how long after this was shown academically to be a Good Idea™ it took to get it into operating systems like Windows. The reason back then was because application programmers depended (incorrectly!) on sequential allocations so when you started randomizing things you'd break stuff.

Idk if that's the case here but its been a big reason historically.

I know OpenBSD doesn't prioritize new features but KASLR is a pretty significant security improvement, right?

Application programmers should not care about the address of the kernel.