linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Maciej Wieczór-Retman" <m.wieczorretman@pm.me>
To: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Alexander Potapenko <glider@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Marco Elver <elver@google.com>,
	jiayuan.chen@linux.dev, stable@vger.kernel.org,
	Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>,
	kasan-dev@googlegroups.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] kasan: Unpoison vms[area] addresses with a common tag
Date: Fri, 05 Dec 2025 07:55:02 +0000	[thread overview]
Message-ID: <qg2tmzw5me43idoal3egqtr5i6rdizhxsaybtsesahec3lrrus@3ccq3qtarfyj> (raw)
In-Reply-To: <CA+fCnZfBqNKAkwKmdu7YAPWjPDWY=wRkUiWuYjEzK4_tNhSGFA@mail.gmail.com>

Thanks for checking the patches out, do you want me to send v4 with this
correction or is it redundant now that Andrew already wrote it?

Kind regards
Maciej Wieczór-Retman

On 2025-12-05 at 04:38:27 +0100, Andrey Konovalov wrote:
>On Fri, Dec 5, 2025 at 4:22 AM Andrew Morton <akpm@linux-foundation.org> wrote:
>>
>> On Fri, 5 Dec 2025 02:09:06 +0100 Andrey Konovalov <andreyknvl@gmail.com> wrote:
>>
>> > > --- a/mm/kasan/common.c
>> > > +++ b/mm/kasan/common.c
>> > > @@ -591,11 +591,28 @@ void __kasan_unpoison_vmap_areas(struct vm_struct **vms, int nr_vms,
>> > >         unsigned long size;
>> > >         void *addr;
>> > >         int area;
>> > > +       u8 tag;
>> > > +
>> > > +       /*
>> > > +        * If KASAN_VMALLOC_KEEP_TAG was set at this point, all vms[] pointers
>> > > +        * would be unpoisoned with the KASAN_TAG_KERNEL which would disable
>> > > +        * KASAN checks down the line.
>> > > +        */
>> > > +       if (flags & KASAN_VMALLOC_KEEP_TAG) {
>> >
>> > I think we can do a WARN_ON() here: passing KASAN_VMALLOC_KEEP_TAG to
>> > this function would be a bug in KASAN annotations and thus a kernel
>> > bug. Therefore, printing a WARNING seems justified.
>>
>> This?
>>
>> --- a/mm/kasan/common.c~kasan-unpoison-vms-addresses-with-a-common-tag-fix
>> +++ a/mm/kasan/common.c
>> @@ -598,7 +598,7 @@ void __kasan_unpoison_vmap_areas(struct
>>          * would be unpoisoned with the KASAN_TAG_KERNEL which would disable
>>          * KASAN checks down the line.
>>          */
>> -       if (flags & KASAN_VMALLOC_KEEP_TAG) {
>> +       if (WARN_ON_ONCE(flags & KASAN_VMALLOC_KEEP_TAG)) {
>>                 pr_warn("KASAN_VMALLOC_KEEP_TAG flag shouldn't be already set!\n");
>>                 return;
>>         }
>> _
>>
>
>Can also drop pr_warn(), but this is fine too. Thanks!



  reply	other threads:[~2025-12-05  7:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-04 18:57 [PATCH v3 0/3] kasan: vmalloc: Fixes for the percpu allocator and vrealloc Maciej Wieczor-Retman
2025-12-04 18:59 ` [PATCH v3 1/3] mm/kasan: Fix incorrect unpoisoning in vrealloc for KASAN Maciej Wieczor-Retman
2025-12-05  1:08   ` Andrey Konovalov
2025-12-04 19:00 ` [PATCH v3 2/3] kasan: Refactor pcpu kasan vmalloc unpoison Maciej Wieczor-Retman
2025-12-05  1:09   ` Andrey Konovalov
2025-12-05  8:01     ` Maciej Wieczór-Retman
2025-12-04 19:00 ` [PATCH v3 3/3] kasan: Unpoison vms[area] addresses with a common tag Maciej Wieczor-Retman
2025-12-05  1:09   ` Andrey Konovalov
2025-12-05  3:22     ` Andrew Morton
2025-12-05  3:38       ` Andrey Konovalov
2025-12-05  7:55         ` Maciej Wieczór-Retman [this message]
2025-12-05 13:54           ` Andrey Konovalov
2025-12-04 22:21 ` [PATCH v3 0/3] kasan: vmalloc: Fixes for the percpu allocator and vrealloc Andrew Morton
2025-12-05  7:57   ` Maciej Wieczór-Retman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=qg2tmzw5me43idoal3egqtr5i6rdizhxsaybtsesahec3lrrus@3ccq3qtarfyj \
    --to=m.wieczorretman@pm.me \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@gmail.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=jiayuan.chen@linux.dev \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=ryabinin.a.a@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=vincenzo.frascino@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox