Bug 218108 - KASAN: save stack traces for large kmalloc allocations
Summary: KASAN: save stack traces for large kmalloc allocations
Status: NEW
Alias: None
Product: Memory Management
Classification: Unclassified
Component: Sanitizers (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: MM/Sanitizers virtual assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-06 17:38 UTC by Andrey Konovalov
Modified: 2023-11-06 17:38 UTC (History)
1 user (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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.)

Note You need to log in before you can comment on or make changes to this bug.