public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+2ff22910687ee0dfd48e@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] Re: [syzbot] [acpi?] KASAN: slab-use-after-free Read in software_node_notify_remove
Date: Thu, 10 Apr 2025 07:23:11 -0700	[thread overview]
Message-ID: <67f7d44f.050a0220.355867.0004.GAE@google.com> (raw)
In-Reply-To: <67f26778.050a0220.0a13.0265.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: Re: [syzbot] [acpi?] KASAN: slab-use-after-free Read in software_node_notify_remove
Author: lizhi.xu@windriver.com

any link create fail will not get kobject

#syz test

diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index b1726a3515f6..5c78fa6ae772 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -1080,6 +1080,7 @@ void software_node_notify(struct device *dev)
 	if (!swnode)
 		return;
 
+	kobject_get(&swnode->kobj);
 	ret = sysfs_create_link(&dev->kobj, &swnode->kobj, "software_node");
 	if (ret)
 		return;
@@ -1089,8 +1090,6 @@ void software_node_notify(struct device *dev)
 		sysfs_remove_link(&dev->kobj, "software_node");
 		return;
 	}
-
-	kobject_get(&swnode->kobj);
 }
 
 void software_node_notify_remove(struct device *dev)

  parent reply	other threads:[~2025-04-10 14:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-06 11:37 [syzbot] [acpi?] KASAN: slab-use-after-free Read in software_node_notify_remove syzbot
2025-04-06 13:13 ` Andy Shevchenko
2025-04-06 13:31   ` syzbot
2025-04-06 13:24 ` Andy Shevchenko
2025-04-06 14:09   ` syzbot
2025-04-08 14:54 ` Andy Shevchenko
2025-04-10  0:57 ` [syzbot] " syzbot
2025-04-10 14:23 ` syzbot [this message]
2025-04-11  0:42 ` [PATCH] software node: Prevent link creation failure from causing kobj reference count imbalance Lizhi Xu
2025-04-14  6:20   ` Andy Shevchenko
2025-04-14  6:27     ` Andy Shevchenko
2025-04-14  7:08     ` Lizhi Xu
2025-04-14  7:16       ` Andy Shevchenko
2025-04-14  7:11     ` [PATCH V2] " Lizhi Xu
2025-04-14  7:22       ` Andy Shevchenko
2025-04-14  8:41       ` Sakari Ailus

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=67f7d44f.050a0220.355867.0004.GAE@google.com \
    --to=syzbot+2ff22910687ee0dfd48e@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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