mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
core, x86: make LIST_POISON less deadly
The list macros use LIST_POISON1 and LIST_POISON2 as undereferencable pointers in order to trap erronous use of freed list_heads. Unfortunately userspace can arrange for those pointers to actually be dereferencable, potentially turning an oops to an expolit. To avoid this allow architectures (currently x86_64 only) to override the default values for these pointers with truly-undereferencable values. This is easy on x86_64 as the virtual address space is large and contains areas that cannot be mapped. Other 64-bit architectures will likely find similar unmapped ranges. [ingo: switch to 0xdead000000000000 as the unmapped area] [ingo: add comments, cleanup] [jaswinder: eliminate sparse warnings] Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Jaswinder Singh Rajput <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
c0f607c608
commit
a29815a333
2 changed files with 19 additions and 2 deletions
|
|
@ -1247,6 +1247,11 @@ config ARCH_MEMORY_PROBE
|
|||
def_bool X86_64
|
||||
depends on MEMORY_HOTPLUG
|
||||
|
||||
config ILLEGAL_POINTER_VALUE
|
||||
hex
|
||||
default 0 if X86_32
|
||||
default 0xdead000000000000 if X86_64
|
||||
|
||||
source "mm/Kconfig"
|
||||
|
||||
config HIGHPTE
|
||||
|
|
|
|||
Loading…
Reference in a new issue