[v5.15] KASAN: use-after-free Read in v4l2_open

1 view
Skip to first unread message

syzbot

unread,
Jun 3, 2026, 12:24:28 PM (15 hours ago) Jun 3
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: dc027a595035 Linux 5.15.209
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15e2af2e580000
kernel config: https://syzkaller.appspot.com/x/.config?x=353ae28c40b35af5
dashboard link: https://syzkaller.appspot.com/bug?extid=c1dd77b4721771edcc8f
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/586ac2a2fd9d/disk-dc027a59.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/06dcb6a2fcd3/vmlinux-dc027a59.xz
kernel image: https://storage.googleapis.com/syzbot-assets/567131e0cbcc/bzImage-dc027a59.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+c1dd77...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in v4l2_open+0x352/0x360 drivers/media/v4l2-core/v4l2-dev.c:432
Read of size 4 at addr ffff8880660849b0 by task v4l_id/6177

CPU: 1 PID: 6177 Comm: v4l_id Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
print_address_description+0x60/0x2d0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0xdf/0x130 mm/kasan/report.c:451
v4l2_open+0x352/0x360 drivers/media/v4l2-core/v4l2-dev.c:432
chrdev_open+0x5c5/0x6a0 fs/char_dev.c:414
do_dentry_open+0x7ff/0xf80 fs/open.c:826
do_open fs/namei.c:3616 [inline]
path_openat+0x26f5/0x2fa0 fs/namei.c:3750
do_filp_open+0x1e2/0x410 fs/namei.c:3777
do_sys_openat2+0x150/0x4b0 fs/open.c:1255
do_sys_open fs/open.c:1271 [inline]
__do_sys_openat fs/open.c:1287 [inline]
__se_sys_openat fs/open.c:1282 [inline]
__x64_sys_openat+0x135/0x160 fs/open.c:1282
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fe6e4801407
Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007ffd81ab9650 EFLAGS: 00000202 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fe6e4713880 RCX: 00007fe6e4801407
RDX: 0000000000000000 RSI: 00007ffd81ab9f19 RDI: ffffffffffffff9c
RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000
R13: 00007ffd81ab98a0 R14: 00007fe6e4f8f000 R15: 000055e75eca24d8
</TASK>

The buggy address belongs to the page:
page:ffffea0001982100 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x66084
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffff8880b91409f0 ffff8880b91409f0 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x140dc0(GFP_USER|__GFP_COMP|__GFP_ZERO), pid 23, ts 152501579330, free_ts 152781204874
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x1bbd/0x1ca0 mm/page_alloc.c:4192
__alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501
kmalloc_order+0x40/0x150 mm/slab_common.c:986
kmalloc_order_trace+0x14/0xf0 mm/slab_common.c:1002
kmalloc_large include/linux/slab.h:536 [inline]
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:738 [inline]
em28xx_v4l2_init+0xe2/0x2e50 drivers/media/usb/em28xx/em28xx-video.c:2548
em28xx_init_extension+0x118/0x1b0 drivers/media/usb/em28xx/em28xx-core.c:1126
process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
process_scheduled_works kernel/workqueue.c:2373 [inline]
worker_thread+0xdcf/0x1290 kernel/workqueue.c:2462
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
free_unref_page+0x8f/0x2a0 mm/page_alloc.c:3396
free_nonslab_page+0xe2/0x150 mm/slub.c:3540
em28xx_free_v4l2 drivers/media/usb/em28xx/em28xx-video.c:2128 [inline]
kref_put include/linux/kref.h:65 [inline]
em28xx_v4l2_init+0x1649/0x2e50 drivers/media/usb/em28xx/em28xx-video.c:2917
em28xx_init_extension+0x118/0x1b0 drivers/media/usb/em28xx/em28xx-core.c:1126
process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
process_scheduled_works kernel/workqueue.c:2373 [inline]
worker_thread+0xdcf/0x1290 kernel/workqueue.c:2462
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Memory state around the buggy address:
ffff888066084880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888066084900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888066084980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888066084a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888066084a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================


---
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 syzk...@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

syzbot

unread,
Jun 3, 2026, 4:38:38 PM (11 hours ago) Jun 3
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 228da13e907e Linux 6.1.175
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17d0de66580000
kernel config: https://syzkaller.appspot.com/x/.config?x=4dd3c1715f0a309b
dashboard link: https://syzkaller.appspot.com/bug?extid=c5ac76891d9b32bfdfad
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/a1730af56ab4/disk-228da13e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/eafe9b37a422/vmlinux-228da13e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/7353ac7f337a/bzImage-228da13e.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+c5ac76...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in v4l2_open+0x352/0x360 drivers/media/v4l2-core/v4l2-dev.c:432
Read of size 4 at addr ffff8880609087e8 by task v4l_id/20228

