[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0b846cde-0906-4470-a3da-8c3fa890006a@roeck-us.net>
Date: Sun, 14 Dec 2025 09:36:22 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Junrui Luo <moonafterrain@...look.com>
Cc: "Darrick J. Wong" <djwong@...ibm.com>,
"Mark M. Hoffman" <mhoffman@...htlink.com>,
linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
Yuhao Jiang <danisjiang@...il.com>
Subject: Re: [PATCH] hwmon: (ibmpex) fix use-after-free in high/low store
On Wed, Dec 10, 2025 at 05:48:08PM +0800, Junrui Luo wrote:
> The ibmpex_high_low_store() function retrieves driver data using
> dev_get_drvdata() and uses it without validation. This creates a race
> condition where the sysfs callback can be invoked after the data
> structure is freed, leading to use-after-free.
>
> Fix by adding a NULL check after dev_get_drvdata(), and reordering
> operations in the deletion path to prevent TOCTOU.
>
> Reported-by: Yuhao Jiang <danisjiang@...il.com>
> Reported-by: Junrui Luo <moonafterrain@...look.com>
> Fixes: 57c7c3a0fdea ("hwmon: IBM power meter driver")
> Signed-off-by: Junrui Luo <moonafterrain@...look.com>
Applied.
Thanks,
Guenter
Powered by blists - more mailing lists