[PATCH] kasan: Add abbreviation KASAN to init log

1 view
Skip to first unread message

Paul Menzel

unread,
Apr 13, 2026, 5:41:10 AMApr 13
to Andrey Ryabinin, Alexander Potapenko, Andrey Konovalov, Dmitry Vyukov, Vincenzo Frascino, Andrew Morton, Paul Menzel, kasa...@googlegroups.com, linu...@kvack.org, linux-...@vger.kernel.org
`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)

Signed-off-by: Paul Menzel <pme...@molgen.mpg.de>
---
mm/kasan/generic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c
index 2b8e73f5f6a7..1fccf7cc9fce 100644
--- a/mm/kasan/generic.c
+++ b/mm/kasan/generic.c
@@ -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");
}

/*
--
2.53.0

Alexander Potapenko

unread,
Apr 13, 2026, 8:30:05 AMApr 13
to Paul Menzel, Andrey Ryabinin, Andrey Konovalov, Dmitry Vyukov, Vincenzo Frascino, Andrew Morton, kasa...@googlegroups.com, linu...@kvack.org, linux-...@vger.kernel.org
On Mon, Apr 13, 2026 at 11:40 AM Paul Menzel <pme...@molgen.mpg.de> wrote:
>
> `sudo dmesg | grep -i kasan` comes back empty, at least confusing me.

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

> So, include the abbreviation in the log line.
>
> Before:
>
> KernelAddressSanitizer initialized (generic)
>
> After:
>
> KernelAddressSanitizer (KASAN) initialized (generic)
>
> Signed-off-by: Paul Menzel <pme...@molgen.mpg.de>
Reviewed-by: Alexander Potapenko <gli...@google.com>

Andrey Konovalov

unread,
Apr 13, 2026, 8:38:12 AMApr 13
to Paul Menzel, Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, Vincenzo Frascino, Andrew Morton, kasa...@googlegroups.com, linu...@kvack.org, linux-...@vger.kernel.org
On Mon, Apr 13, 2026 at 11:40 AM Paul Menzel <pme...@molgen.mpg.de> wrote:
>
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!

> }
>
> /*
> --
> 2.53.0
>

Paul Menzel

unread,
Apr 13, 2026, 9:54:51 AMApr 13
to Andrey Konovalov, Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, Vincenzo Frascino, Andrew Morton, kasa...@googlegroups.com, linu...@kvack.org, linux-...@vger.kernel.org
Dear Andrey,


Am 13.04.26 um 14:37 schrieb Andrey Konovalov:
> On Mon, Apr 13, 2026 at 11:40 AM Paul Menzel <pme...@molgen.mpg.de> wrote:
>>
>> `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)
>>
>> Signed-off-by: Paul Menzel <pme...@molgen.mpg.de>
>> ---
>> mm/kasan/generic.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c
>> index 2b8e73f5f6a7..1fccf7cc9fce 100644
>> --- a/mm/kasan/generic.c
>> +++ b/mm/kasan/generic.c
>> @@ -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.

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

> 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

Andrey Konovalov

unread,
Apr 13, 2026, 11:06:07 AMApr 13
to Paul Menzel, Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, Vincenzo Frascino, Andrew Morton, kasa...@googlegroups.com, linu...@kvack.org, linux-...@vger.kernel.org
On Mon, Apr 13, 2026 at 3:54 PM Paul Menzel <pme...@molgen.mpg.de> wrote:
>
> > 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.

>
> > 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!
Reply all
Reply to author
Forward
0 new messages