Bug 218315 - KASAN: use EXPORT_SYMBOL_NS to export symbols for tests
Summary: KASAN: use EXPORT_SYMBOL_NS to export symbols for tests
Status: RESOLVED CODE_FIX
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-25 17:44 UTC by Andrey Konovalov
Modified: 2024-11-23 20:41 UTC (History)
2 users (show)

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


Attachments

Description Andrey Konovalov 2023-12-25 17:44:48 UTC
Currently, KASAN uses EXPORT_SYMBOL_GPL to mark the symbols that are only exported to allow building KASAN tests as a module.

We can instead create a separate namespace for these symbols and use EXPORT_SYMBOL_NS.

This would work as a guard against external code accidentally using KASAN-internal symbols.
Comment 1 Andrey Konovalov 2024-10-23 08:41:17 UTC
Instead of creating a separate namespace, we can reuse EXPORT_SYMBOL_IF_KUNIT.
Comment 2 Sabyrzhan Tasbolatov 2024-11-01 18:41:44 UTC
Hello,

Create a patch for this issue:
https://lore.kernel.org/all/20241101184011.3369247-2-snovitoll@gmail.com/T/#u

Thanks

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