mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
mm/page_poisoning.c: allow for zero poisoning
By default, page poisoning uses a poison value (0xaa) on free. If this is changed to 0, the page is not only sanitized but zeroing on alloc with __GFP_ZERO can be skipped as well. The tradeoff is that detecting corruption from the poisoning is harder to detect. This feature also cannot be used with hibernation since pages are not guaranteed to be zeroed after hibernation. Credit to Grsecurity/PaX team for inspiring this work Signed-off-by: Laura Abbott <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Kees Cook <[email protected]> Cc: Mathias Krause <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Jianyu Zhan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
8823b1dbc0
commit
1414c7f4f7
7 changed files with 60 additions and 5 deletions
|
|
@ -65,3 +65,17 @@ config PAGE_POISONING_NO_SANITY
|
|||
|
||||
If you are only interested in sanitization, say Y. Otherwise
|
||||
say N.
|
||||
|
||||
config PAGE_POISONING_ZERO
|
||||
bool "Use zero for poisoning instead of random data"
|
||||
depends on PAGE_POISONING
|
||||
---help---
|
||||
Instead of using the existing poison value, fill the pages with
|
||||
zeros. This makes it harder to detect when errors are occurring
|
||||
due to sanitization but the zeroing at free means that it is
|
||||
no longer necessary to write zeros when GFP_ZERO is used on
|
||||
allocation.
|
||||
|
||||
Enabling page poisoning with this option will disable hibernation
|
||||
|
||||
If unsure, say N
|
||||
|
|
|
|||
Loading…
Reference in a new issue