Skip to contentSkip to conversation

kasan: Add abbreviation KASAN to init log

PATCH In review Paul Menzel 3 participants 5 messages Apr 13

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

PATCH 1/1 kasan: Add abbreviation KASAN to init log

sudo dmesg | grep -i kasan comes back empty, at least confusing me. So, include the abbreviation in the log line.

Before:

KernelAddressSanitizer initialized (generic)

After:

KernelAddressSanitizer (KASAN) initialized (generic)

---
 mm/kasan/generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/kasan/generic.c +1 -1
index 2b8e73f5f6a7..1fccf7cc9fce 100644
@@ -44,7 +44,7 @@ void __init kasan_init_generic(void)
 {
 	kasan_enable();
 
-	pr_info("KernelAddressSanitizer initialized (generic)\n");
+	pr_info("KernelAddressSanitizer (KASAN) initialized (generic)\n");
 }
 
 /*
Signature · 1 line
2.53.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Paul Menzel

sudo dmesg | grep -i kasan comes back empty, at least confusing me.

Yeah, I think this bit me once or twice as well.

Quoted 11 lines

So, include the abbreviation in the log line.

Before:

KernelAddressSanitizer initialized (generic)

After:

KernelAddressSanitizer (KASAN) initialized (generic)

#2 lore raw
In reply to Paul Menzel
Quoted 22 lines · Paul Menzel

sudo dmesg | grep -i kasan comes back empty, at least confusing me. So, include the abbreviation in the log line.

Before:

KernelAddressSanitizer initialized (generic)

After:

KernelAddressSanitizer (KASAN) initialized (generic)

---
 mm/kasan/generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/kasan/generic.c +0 -0
index 2b8e73f5f6a7..1fccf7cc9fce 100644

mm/kasan/generic.c void __init kasan_init_generic(void) · line 47

Quoted 5 lines
mm/kasan/generic.c +1 -1
@@ -44,7 +44,7 @@ void __init kasan_init_generic(void)
 {
        kasan_enable();
 
-       pr_info("KernelAddressSanitizer initialized (generic)\n");
+       pr_info("KernelAddressSanitizer (KASAN) initialized (generic)\n");

I think a better change would be to add:

#define pr_fmt(fmt) "kasan: " fmt

to generic.c.

Similar to how this is done in sw/hw_tags.c.

And arguably, we could also drop the "KernelAddressSanitizer" part from init messages, to make them look like:

kasan: initialized (generic)

Thank you!

Quoted 6 lines
mm/kasan/generic.c +0 -1
 }
 
 /*
--

2.53.0

#3 lore raw

Dear Andrey,

Am 13.04.26 um 14:37 schrieb Andrey Konovalov:

Quoted 31 lines · Paul Menzel
Quoted 22 lines

sudo dmesg | grep -i kasan comes back empty, at least confusing me. So, include the abbreviation in the log line.

Before:

KernelAddressSanitizer initialized (generic)

After:

KernelAddressSanitizer (KASAN) initialized (generic)

---
  mm/kasan/generic.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/kasan/generic.c +0 -0
index 2b8e73f5f6a7..1fccf7cc9fce 100644

mm/kasan/generic.c void __init kasan_init_generic(void) · line 47

Quoted 5 lines
mm/kasan/generic.c +1 -1
@@ -44,7 +44,7 @@ void __init kasan_init_generic(void)
  {
         kasan_enable();
 
-       pr_info("KernelAddressSanitizer initialized (generic)\n");
+       pr_info("KernelAddressSanitizer (KASAN) initialized (generic)\n");

I think a better change would be to add:

Quoted 5 lines

#define pr_fmt(fmt) "kasan: " fmt

to generic.c.

Similar to how this is done in sw/hw_tags.c.

Isn’t there only this one log line in generic.c, so the generalization is not really needed?

Quoted 4 lines

And arguably, we could also drop the "KernelAddressSanitizer" part from init messages, to make them look like:

kasan: initialized (generic)

Some analysis scripts might already depend on KernelAddressSanitizer, so I’d keep it.

Kind regards,

Paul

#4 lore raw
Quoted 11 lines · Paul Menzel
Quoted 8 lines

I think a better change would be to add:

#define pr_fmt(fmt) "kasan: " fmt

to generic.c.

Similar to how this is done in sw/hw_tags.c.

Isn’t there only this one log line in generic.c, so the generalization is not really needed?

I think we can add the generalization just in case more pr_info calls get added in the future. And also to keep the code similar to the other modes.

Quoted 7 lines
Quoted 5 lines

And arguably, we could also drop the "KernelAddressSanitizer" part from init messages, to make them look like:

kasan: initialized (generic)

Some analysis scripts might already depend on KernelAddressSanitizer, so I’d keep it.

Makes sense.

Thanks!