]> Git Repo - linux.git/commit
x86/alternatives: Initialize temporary mm for patching
authorNadav Amit <[email protected]>
Fri, 26 Apr 2019 23:22:46 +0000 (16:22 -0700)
committerIngo Molnar <[email protected]>
Tue, 30 Apr 2019 10:37:52 +0000 (12:37 +0200)
commit4fc19708b165c1c152fa1f12f6600e66184b7786
treedecf3f3cd8a8ab9d636cec86360843039c0eff3e
parent13585fa0668c724efab9635aaeef6ec390217415
x86/alternatives: Initialize temporary mm for patching

To prevent improper use of the PTEs that are used for text patching, the
next patches will use a temporary mm struct. Initailize it by copying
the init mm.

The address that will be used for patching is taken from the lower area
that is usually used for the task memory. Doing so prevents the need to
frequently synchronize the temporary-mm (e.g., when BPF programs are
installed), since different PGDs are used for the task memory.

Finally, randomize the address of the PTEs to harden against exploits
that use these PTEs.

Suggested-by: Andy Lutomirski <[email protected]>
Tested-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Nadav Amit <[email protected]>
Signed-off-by: Rick Edgecombe <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Masami Hiramatsu <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/include/asm/pgtable.h
arch/x86/include/asm/text-patching.h
arch/x86/kernel/alternative.c
arch/x86/mm/init.c
init/main.c
This page took 0.051815 seconds and 4 git commands to generate.