Bug 218108

Summary: KASAN: save stack traces for large kmalloc allocations
Product: Memory Management Reporter: Andrey Konovalov (andreyknvl)
Component: SanitizersAssignee: MM/Sanitizers virtual assignee (mm_sanitizers)
Status: NEW ---    
Severity: normal CC: kasan-dev
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description Andrey Konovalov 2023-11-06 17:38:22 UTC
Generic KASAN only saves stack traces for small kmalloc allocations.

We can also save alloc/free stack traces for large kmalloc allocations (the ones the fall back to page_alloc when the size > KMALLOC_MAX_CACHE_SIZE).

To store their handles, we can use in-object redzones for large kmalloc allocations (when they are large enough).

Also see https://bugzilla.kernel.org/show_bug.cgi?id=203967 wrt saving stack traces for page_alloc allocations.

(For the tag-based modes, we should use the stack ring instead: https://bugzilla.kernel.org/show_bug.cgi?id=216842.)