[<prev] [next>] [day] [month] [year] [list]
Message-Id: <2023040126-blandness-duckling-bd55@gregkh>
Date: Sat, 1 Apr 2023 12:09:26 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
syzbot+41d665317c811d4d88aa@...kaller.appspotmail.com
Subject: [PATCH] driver core: class : fix slab-use-after-free Read in class_register()
Syzbot found that we had forgotten to unregister the lock_class_key when
using it in commit dcfbb67e48a2 ("driver core: class: use lock_class_key
already present in struct subsys_private") so fix that up and correctly
release it when done.
Cc: "Rafael J. Wysocki" <rafael@...nel.org>
Reported-and-tested-by: <syzbot+41d665317c811d4d88aa@...kaller.appspotmail.com>
Fixes: dcfbb67e48a2 ("driver core: class: use lock_class_key already present in struct subsys_private")
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/base/class.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 2991936c80db..ac1808d1a2e8 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -103,6 +103,7 @@ static void class_release(struct kobject *kobj)
pr_debug("class '%s' does not have a release() function, "
"be careful\n", class->name);
+ lockdep_unregister_key(&cp->lock_key);
kfree(cp);
}
--
2.40.0
Powered by blists - more mailing lists