From: Niklas Cassel <cassel@kernel.org>
To: dlemoal@kernel.org, linux@zary.sk, linux-ide@vger.kernel.org,
linux-kernel@vger.kernel.org, Pei Xiao <xiaopei01@kylinos.cn>
Cc: Shuangpeng Bai <shuangpeng.kernel@gmail.com>
Subject: Re: [PATCH v2] ata: pata_parport: Fix use-after-free in new_device_store
Date: Mon, 31 Aug 2026 11:26:06 +0200 [thread overview]
Message-ID: <178816836663.189107.12488362030216541340.b4-ty@kernel.org> (raw)
In-Reply-To: <77dad1184ebd0e1e7ea541d4207568f8bc5ec01f.1785381141.git.xiaopei01@kylinos.cn>
On Thu, 30 Jul 2026 11:16:29 +0800, Pei Xiao wrote:
> The function new_device_store() calls driver_find() without any
> protection against concurrent driver unregistration. This can lead
> to a use-after-free (UAF) when a driver is unloaded (via rmmod)
> in parallel with a new device addition via sysfs.
>
> The race window exists because driver_find() returns a pointer to
> the driver's private data, but does not increase its reference
> count. The caller is responsible for ensuring the driver remains
> valid, but new_device_store() did not hold any lock or reference
> during the lookup and subsequent use.
>
> [...]
Applied to libata/linux.git (for-7.4), thanks!
[1/1] ata: pata_parport: Fix use-after-free in new_device_store
https://git.kernel.org/libata/linux/c/bd46a0b2
Kind regards,
Niklas
next prev parent reply other threads:[~2026-08-31 9:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 3:16 [PATCH v2] ata: pata_parport: Fix use-after-free in new_device_store Pei Xiao
2026-07-30 3:29 ` sashiko-bot
2026-08-10 2:26 ` Pei Xiao
2026-08-31 9:26 ` Niklas Cassel [this message]
2026-08-31 9:32 ` Niklas Cassel
2026-08-31 9:49 ` Pei Xiao
2026-08-31 10:36 ` Niklas Cassel
2026-09-01 9:35 ` Pei Xiao
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=178816836663.189107.12488362030216541340.b4-ty@kernel.org \
--to=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@zary.sk \
--cc=shuangpeng.kernel@gmail.com \
--cc=xiaopei01@kylinos.cn \
/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