diff options
author | David Rientjes <[email protected]> | 2015-04-15 16:14:17 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2015-04-15 16:35:18 -0700 |
commit | bdfedb76f4f5aa5e37380e3b71adee4a39f30fc6 (patch) | |
tree | 421ed7ca32d04f1f0310e79a6f94b079523ade4b /tools/perf/scripts/python/sched-migration.py | |
parent | e244c9e66f6197f55f6fbb2d5e70714e262cc595 (diff) |
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.
[[email protected]: use '%zu' for printing 'size_t' variable]
[[email protected]: add missing include]
Signed-off-by: David Rientjes <[email protected]>
Cc: Dave Kleikamp <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Sebastian Ott <[email protected]>
Cc: Mikulas Patocka <[email protected]>
Cc: Catalin Marinas <[email protected]>
Signed-off-by: Fabio Estevam <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
0 files changed, 0 insertions, 0 deletions