Bug 218322 - KASAN (hw-tags): skip page_alloc (un)poisoning of large kmalloc allocations
Summary: KASAN (hw-tags): skip page_alloc (un)poisoning of 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-12-26 00:08 UTC by Andrey Konovalov
Modified: 2024-01-10 03:03 UTC (History)
1 user (show)

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


Attachments

Description Andrey Konovalov 2023-12-26 00:08:36 UTC
Currently, the tag-based KASAN modes rely on page_alloc to poison/unpoison large kmalloc allocations.

However, for the Hardware Tag-Based mode, page_alloc might skip unpoisoning due to sampling, which shouldn't affect large kmalloc allocations.

We should skip (un)poisoning of large kmalloc allocations in page_alloc via __GFP_SKIP_KASAN and (un)poison them in kasan_kmalloc/kfree_large instead.

Or we could document that the kasan.page_alloc.sample command-line parameter also affects large kmalloc allocations. This would be, arguably, confusing, as the parameter does not affect e.g. vmalloc allocations even though they rely on page_alloc as well.
Comment 1 Andrey Konovalov 2024-01-10 03:03:55 UTC
If skipping is implemented, https://bugzilla.kernel.org/show_bug.cgi?id=218358 becomes obsolete.

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