Re: [syzbot] [kernel?] KASAN: global-out-of-bounds Read in bus_uevent_store

From: Edward Adam Davis

Date: Wed Sep 23 2026 - 06:29:40 EST


From: Edward Aadm Davis <eadavis@xxxxxxxx>

#syz test: upstream 50d05c7c76c9

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index ddbc4d7482d2..09dbee6d8815 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -78,7 +78,7 @@ static int kobject_action_type(const char *buf, size_t count,
count_first = args_start - buf;
args_start = args_start + 1;
} else
- count_first = count;
+ count_first = min_t(size_t, strnlen(buf, count), count);

for (action = 0; action < ARRAY_SIZE(kobject_actions); action++) {
if (strncmp(kobject_actions[action], buf, count_first) != 0)