Bug 215757 - KASAN (sw-tags): investigate disabling recovery compiler option
Summary: KASAN (sw-tags): investigate disabling recovery compiler option
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: 2022-03-27 14:56 UTC by Andrey Konovalov
Modified: 2022-03-27 14:56 UTC (History)
1 user (show)

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


Attachments

Description Andrey Konovalov 2022-03-27 14:56:08 UTC
For SW_TAGS KASAN, the instrumentation allows to control whether we can proceed after a crash was detected. This is done by passing the -recover flag to the compiler. Disabling recovery allows to generate more compact code.

Unfortunately, disabling recovery does not work for the kernel as is. KASAN reporting is disabled in some contexts (for example when the allocator accesses slab object metadata; this is controlled by current->kasan_depth). All these accesses are detected by the tool, even though the reports for them are not printed. If the recovery is disabled, KASAN will not be able to proceed after the first of such accesses.

Investigate the possibility of disabling recovery, or update the comment at [1] to say that it is impossible to disable.

[1] https://elixir.bootlin.com/linux/v5.17/source/arch/arm64/kernel/traps.c#L1032

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