All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Jiale Yao <yaojiale02@163.com>
Cc: Johan Hovold <johan@kernel.org>,
	Hao-Qun Huang <alvinhuang0603@gmail.com>,
	Kees Cook <kees@kernel.org>, Martyn Welch <martyn@welchs.me.uk>,
	linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev
Subject: Re: [PATCH] staging: vme_user: kill fake VIRQ tasklet on exit
Date: Sun, 20 Sep 2026 21:34:11 +0200	[thread overview]
Message-ID: <2026092012-deuce-untitled-2254@gregkh> (raw)
In-Reply-To: <20260920170223.2068463-1-yaojiale02@163.com>

On Mon, Sep 21, 2026 at 01:02:21AM +0800, Jiale Yao wrote:
> fake_irq_generate() schedules int_tasklet, which is embedded in struct
> fake_driver and receives fake_bridge as its data argument. fake_exit()
> frees both objects without waiting for a pending tasklet to complete.
> 
> This was reproduced on v6.18.52 under QEMU with the following sequence:

6.18 is NOT the latest kernel release to be doing testing or development
for.

>   1. Load vme_fake and vme_user to create /dev/bus/vme/ctl.
>   2. Issue VME_IRQ_GEN ioctls so fake_irq_generate() queues int_tasklet.
>   3. Concurrently unload vme_fake before ksoftirqd runs the tasklet.
>   4. fake_exit() frees the embedded tasklet and fake_bridge, after which
>      tasklet_action_common() accesses the freed tasklet.
> 
> KASAN reported:
> 
>   BUG: KASAN: slab-use-after-free in tasklet_action_common+0xee/0x6f0
>   Read of size 8 by task ksoftirqd/3/36
> 
>   Call Trace:
>    <TASK>
>    dump_stack_lvl+0x48/0x120
>    print_report+0x191/0x580
>    kasan_report+0x139/0x170
>    tasklet_action_common+0xee/0x6f0
>    handle_softirqs+0x159/0x4c0
>    run_ksoftirqd+0x1c/0x30
>    smpboot_thread_fn+0x385/0x700
>    kthread+0x5c6/0x730
>    ret_from_fork+0x15a/0x380
>    ret_from_fork_asm+0x1a/0x30
>    </TASK>
> 
> Unregister the bridge to remove the userspace entry point, then kill the
> tasklet before tearing down the bridge resources. This ensures any pending
> callback has completed before its storage and data argument are freed.

What about on the real hardware?  As per our previous statements, that's
the only way we can take LLM-found patches for staging drivers.

thanks,

greg k-h

  reply	other threads:[~2026-09-20 19:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20 17:02 [PATCH] staging: vme_user: kill fake VIRQ tasklet on exit Jiale Yao
2026-09-20 19:34 ` Greg Kroah-Hartman [this message]
2026-09-21  1:06   ` jiale yao

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=2026092012-deuce-untitled-2254@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=alvinhuang0603@gmail.com \
    --cc=johan@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=martyn@welchs.me.uk \
    --cc=yaojiale02@163.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.