From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: sparkhuang <huangshaobo3@xiaomi.com>
Cc: akpm@linux-foundation.org, bsegall@google.com, david@kernel.org,
dietmar.eggemann@arm.com, juri.lelli@redhat.com,
kees@kernel.org, kprateek.nayak@amd.com, liam@infradead.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
mgorman@suse.de, mhocko@suse.com, mingo@redhat.com,
peterz@infradead.org, rostedt@goodmis.org, rppt@kernel.org,
ryabinin.a.a@gmail.com, stable@vger.kernel.org,
surenb@google.com, vbabka@kernel.org,
vincent.guittot@linaro.org, vschneid@redhat.com
Subject: Re: [PATCH] fork: reset pointer tag of vmapped thread stack before vfree
Date: Fri, 7 Aug 2026 08:56:00 +0100 [thread overview]
Message-ID: <anWPTt4DE-Q8PKry@lucifer> (raw)
In-Reply-To: <20260807065351.93659-1-huangshaobo3@xiaomi.com>
I'm sorry that whole reply is more AI slop and I'm not reading it.
I have zero interest in chatting to an LLM via a middle man.
On Fri, Aug 07, 2026 at 02:53:51PM +0800, sparkhuang wrote:
> Hi Lorenzo,
>
> Thanks for the review. You're right on the process points ??? I'll fold
> those into a v2 (real name, Assisted-by: tag, drop Cc: stable, trim the
> comment, correct the Fixes: target). I won't re-spin it just yet though,
> for the reason below.
>
> I want to be upfront about where the analysis actually stands, because
> I'd rather not push a fix whose rationale I can't fully back up.
>
> The one-line change itself is sound and follows existing precedent:
> c08e6a1206e6 already resets tsk->stack to 0xFF, and 528a4ab45300 does
> the same in scs_free(). A 0xFF-tagged pointer bypasses the KASAN tag
> check, so vfree_atomic()'s llist_add write to the freed region stops
> faulting regardless of what the memory tag currently holds. That makes
> the reported false positive go away ??? that part I'm confident in.
>
> What I have *not* nailed down is why "memory tag: [ff]" shows up in the
> report in the first place. On the 6.18 android-common tree:
>
> - At allocation __kasan_unpoison_vmalloc() tags vm_area->addr with a
> random tag (0xc2 here) and sets the backing memory tag to the same
> 0xc2, so they match at that point ??? the report is not from the
> alloc path.
> - c08e6a1206e6 resets tsk->stack to 0xFF (SP can't be tagged); its
> commit message explicitly notes the stack *memory* still gets tagged.
> - The only caller of kasan_unpoison_task_stack() ??? which would write a
> 0xFF tag into the backing memory ??? is the idle-task path in
> kernel/cpu.c. It is not called for normal task stacks, so my earlier
> commit-message attribution to that function was wrong.
> - page_kasan_tag_reset() only touches page->flags metadata, not the
> physical memory tag, so that's not the source either.
>
> So what flips the memory tag from 0xc2 to 0xFF between allocation and
> the RCU callback remains an open question. My suspicion is the async
> vfree_atomic / delayed_vfree + page-reuse interplay during the reboot
> SIGTERM storm (the trace also shows page flags kasantag=0x55, a third
> value inconsistent with both), but I haven't proven a specific path.
>
> Accordingly I don't have a deterministic reproducer. The report is
> reproducible only in the sense that it shows up during reboot with heavy
> thread churn; I haven't been able to trigger it on demand.
>
> Given that, I'd like to hold v2 until the 0xFF source is understood
> rather than ship a commit message that hand-waves the root cause. If you
> or the KASAN folks have a view on whether the reset_tag fix is acceptable
> as a "stops the false positive, mirrors existing precedent" change
> without a fully root-caused explanation ??? versus waiting ??? I'd
> appreciate the steer.
>
> Best,
> Shaobo
--
Cheers, Lorenzo
next prev parent reply other threads:[~2026-08-07 7:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 12:30 [PATCH] fork: reset pointer tag of vmapped thread stack before vfree sparkhuang
2026-08-06 14:13 ` Lorenzo Stoakes (ARM)
2026-08-07 6:53 ` sparkhuang
2026-08-07 7:56 ` Lorenzo Stoakes (ARM) [this message]
2026-08-07 7:57 ` David Hildenbrand (Arm)
2026-08-07 7:58 ` Lorenzo Stoakes (ARM)
2026-08-07 8:00 ` David Hildenbrand (Arm)
2026-08-07 9:27 ` David Hildenbrand (Arm)
2026-08-07 10:41 ` sparkhuang
2026-08-07 10:47 ` David Hildenbrand (Arm)
2026-08-07 11:20 ` David Hildenbrand (Arm)
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=anWPTt4DE-Q8PKry@lucifer \
--to=ljs@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bsegall@google.com \
--cc=david@kernel.org \
--cc=dietmar.eggemann@arm.com \
--cc=huangshaobo3@xiaomi.com \
--cc=juri.lelli@redhat.com \
--cc=kees@kernel.org \
--cc=kprateek.nayak@amd.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=rppt@kernel.org \
--cc=ryabinin.a.a@gmail.com \
--cc=stable@vger.kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.