From: Rik van Riel <riel@surriel.com>
To: Jann Horn <jannh@google.com>
Cc: syzbot <syzbot+084b6e5bc1016723a9c4@syzkaller.appspotmail.com>,
bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
linux-kernel@vger.kernel.org, luto@kernel.org, mingo@redhat.com,
neeraj.upadhyay@kernel.org, paulmck@kernel.org,
peterz@infradead.org, syzkaller-bugs@googlegroups.com,
tglx@linutronix.de, x86@kernel.org, yury.norov@gmail.com,
kernel-team <kernel-team@meta.com>,
David Hildenbrand <david@redhat.com>
Subject: Re: [syzbot] [kernel?] KASAN: slab-use-after-free Write in flush_tlb_func
Date: Wed, 02 Jul 2025 13:09:02 -0400 [thread overview]
Message-ID: <f73e23f363b780a0e33e8b0ab7171a2128e16df6.camel@surriel.com> (raw)
In-Reply-To: <CAG48ez2_4D17XMrEb7+5fwq0RFDFDCsY5OjTB7uaXEzdybxshA@mail.gmail.com>
On Wed, 2025-07-02 at 18:53 +0200, Jann Horn wrote:
>
> TLB flushes via IPIs on x86 are always synchronous, right?
> flush_tlb_func is only referenced from native_flush_tlb_multi() in
> calls to on_each_cpu_mask() (with wait=true) or
> on_each_cpu_cond_mask() (with wait=1).
> So I think this is not an issue, unless you're claiming that we call
> native_flush_tlb_multi() with an already-freed info->mm?
>
It looks like there are a least some cases where
try_to_unmap() can call flush_tlb_range() with
an mm that belongs to some other process.
I don't know whether that is an issue.
> And I think the bisected commit really is the buggy one: It looks at
> "nr_cpus", which tracks *how many CPUs we have to IPI*, but assumes
> that "nr_cpus" tracks *how many CPUs we posted work to*. Those
> numbers
> are not the same: If we post work to a CPU that already had IPI work
> pending, we just add a list entry without sending another IPI.
>
Good point, we do need to wait when we enqueue
work, even if we do not send an IPI anywhere!
You are right that the bisected commit is buggy
and should be reverted.
--
All Rights Reversed.
next prev parent reply other threads:[~2025-07-02 17:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-02 13:50 syzbot
2025-07-02 15:20 ` Rik van Riel
2025-07-02 16:53 ` Jann Horn
2025-07-02 17:00 ` Jann Horn
2025-07-02 17:12 ` Thomas Gleixner
2025-07-02 17:44 ` Yury Norov
2025-07-02 17:59 ` [PATCH] smp: Wait for enqueued work regardless of IPI sent Rik van Riel
2025-07-03 13:52 ` Yury Norov
2025-07-03 16:56 ` Thomas Gleixner
2025-07-04 0:30 ` [PATCH v2] " Rik van Riel
2025-07-06 10:01 ` [tip: smp/core] smp: Wait only if work was enqueued tip-bot2 for Rik van Riel
2025-07-02 17:09 ` Rik van Riel [this message]
2025-07-02 17:23 ` [syzbot] [kernel?] KASAN: slab-use-after-free Write in flush_tlb_func Jann Horn
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=f73e23f363b780a0e33e8b0ab7171a2128e16df6.camel@surriel.com \
--to=riel@surriel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david@redhat.com \
--cc=hpa@zytor.com \
--cc=jannh@google.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=syzbot+084b6e5bc1016723a9c4@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yury.norov@gmail.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
all inboxes | Powered by JetHome®