Bug 212181 - KASAN (hw-tags): use read-only static keys
Summary: KASAN (hw-tags): use read-only static keys
Status: NEW
Alias: None
Product: Memory Management
Classification: Unclassified
Component: Sanitizers (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: MM/Sanitizers virtual assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-09 14:08 UTC by Andrey Konovalov
Modified: 2021-11-19 13:42 UTC (History)
2 users (show)

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


Attachments

Description Andrey Konovalov 2021-03-09 14:08:04 UTC
Currently, HW_TAGS KASAN uses read/write static keys (search for DEFINE_STATIC_KEY) as the read-only static keys were buggy when HW_TAGS was being worked on.
Comment 1 Marco Elver 2021-11-19 13:42:44 UTC
Fully solving this requires reworking static keys itself and how it maintains the list of locations it needs to patch, which is infeasible.

The problem is that any static key that is EXPORT_SYMBOL cannot be read-only. That means kasan_flag_enabled cannot be read-only.

However, kasan_flag_stacktrace can trivially be changed. We can leave this bug open just for that static key if we're sure it won't need changing after init.

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