Bug 218315

Summary: KASAN: use EXPORT_SYMBOL_NS to export symbols for tests
Product: Memory Management Reporter: Andrey Konovalov (andreyknvl)
Component: SanitizersAssignee: MM/Sanitizers virtual assignee (mm_sanitizers)
Status: RESOLVED CODE_FIX    
Severity: normal CC: kasan-dev, snovitoll
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

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