Skip to contentSkip to conversation

kasan: export kasan_poison

PATCH In review Arnd Bergmann 3 participants 5 messages Jan 25, 2021 – Jan 27, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kasan: export kasan_poison

From: Arnd Bergmann <[email protected]>

The unit test module fails to build after adding a reference to kasan_poison:

ERROR: modpost: "kasan_poison" [lib/test_kasan.ko] undefined!

Export this symbol to make it available to loadable modules.

Fixes b9b322c2bba9 ("kasan: add match-all tag tests")
---
 mm/kasan/shadow.c | 1 +
 1 file changed, 1 insertion(+)
mm/kasan/shadow.c +1 -0
index de6b3f074742..32e7a5c148e6 100644
@@ -94,6 +94,7 @@ void kasan_poison(const void *address, size_t size, u8 value)
 
 	__memset(shadow_start, value, shadow_end - shadow_start);
 }
+EXPORT_SYMBOL_GPL(kasan_poison);
 
 void kasan_unpoison(const void *address, size_t size)
 {
Signature · 1 line
2.29.2
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The unit test module fails to build after adding a reference to kasan_poison:

ERROR: modpost: "kasan_poison" [lib/test_kasan.ko] undefined!

Export this symbol to make it available to loadable modules.

Fixes b9b322c2bba9 ("kasan: add match-all tag tests")

Thanks I just stumbled on the same issue ;)

Quoted 17 lines
---
 mm/kasan/shadow.c | 1 +
 1 file changed, 1 insertion(+)
mm/kasan/shadow.c +1 -0
index de6b3f074742..32e7a5c148e6 100644
@@ -94,6 +94,7 @@ void kasan_poison(const void *address, size_t size, u8 value)
 
 	__memset(shadow_start, value, shadow_end - shadow_start);
 }
+EXPORT_SYMBOL_GPL(kasan_poison);
 
 void kasan_unpoison(const void *address, size_t size)
 {
Signature · 2 lines
Regards,
Vincenzo
#2 lore raw
In reply to Arnd Bergmann
Quoted 9 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The unit test module fails to build after adding a reference to kasan_poison:

ERROR: modpost: "kasan_poison" [lib/test_kasan.ko] undefined!

Export this symbol to make it available to loadable modules.

Could you share the config you used to trigger this?

Quoted 11 lines
Fixes b9b322c2bba9 ("kasan: add match-all tag tests")
---
 mm/kasan/shadow.c | 1 +
 1 file changed, 1 insertion(+)
mm/kasan/shadow.c +0 -0
index de6b3f074742..32e7a5c148e6 100644

mm/kasan/shadow.c void kasan_poison(const void *address, size_t size, u8 value) · line 97

Quoted 4 lines
mm/kasan/shadow.c +1 -0
@@ -94,6 +94,7 @@ void kasan_poison(const void *address, size_t size, u8 value)
 
        __memset(shadow_start, value, shadow_end - shadow_start);
 }
+EXPORT_SYMBOL_GPL(kasan_poison);

Should this be _GPL? All of the other EXPORT_SYMBOL() we use in KASAN are without the GPL suffix.

Quoted 6 lines
mm/kasan/shadow.c +0 -1
 void kasan_unpoison(const void *address, size_t size)
 {
--

2.29.2

#3 lore raw
Quoted 5 lines · Andrey Konovalov
Quoted 3 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Quoted 8 lines
Quoted 6 lines

The unit test module fails to build after adding a reference to kasan_poison:

ERROR: modpost: "kasan_poison" [lib/test_kasan.ko] undefined!

Export this symbol to make it available to loadable modules.

Could you share the config you used to trigger this?

Never mind, I realized I've been using a branch that already contains your fix :)

#4 lore raw
In reply to Andrey Konovalov
Quoted 7 lines · Andrey Konovalov
Quoted 6 lines · Arnd Bergmann
mm/kasan/shadow.c +0 -0
index de6b3f074742..32e7a5c148e6 100644
@@ -94,6 +94,7 @@ void kasan_poison(const void *address, size_t size, u8 value)
 
Quoted 6 lines

mm/kasan/shadow.c void kasan_poison(const void *address, size_t size, u8 value) · line 97

Quoted 3 lines
mm/kasan/shadow.c +1 -0
        __memset(shadow_start, value, shadow_end - shadow_start);
 }
+EXPORT_SYMBOL_GPL(kasan_poison);

Should this be _GPL? All of the other EXPORT_SYMBOL() we use in KASAN are without the GPL suffix.

I don't care much either way, the reason I went for the _GPL variant was that this
seems to only be used internally in mm/kasan/ and lib/test_kasan.c, unlike the other
symbols that are meant to be called by other modules.

Arnd