* [syzbot] [usb?] KASAN: slab-out-of-bounds Read in dummy_free_request
@ 2026-07-29 0:19 syzbot
0 siblings, 0 replies; 3+ messages in thread
From: syzbot @ 2026-07-29 0:19 UTC (permalink / raw)
To: gregkh, linux-kernel, linux-usb, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: f5098b6bae76 Linux 7.2-rc5
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12a57fde580000
kernel config: https://syzkaller.appspot.com/x/.config?x=145fa60d73086782
dashboard link: https://syzkaller.appspot.com/bug?extid=67d9d15423ddc0f15859
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2113dcf433f6/disk-f5098b6b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/413e673b7de4/vmlinux-f5098b6b.xz
kernel image: https://storage.googleapis.com/syzbot-assets/fc40c1b83e80/bzImage-f5098b6b.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+67d9d15423ddc0f15859@syzkaller.appspotmail.com
configfs-gadget.g1 gadget.0: uvc: uvc_function_bind()
configfs-gadget.g1 gadget.0: uvc: Unable to allocate streaming EP
==================================================================
BUG: KASAN: slab-out-of-bounds in list_empty include/linux/list.h:404 [inline]
BUG: KASAN: slab-out-of-bounds in dummy_free_request+0x8a/0x90 drivers/usb/gadget/udc/dummy_hcd.c:710
Read of size 8 at addr ffff888036e3b8f0 by task syz.4.1352/10334
CPU: 0 UID: 0 PID: 10334 Comm: syz.4.1352 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0x13d/0x4b0 mm/kasan/report.c:482
kasan_report+0xdf/0x1c0 mm/kasan/report.c:595
list_empty include/linux/list.h:404 [inline]
dummy_free_request+0x8a/0x90 drivers/usb/gadget/udc/dummy_hcd.c:710
uvc_function_bind+0x181a/0x1939 drivers/usb/gadget/function/f_uvc.c:893
usb_add_function+0x219/0x890 drivers/usb/gadget/composite.c:333
configfs_composite_bind+0xd83/0x1960 drivers/usb/gadget/configfs.c:1802
gadget_bind_driver+0x28c/0xbf0 drivers/usb/gadget/udc/core.c:1662
call_driver_probe drivers/base/dd.c:628 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:706
__driver_probe_device+0x20e/0x450 drivers/base/dd.c:868
driver_probe_device+0x4a/0x140 drivers/base/dd.c:898
__driver_attach+0x21f/0x5b0 drivers/base/dd.c:1292
bus_for_each_dev+0x13e/0x1d0 drivers/base/bus.c:383
bus_add_driver+0x305/0x5b0 drivers/base/bus.c:763
driver_register+0x1e2/0x360 drivers/base/driver.c:174
usb_gadget_register_driver_owner+0x132/0x210 drivers/usb/gadget/udc/core.c:1752
gadget_dev_desc_UDC_store+0x1b0/0x2e0 drivers/usb/gadget/configfs.c:300
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x302/0x4e0 fs/configfs/file.c:229
new_sync_write fs/read_write.c:595 [inline]
vfs_write+0x6ac/0x1050 fs/read_write.c:687
ksys_write+0x12a/0x250 fs/read_write.c:739
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5f1ff9de99
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f5f20ebb028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f5f20225fa0 RCX: 00007f5f1ff9de99
RDX: 000000000000000b RSI: 0000200000000280 RDI: 0000000000000003
RBP: 00007f5f20033eaf R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5f20226038 R14: 00007f5f20225fa0 R15: 00007ffc17e5ad58
</TASK>
Allocated by task 7091:
kasan_save_stack+0x30/0x50 mm/kasan/common.c:57
kasan_save_track+0x14/0x30 mm/kasan/common.c:78
poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
__kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415
kasan_kmalloc include/linux/kasan.h:263 [inline]
__kmalloc_cache_noprof+0x2e5/0x6c0 mm/slub.c:5489
_kmalloc_noprof include/linux/slab.h:988 [inline]
__hw_addr_create+0x57/0x220 net/core/dev_addr_lists.c:62
__hw_addr_add_ex+0x32b/0x650 net/core/dev_addr_lists.c:120
__hw_addr_add net/core/dev_addr_lists.c:137 [inline]
dev_addr_init+0x161/0x250 net/core/dev_addr_lists.c:689
alloc_netdev_mqs+0x363/0x15c0 net/core/dev.c:12071
rtnl_create_link+0xc13/0xf80 net/core/rtnetlink.c:3721
rtnl_newlink_create net/core/rtnetlink.c:3903 [inline]
__rtnl_newlink net/core/rtnetlink.c:4044 [inline]
rtnl_newlink+0x13bd/0x2380 net/core/rtnetlink.c:4159
rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:7076
netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2556
netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1345
netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1900
sock_sendmsg_nosec net/socket.c:775 [inline]
__sock_sendmsg net/socket.c:790 [inline]
__sys_sendto+0x48b/0x4e0 net/socket.c:2252
__do_sys_sendto net/socket.c:2259 [inline]
__se_sys_sendto net/socket.c:2255 [inline]
__x64_sys_sendto+0xe0/0x1c0 net/socket.c:2255
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff888036e3b800
which belongs to the cache kmalloc-128 of size 128
The buggy address is located 136 bytes to the right of
allocated 104-byte region [ffff888036e3b800, ffff888036e3b868)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x36e3b
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff88813fe23a00 dead000000000100 dead000000000122
raw: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5623, tgid 5623 (syz-executor), ts 68307235957, free_ts 68280352608
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1859
prep_new_page mm/page_alloc.c:1867 [inline]
get_page_from_freelist+0xf48/0x3530 mm/page_alloc.c:3946
__alloc_frozen_pages_noprof+0x299/0x2dc0 mm/page_alloc.c:5304
alloc_slab_page mm/slub.c:3266 [inline]
allocate_slab mm/slub.c:3380 [inline]
new_slab+0xa2/0x640 mm/slub.c:3426
refill_objects+0xe3/0x410 mm/slub.c:7310
refill_sheaf mm/slub.c:2804 [inline]
__pcs_replace_empty_main+0x376/0x680 mm/slub.c:4675
alloc_from_pcs mm/slub.c:4773 [inline]
slab_alloc_node mm/slub.c:4905 [inline]
__kmalloc_cache_noprof+0x479/0x6c0 mm/slub.c:5485
_kmalloc_noprof include/linux/slab.h:988 [inline]
__hw_addr_create+0x57/0x220 net/core/dev_addr_lists.c:62
__hw_addr_add_ex+0x32b/0x650 net/core/dev_addr_lists.c:120
__dev_mc_add net/core/dev_addr_lists.c:998 [inline]
dev_mc_add+0xb6/0x110 net/core/dev_addr_lists.c:1016
ip_mc_filter_add net/ipv4/igmp.c:1186 [inline]
igmp_group_added+0x83a/0x9a0 net/ipv4/igmp.c:1375
____ip_mc_inc_group+0x7e3/0x10d0 net/ipv4/igmp.c:1591
br_ip4_multicast_join_snoopers.isra.0+0x152/0x400 net/bridge/br_multicast.c:4162
br_multicast_join_snoopers+0x8b/0x120 net/bridge/br_multicast.c:4182
br_dev_open+0x112/0x150 net/bridge/br_device.c:174
__dev_open+0x3ad/0x8f0 net/core/dev.c:1702
page last free pid 23 tgid 23 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1406 [inline]
__free_frozen_pages+0x79f/0x1090 mm/page_alloc.c:2950
rcu_do_batch kernel/rcu/tree.c:2645 [inline]
rcu_core+0x5a2/0x10d0 kernel/rcu/tree.c:2897
handle_softirqs+0x1ea/0x9b0 kernel/softirq.c:622
run_ksoftirqd kernel/softirq.c:1076 [inline]
run_ksoftirqd+0x38/0x60 kernel/softirq.c:1068
smpboot_thread_fn+0x3d3/0xaa0 kernel/smpboot.c:160
kthread+0x370/0x450 kernel/kthread.c:436
ret_from_fork+0x72b/0xd50 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Memory state around the buggy address:
ffff888036e3b780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888036e3b800: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc
>ffff888036e3b880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888036e3b900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888036e3b980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [syzbot] [usb?] KASAN: slab-out-of-bounds Read in dummy_free_request
@ 2026-10-29 5:45 Basilisk
2026-10-29 6:19 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Basilisk @ 2026-10-29 5:45 UTC (permalink / raw)
To: syzbot+67d9d15423ddc0f15859, linux-usb; +Cc: gregkh, syzkaller-bugs
[-- Attachment #1: Type: text/plain, Size: 1947 bytes --]
Hello,
I recovered a standalone C reproducer for this syzbot report:
https://syzkaller.appspot.com/bug?extid=67d9d15423ddc0f15859
Tested kernel: Linux commit 818bebeb63dd6bf5f4e07e145f6cdbace520a34c,
with KASAN enabled. The test image and kernel config came from the
organizer-issued VM bundle; the config SHA-256
(931eaba43a7eb088afed08418c1eb5bb1894ce6316ec9d91cccdc8759e222c83)
matches the public config linked by syzbot. I used a private copy of
the boot script with guest RAM changed from 2 GiB to 1 GiB; the kernel
image, initramfs, and config were unchanged.
On two fresh boots, the attached repro.c produced a KASAN
slab-out-of-bounds Read of size 8 in dummy_free_request() at
drivers/usb/gadget/udc/dummy_hcd.c:710. The UVC bind logged "Unable to
allocate streaming EP" immediately before the report. The call trace
included dummy_free_request, uvc_function_bind, usb_add_function, and
configfs_composite_bind. The organizer's independent grader also
returned "confirmed" and "reproduced: true" for the same fault family
and function.
To run: compile the attached file with `cc -O2 -Wall -o repro
repro.c`, then run `./repro` as root in an isolated VM with configfs,
usbip-vudc, and dummy_hcd available. It creates a UVC configfs gadget,
binds it to usbip-vudc, unbinds without removing the UVC function,
then attempts to bind the same gadget to dummy_hcd. Inspect the kernel
console after the second bind.
Source inspection suggests that UVC retains a control_req pointer
after the first unbind frees it. The second bind fails to allocate a
streaming endpoint and passes that stale pointer to dummy_hcd's
free_request callback, which reads it using the dummy_request layout.
I have not tested a fix.
The attached file is the same tested code with only its header
comments and one error message updated for this report. Its SHA-256 is
642B0D2C76957105A2BC671F3F562FF2110B09CB61CA7F47D3AD35ECC4ED07F2.
Basilisk
Random Player Killer
[-- Attachment #2: repro.c --]
[-- Type: text/plain, Size: 6071 bytes --]
#define _GNU_SOURCE
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
/*
* Reproducer for Linux 818bebeb63dd6bf5f4e07e145f6cdbace520a34c.
* Reproduced on two fresh VM boots with the same KASAN report.
* Must run as root in an isolated test VM.
*/
static void fail(const char *what, const char *path)
{
fprintf(stderr, "FAIL %s %s: %s\n", what, path, strerror(errno));
exit(1);
}
static void make_path(char out[PATH_MAX], const char *fmt, ...)
{
va_list ap;
int n;
va_start(ap, fmt);
n = vsnprintf(out, PATH_MAX, fmt, ap);
va_end(ap);
if (n < 0 || n >= PATH_MAX) {
fputs("FAIL path too long\n", stderr);
exit(1);
}
}
static void mk(const char *path)
{
if (mkdir(path, 0755) && errno != EEXIST)
fail("mkdir", path);
}
static void wr(const char *path, const char *value)
{
size_t len = strlen(value);
int fd = open(path, O_WRONLY | O_CLOEXEC);
if (fd < 0)
fail("open", path);
if (write(fd, value, len) != (ssize_t)len) {
int saved = errno;
close(fd);
errno = saved ? saved : EIO;
fail("write", path);
}
if (close(fd))
fail("close", path);
}
static int bind_udc(const char *path, const char *name)
{
char value[256];
int fd, saved;
size_t len;
int n = snprintf(value, sizeof(value), "%s\n", name);
if (n < 0 || n >= (int)sizeof(value)) {
errno = ENAMETOOLONG;
return -1;
}
len = (size_t)n;
fd = open(path, O_WRONLY | O_CLOEXEC);
if (fd < 0)
return -1;
if (write(fd, value, len) != (ssize_t)len) {
saved = errno ? errno : EIO;
close(fd);
errno = saved;
return -1;
}
if (close(fd))
return -1;
return 0;
}
static void ln(const char *target, const char *linkname)
{
if (symlink(target, linkname))
fail("symlink", linkname);
}
static void find_udcs(char vudc[256], char dummy[256])
{
struct dirent *entry;
DIR *dir = opendir("/sys/class/udc");
if (!dir)
fail("opendir", "/sys/class/udc");
vudc[0] = dummy[0] = '\0';
while ((entry = readdir(dir)) != NULL) {
if (strstr(entry->d_name, "usbip-vudc") && !vudc[0])
snprintf(vudc, 256, "%s", entry->d_name);
if (strstr(entry->d_name, "dummy_udc") && !dummy[0])
snprintf(dummy, 256, "%s", entry->d_name);
}
closedir(dir);
if (!vudc[0] || !dummy[0]) {
fprintf(stderr, "FAIL UDC discovery: vudc=%s dummy=%s\n",
vudc[0] ? vudc : "missing", dummy[0] ? dummy : "missing");
exit(2);
}
fprintf(stderr, "UDCs: first=%s second=%s\n", vudc, dummy);
}
int main(void)
{
char vudc[256], dummy[256], g[PATH_MAX], f[PATH_MAX], p[PATH_MAX];
char target[PATH_MAX], linkname[PATH_MAX], udc_path[PATH_MAX];
setvbuf(stderr, NULL, _IONBF, 0);
if (geteuid()) {
fputs("FAIL requires root in test VM\n", stderr);
return 2;
}
mk("/sys");
if (access("/sys/class/udc", F_OK) &&
mount("sysfs", "/sys", "sysfs", 0, NULL) && errno != EBUSY)
fail("mount", "/sys");
mk("/sys/kernel/config");
if (access("/sys/kernel/config/usb_gadget", F_OK) &&
mount("none", "/sys/kernel/config", "configfs", 0, NULL) && errno != EBUSY)
fail("mount", "/sys/kernel/config");
find_udcs(vudc, dummy);
make_path(g, "/sys/kernel/config/usb_gadget/rpk_usb_%ld", (long)getpid());
mk(g);
make_path(p, "%s/idVendor", g); wr(p, "0x1d6b\n");
make_path(p, "%s/idProduct", g); wr(p, "0x0104\n");
make_path(p, "%s/bcdUSB", g); wr(p, "0x0200\n");
make_path(p, "%s/configs/c.1", g); mk(p);
make_path(p, "%s/configs/c.1/MaxPower", g); wr(p, "120\n");
make_path(f, "%s/functions/uvc.0", g); mk(f);
/* A documented minimal MJPEG format/frame and the UVC header links. */
make_path(p, "%s/streaming/mjpeg/m", f); mk(p);
make_path(p, "%s/streaming/mjpeg/m/360p", f); mk(p);
make_path(p, "%s/streaming/mjpeg/m/360p/wWidth", f); wr(p, "640\n");
make_path(p, "%s/streaming/mjpeg/m/360p/wHeight", f); wr(p, "360\n");
make_path(p, "%s/streaming/mjpeg/m/360p/dwMaxVideoFrameBufferSize", f); wr(p, "460800\n");
make_path(p, "%s/streaming/mjpeg/m/360p/dwFrameInterval", f); wr(p, "333333\n");
make_path(p, "%s/streaming/header/h", f); mk(p);
make_path(target, "%s/streaming/mjpeg/m", f);
make_path(linkname, "%s/streaming/header/h/m", f); ln(target, linkname);
make_path(target, "%s/streaming/header/h", f);
make_path(linkname, "%s/streaming/class/fs/h", f); ln(target, linkname);
make_path(linkname, "%s/streaming/class/hs/h", f); ln(target, linkname);
make_path(linkname, "%s/streaming/class/ss/h", f); ln(target, linkname);
make_path(p, "%s/control/header/h", f); mk(p);
make_path(target, "%s/control/header/h", f);
make_path(linkname, "%s/control/class/fs/h", f); ln(target, linkname);
make_path(linkname, "%s/control/class/ss/h", f); ln(target, linkname);
make_path(linkname, "%s/configs/c.1/uvc.0", g); ln(f, linkname);
make_path(udc_path, "%s/UDC", g);
fprintf(stderr, "Binding UVC to ISO-capable %s\n", vudc);
if (bind_udc(udc_path, vudc))
fail("first UDC bind", udc_path);
fputs("First bind succeeded; unbinding without unlinking UVC function\n", stderr);
if (bind_udc(udc_path, ""))
fail("UDC unbind", udc_path);
/* The same usb_function survives. dummy_hcd has no ISO streaming EP. */
fprintf(stderr, "Binding same UVC function to %s; expect UVC bind error and KASAN\n", dummy);
if (bind_udc(udc_path, dummy))
fprintf(stderr, "Second bind returned errno=%d (%s); inspect kernel console for KASAN\n",
errno, strerror(errno));
else
fputs("Second bind unexpectedly succeeded; inspect kernel console\n", stderr);
return 0;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [syzbot] [usb?] KASAN: slab-out-of-bounds Read in dummy_free_request
2026-10-29 5:45 [syzbot] [usb?] KASAN: slab-out-of-bounds Read in dummy_free_request Basilisk
@ 2026-10-29 6:19 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2026-10-29 6:19 UTC (permalink / raw)
To: Basilisk; +Cc: syzbot+67d9d15423ddc0f15859, linux-usb, syzkaller-bugs
On Wed, Oct 28, 2026 at 10:45:06PM -0700, Basilisk wrote:
> Hello,
>
> I recovered a standalone C reproducer for this syzbot report:
> https://syzkaller.appspot.com/bug?extid=67d9d15423ddc0f15859
Great! Now you have the tools needed to make a patch to fix it :)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-29 6:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29 5:45 [syzbot] [usb?] KASAN: slab-out-of-bounds Read in dummy_free_request Basilisk
2026-10-29 6:19 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2026-07-29 0:19 syzbot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.