[moderation] [media?] KASAN: use-after-free Read in em28xx_v4l2_open (2)

0 views
Skip to first unread message

syzbot

unread,
Nov 17, 2025, 11:15:28 PM (2 days ago) Nov 17
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 18514fd70ea4 usb: typec: ucsi: Add support for orientation
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
console output: https://syzkaller.appspot.com/x/log.txt?x=15fab532580000
kernel config: https://syzkaller.appspot.com/x/.config?x=b3ea418ecc60f813
dashboard link: https://syzkaller.appspot.com/bug?extid=c5f6ea42dfcd8a8d3bbf
compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
CC: [linux-...@vger.kernel.org linux...@vger.kernel.org linu...@vger.kernel.org mch...@kernel.org]

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/01c5ca15331b/disk-18514fd7.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/6a66662ce5db/vmlinux-18514fd7.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8f68d225f2a2/bzImage-18514fd7.xz

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

==================================================================
BUG: KASAN: use-after-free in __mutex_waiter_is_first kernel/locking/mutex.c:183 [inline]
BUG: KASAN: use-after-free in __mutex_lock_common kernel/locking/mutex.c:678 [inline]
BUG: KASAN: use-after-free in __mutex_lock+0xe87/0x1060 kernel/locking/mutex.c:760
Read of size 8 at addr ffff8881138d5b60 by task v4l_id/22982

CPU: 0 UID: 0 PID: 22982 Comm: v4l_id Not tainted syzkaller #0 PREEMPT(voluntary)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xcd/0x630 mm/kasan/report.c:482
kasan_report+0xe0/0x110 mm/kasan/report.c:595
__mutex_waiter_is_first kernel/locking/mutex.c:183 [inline]
__mutex_lock_common kernel/locking/mutex.c:678 [inline]
__mutex_lock+0xe87/0x1060 kernel/locking/mutex.c:760
em28xx_v4l2_open+0x22c/0x7e0 drivers/media/usb/em28xx/em28xx-video.c:2150
v4l2_open+0x1d2/0x5e0 drivers/media/v4l2-core/v4l2-dev.c:433
chrdev_open+0x234/0x6a0 fs/char_dev.c:414
do_dentry_open+0x6da/0x13a0 fs/open.c:965
vfs_open+0x82/0x3f0 fs/open.c:1097
do_open fs/namei.c:3975 [inline]
path_openat+0x1de4/0x2cb0 fs/namei.c:4134
do_filp_open+0x20b/0x470 fs/namei.c:4161
do_sys_openat2+0x11b/0x1d0 fs/open.c:1437
do_sys_open fs/open.c:1452 [inline]
__do_sys_openat fs/open.c:1468 [inline]
__se_sys_openat fs/open.c:1463 [inline]
__x64_sys_openat+0x174/0x210 fs/open.c:1463
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0x4d0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9f4bc1e407
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:00007ffe5bd55d20 EFLAGS: 00000202 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f9f4bb30880 RCX: 00007f9f4bc1e407
RDX: 0000000000000000 RSI: 00007ffe5bd56f22 RDI: ffffffffffffff9c
RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000
R13: 00007ffe5bd55f70 R14: 00007f9f4c3b4000 R15: 000055bd6b3464d8
</TASK>

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1138d5
flags: 0x200000000000000(node=0|zone=2)
raw: 0200000000000000 0000000000000000 00000000ffffffff 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 0x40dc0(GFP_KERNEL|__GFP_ZERO|__GFP_COMP), pid 42, tgid 42 (kworker/1:1), ts 2192968697565, free_ts 2194840796390
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1850
prep_new_page mm/page_alloc.c:1858 [inline]
get_page_from_freelist+0x1003/0x2dc0 mm/page_alloc.c:3884
__alloc_frozen_pages_noprof+0x259/0x21f0 mm/page_alloc.c:5183
alloc_pages_mpol+0xe4/0x410 mm/mempolicy.c:2416
___kmalloc_large_node+0xed/0x160 mm/slub.c:5583
__kmalloc_large_noprof+0x1c/0x70 mm/slub.c:5604
kmalloc_noprof include/linux/slab.h:954 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
em28xx_usb_probe+0x1dc/0x3770 drivers/media/usb/em28xx/em28xx-cards.c:3908
usb_probe_interface+0x303/0xa40 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:581 [inline]
really_probe+0x241/0xa90 drivers/base/dd.c:659
__driver_probe_device+0x1de/0x440 drivers/base/dd.c:801
driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:831
__device_attach_driver+0x1df/0x310 drivers/base/dd.c:959
bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:462
__device_attach+0x1e4/0x4b0 drivers/base/dd.c:1031
bus_probe_device+0x17f/0x1c0 drivers/base/bus.c:537
device_add+0x1148/0x1aa0 drivers/base/core.c:3689
page last free pid 42 tgid 42 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1394 [inline]
__free_frozen_pages+0x78f/0x1000 mm/page_alloc.c:2906
em28xx_free_device drivers/media/usb/em28xx/em28xx-cards.c:3566 [inline]
kref_put include/linux/kref.h:65 [inline]
em28xx_usb_disconnect+0x3a5/0x610 drivers/media/usb/em28xx/em28xx-cards.c:4207
usb_unbind_interface+0x1dd/0x9e0 drivers/usb/core/driver.c:458
device_remove drivers/base/dd.c:571 [inline]
device_remove+0x125/0x170 drivers/base/dd.c:563
__device_release_driver drivers/base/dd.c:1274 [inline]
device_release_driver_internal+0x44b/0x620 drivers/base/dd.c:1297
bus_remove_device+0x22f/0x420 drivers/base/bus.c:579
device_del+0x396/0x9f0 drivers/base/core.c:3878
usb_disable_device+0x355/0x7d0 drivers/usb/core/message.c:1418
usb_disconnect+0x2e1/0x9c0 drivers/usb/core/hub.c:2345
hub_port_connect drivers/usb/core/hub.c:5407 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5707 [inline]
port_event drivers/usb/core/hub.c:5871 [inline]
hub_event+0x1aa2/0x5060 drivers/usb/core/hub.c:5953
process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3263
process_scheduled_works kernel/workqueue.c:3346 [inline]
worker_thread+0x6c8/0xf10 kernel/workqueue.c:3427
kthread+0x3c5/0x780 kernel/kthread.c:463
ret_from_fork+0x56d/0x700 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:
ffff8881138d5a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881138d5a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881138d5b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881138d5b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881138d5c00: 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
Reply all
Reply to author
Forward
0 new messages