summaryrefslogtreecommitdiffstats
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
authorDavid Rientjes2015-04-16 01:14:17 +0200
committerLinus Torvalds2015-04-16 01:35:18 +0200
commitbdfedb76f4f5aa5e37380e3b71adee4a39f30fc6 (patch)
tree421ed7ca32d04f1f0310e79a6f94b079523ade4b /mm/huge_memory.c
parentmm, mempool: disallow mempools based on slab caches with constructors (diff)
downloadkernel-qcow2-linux-bdfedb76f4f5aa5e37380e3b71adee4a39f30fc6.tar.gz
kernel-qcow2-linux-bdfedb76f4f5aa5e37380e3b71adee4a39f30fc6.tar.xz
kernel-qcow2-linux-bdfedb76f4f5aa5e37380e3b71adee4a39f30fc6.zip
mm, mempool: poison elements backed by slab allocator
Mempools keep elements in a reserved pool for contexts in which allocation may not be possible. When an element is allocated from the reserved pool, its memory contents is the same as when it was added to the reserved pool. Because of this, elements lack any free poisoning to detect use-after-free errors. This patch adds free poisoning for elements backed by the slab allocator. This is possible because the mempool layer knows the object size of each element. When an element is added to the reserved pool, it is poisoned with POISON_FREE. When it is removed from the reserved pool, the contents are checked for POISON_FREE. If there is a mismatch, a warning is emitted to the kernel log. This is only effective for configs with CONFIG_DEBUG_SLAB or CONFIG_SLUB_DEBUG_ON. [fabio.estevam@freescale.com: use '%zu' for printing 'size_t' variable] [arnd@arndb.de: add missing include] Signed-off-by: David Rientjes <rientjes@google.com> Cc: Dave Kleikamp <shaggy@kernel.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Sebastian Ott <sebott@linux.vnet.ibm.com> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/huge_memory.c')
0 files changed, 0 insertions, 0 deletions