diff options
author | 2016-03-15 14:56:30 -0700 | |
---|---|---|
committer | 2016-03-15 16:55:16 -0700 | |
commit | 1414c7f4f7d72d138fff35f00151d15749b5beda (patch) | |
tree | e742e525f02ae4095e2a907cf8bc5fc29bfbc3dc /include/linux/poison.h | |
parent | mm/page_poison.c: enable PAGE_POISONING as a separate option (diff) | |
download | linux-1414c7f4f7d72d138fff35f00151d15749b5beda.tar.gz linux-1414c7f4f7d72d138fff35f00151d15749b5beda.tar.bz2 linux-1414c7f4f7d72d138fff35f00151d15749b5beda.zip |
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 <labbott@fedoraproject.org>
Acked-by: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Mathias Krause <minipli@googlemail.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Jianyu Zhan <nasa4836@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/poison.h')
-rw-r--r-- | include/linux/poison.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/poison.h b/include/linux/poison.h index 4a27153574e2..51334edec506 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h @@ -30,7 +30,11 @@ #define TIMER_ENTRY_STATIC ((void *) 0x300 + POISON_POINTER_DELTA) /********** mm/debug-pagealloc.c **********/ +#ifdef CONFIG_PAGE_POISONING_ZERO +#define PAGE_POISON 0x00 +#else #define PAGE_POISON 0xaa +#endif /********** mm/page_alloc.c ************/ |