CPU: 0 PID: 20228 Comm: v4l_id Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:420
kasan_report+0x10b/0x140 mm/kasan/report.c:524
v4l2_open+0x352/0x360 drivers/media/v4l2-core/v4l2-dev.c:432
chrdev_open+0x5c5/0x6a0 fs/char_dev.c:414
do_dentry_open+0x7e9/0x10d0 fs/open.c:882
do_open fs/namei.c:3634 [inline]
path_openat+0x2635/0x2ee0 fs/namei.c:3791
do_filp_open+0x1f1/0x430 fs/namei.c:3818
do_sys_openat2+0x150/0x4b0 fs/open.c:1320
do_sys_open fs/open.c:1336 [inline]
__do_sys_openat fs/open.c:1352 [inline]
__se_sys_openat fs/open.c:1347 [inline]
__x64_sys_openat+0x135/0x160 fs/open.c:1347
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f2ae24a7407
Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007ffe140ddf40 EFLAGS: 00000202 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f2ae2bfa880 RCX: 00007f2ae24a7407
RDX: 0000000000000000 RSI: 00007ffe140def1b RDI: ffffffffffffff9c
RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000
R13: 00007ffe140de190 R14: 00007f2ae2d59000 R15: 000056481d5a34d8
</TASK>

Allocated by task 2185:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
____kasan_kmalloc mm/kasan/common.c:375 [inline]
__kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:384
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
em28xx_v4l2_init+0x107/0x2e70 drivers/media/usb/em28xx/em28xx-video.c:2538
em28xx_init_extension+0x118/0x1b0 drivers/media/usb/em28xx/em28xx-core.c:1116
process_one_work+0x8a2/0x1160 kernel/workqueue.c:2292
process_scheduled_works kernel/workqueue.c:2355 [inline]
worker_thread+0xd83/0x1270 kernel/workqueue.c:2444
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Freed by task 2185:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516
____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:237
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1729 [inline]
slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1755
slab_free mm/slub.c:3687 [inline]
__kmem_cache_free+0xb6/0x1f0 mm/slub.c:3700
em28xx_free_v4l2 drivers/media/usb/em28xx/em28xx-video.c:2118 [inline]
kref_put include/linux/kref.h:65 [inline]
em28xx_v4l2_init+0x166c/0x2e70 drivers/media/usb/em28xx/em28xx-video.c:2907
em28xx_init_extension+0x118/0x1b0 drivers/media/usb/em28xx/em28xx-core.c:1116
process_one_work+0x8a2/0x1160 kernel/workqueue.c:2292
process_scheduled_works kernel/workqueue.c:2355 [inline]
worker_thread+0xd83/0x1270 kernel/workqueue.c:2444
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff888060908000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 2024 bytes inside of
8192-byte region [ffff888060908000, ffff88806090a000)

The buggy address belongs to the physical page:
page:ffffea0001824200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x60908
head:ffffea0001824200 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888017442280
raw: 0000000000000000 0000000080020002 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 16784, tgid 16775 (syz.7.2933), ts 935589634079, free_ts 935581646775
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2559
prep_new_page mm/page_alloc.c:2566 [inline]
get_page_from_freelist+0x1a1e/0x1ab0 mm/page_alloc.c:4357
__alloc_pages+0x1ec/0x4f0 mm/page_alloc.c:5657
alloc_slab_page+0x5d/0x160 mm/slub.c:1799
allocate_slab mm/slub.c:1944 [inline]
new_slab+0x87/0x2c0 mm/slub.c:1997
___slab_alloc+0xbc6/0x1240 mm/slub.c:3154
__slab_alloc mm/slub.c:3240 [inline]
slab_alloc_node mm/slub.c:3325 [inline]
__kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3398
kmalloc_trace+0x26/0xe0 mm/slab_common.c:1026
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
mddev_alloc drivers/md/md.c:750 [inline]
md_alloc+0xa5/0xd00 drivers/md/md.c:5705
md_alloc_and_put drivers/md/md.c:5793 [inline]
md_probe+0x53/0xc0 drivers/md/md.c:5806
blk_probe_dev block/genhd.c:749 [inline]
blk_request_module+0x26e/0x290 block/genhd.c:-1
blkdev_get_no_open+0x33/0xc0 block/bdev.c:762
blkdev_get_by_dev+0x74/0xa60 block/bdev.c:819
blkdev_open+0x11e/0x2e0 block/fops.c:500
do_dentry_open+0x7e9/0x10d0 fs/open.c:882
do_open fs/namei.c:3634 [inline]
path_openat+0x2635/0x2ee0 fs/namei.c:3791
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1486 [inline]
free_pcp_prepare mm/page_alloc.c:1536 [inline]
free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3413
free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3508
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:306
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737
slab_alloc_node mm/slub.c:3359 [inline]
__kmem_cache_alloc_node+0x140/0x260 mm/slub.c:3398
__do_kmalloc_node mm/slab_common.c:935 [inline]
__kmalloc+0xa0/0x240 mm/slab_common.c:949
kmalloc include/linux/slab.h:568 [inline]
kzalloc include/linux/slab.h:699 [inline]
tomoyo_encode2 security/tomoyo/realpath.c:45 [inline]
tomoyo_encode+0x27e/0x540 security/tomoyo/realpath.c:80
tomoyo_path_perm+0x382/0x610 security/tomoyo/file.c:831
tomoyo_path_symlink+0xa8/0xf0 security/tomoyo/tomoyo.c:199
security_path_symlink+0xdc/0x130 security/security.c:1199
do_symlinkat+0x10c/0x400 fs/namei.c:4503
__do_sys_symlink fs/namei.c:4530 [inline]
__se_sys_symlink fs/namei.c:4528 [inline]
__x64_sys_symlink+0x7a/0x90 fs/namei.c:4528
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2

Memory state around the buggy address:
ffff888060908680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888060908700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888060908780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888060908800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888060908880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
Reply all
Reply to author
Forward
0 new messages