[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z_y3wd7zur1_xUjM@smile.fi.intel.com>
Date: Mon, 14 Apr 2025 10:22:41 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Lizhi Xu <lizhi.xu@...driver.com>
Cc: dakr@...nel.org, djrscally@...il.com, dvyukov@...gle.com,
gregkh@...uxfoundation.org, heikki.krogerus@...ux.intel.com,
jgg@...dia.com, kevin.tian@...el.com, linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org, nicolinc@...dia.com,
rafael@...nel.org, sakari.ailus@...ux.intel.com,
syzbot+2ff22910687ee0dfd48e@...kaller.appspotmail.com,
syzkaller-bugs@...glegroups.com, yi.l.liu@...el.com
Subject: Re: [PATCH V2] software node: Prevent link creation failure from
causing kobj reference count imbalance
On Mon, Apr 14, 2025 at 03:11:23PM +0800, Lizhi Xu wrote:
> syzbot reported a uaf in software_node_notify_remove. [1]
>
> When any of the two sysfs_create_link() in software_node_notify() fails,
> the swnode->kobj reference count will not increase normally, which will
> cause swnode to be released incorrectly due to the imbalance of kobj reference
> count when executing software_node_notify_remove().
>
> Increase the reference count of kobj before creating the link to avoid uaf.
>
> [1]
> BUG: KASAN: slab-use-after-free in software_node_notify_remove+0x1bc/0x1c0 drivers/base/swnode.c:1108
> Read of size 1 at addr ffff888033c08908 by task syz-executor105/5844
> Freed by task 5844:
> software_node_notify_remove+0x159/0x1c0 drivers/base/swnode.c:1106
> device_platform_notify_remove drivers/base/core.c:2387 [inline]
The fix looks correct to me,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists