diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2025-03-03 17:28:05 +0000 |
---|---|---|
committer | Vlastimil Babka <vbabka@suse.cz> | 2025-03-04 08:57:48 +0100 |
commit | a6687c8ff613fc13a71ce1390593ba8d27c52db9 (patch) | |
tree | 4b9ec270e691d5f2e76485eb5294661c3d919eea /tools/perf/scripts/python/syscall-counts.py | |
parent | 7e384dbb57e2c3cef7e70d4913b0cc4caedf0a1f (diff) |
slab: Mark large folios for debugging purposes
If a user calls p = kmalloc(1024); kfree(p); kfree(p); and 'p' was the
only object in the slab, we may free the slab after the first call to
kfree(). If we do, we clear PGTY_slab and the second call to kfree()
will call free_large_kmalloc(). That will leave a trace in the logs
("object pointer: 0x%p"), but otherwise proceed to free the memory,
which is likely to corrupt the page allocator's metadata.
Allocate a new page type for large kmalloc and mark the memory with it
while it's allocated. That lets us detect this double-free and return
without harming any data structures.
Reported-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts.py')
0 files changed, 0 insertions, 0 deletions