]> git.baikalelectronics.ru Git - kernel.git/commit
livepatch: x86: make kASLR logic more accurate
authorJiri Kosina <jkosina@suse.cz>
Mon, 27 Apr 2015 11:25:23 +0000 (13:25 +0200)
committerJiri Kosina <jkosina@suse.cz>
Wed, 29 Apr 2015 14:51:33 +0000 (16:51 +0200)
commitcb7c9e70d4461a3b0aa5d1b5562e7a31a3404bd9
treea7f1f2a2d19f2db618bde24f6a4de0f8fb6591dc
parent4a198d8bba0b8c80e548b09fd880f6d9c0b2ed77
livepatch: x86: make kASLR logic more accurate

We give up old_addr hint from the coming patch module in cases when kernel load
base has been randomized (as in such case, the coming module has no idea about
the exact randomization offset).

We are currently too pessimistic, and give up immediately as soon as
CONFIG_RANDOMIZE_BASE is set; this doesn't however directly imply that the
load base has actually been randomized. There are config options that
disable kASLR (such as hibernation), user could have disabled kaslr on
kernel command-line, etc.

The loader propagates the information whether kernel has been randomized
through bootparams. This allows us to have the condition more accurate.

On top of that, it seems unnecessary to give up old_addr hints even if
randomization is active. The relocation offset can be computed using
kaslr_ofsset(), and therefore old_addr can be adjusted accordingly.

Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
arch/x86/include/asm/livepatch.h
kernel/livepatch/core.c