path: root/mm/Kconfig.debug
diff options
authorLaura Abbott <>2016-03-15 14:56:30 -0700
committerLinus Torvalds <>2016-03-15 16:55:16 -0700
commit1414c7f4f7d72d138fff35f00151d15749b5beda (patch)
treee742e525f02ae4095e2a907cf8bc5fc29bfbc3dc /mm/Kconfig.debug
parent8823b1dbc05fab1a8bec275eeae4709257c2661d (diff)
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 <> Acked-by: Rafael J. Wysocki <> Cc: "Kirill A. Shutemov" <> Cc: Vlastimil Babka <> Cc: Michal Hocko <> Cc: Kees Cook <> Cc: Mathias Krause <> Cc: Dave Hansen <> Cc: Jianyu Zhan <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/Kconfig.debug')
1 files changed, 14 insertions, 0 deletions
diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug
index 1f99f9a0deae..5c50b238b770 100644
--- a/mm/Kconfig.debug
+++ b/mm/Kconfig.debug
@@ -65,3 +65,17 @@ config PAGE_POISONING_NO_SANITY
If you are only interested in sanitization, say Y. Otherwise
say N.
+ 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