[v5.15] KASAN: use-after-free Read in em28xx_release_resources (2)

0 views
Skip to first unread message

syzbot

unread,
1:09 PM (11 hours ago) 1:09 PM
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3330a8d33e08 Linux 5.15.201
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=153d6006580000
kernel config: https://syzkaller.appspot.com/x/.config?x=353ae28c40b35af5
dashboard link: https://syzkaller.appspot.com/bug?extid=241270a0dde24c5328f4
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/b65fe19af112/disk-3330a8d3.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/351948519a0d/vmlinux-3330a8d3.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a3b3f8477595/bzImage-3330a8d3.xz

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

em28xx 1-1:0.132: Closing input extension
==================================================================
BUG: KASAN: use-after-free in media_device_unregister+0x13d/0x3f0 drivers/media/mc/mc-device.c:823
Read of size 8 at addr ffff88807a990210 by task kworker/1:18/25375

CPU: 1 PID: 25375 Comm: kworker/1:18 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Workqueue: usb_hub_wq hub_event
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
media_device_unregister+0x13d/0x3f0 drivers/media/mc/mc-device.c:823
em28xx_unregister_media_device drivers/media/usb/em28xx/em28xx-cards.c:3464 [inline]
em28xx_release_resources+0xaa/0x240 drivers/media/usb/em28xx/em28xx-cards.c:3485
em28xx_usb_disconnect+0x196/0x2e0 drivers/media/usb/em28xx/em28xx-cards.c:4154
usb_unbind_interface+0x1ee/0x860 drivers/usb/core/driver.c:458
__device_release_driver drivers/base/dd.c:1229 [inline]
device_release_driver_internal+0x4b4/0x750 drivers/base/dd.c:1262
bus_remove_device+0x2e2/0x400 drivers/base/bus.c:531
device_del+0x6af/0xaf0 drivers/base/core.c:3600
usb_disable_device+0x3e2/0x890 drivers/usb/core/message.c:1414
usb_disconnect+0x348/0x8a0 drivers/usb/core/hub.c:2287
hub_port_connect drivers/usb/core/hub.c:5341 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5637 [inline]
port_event drivers/usb/core/hub.c:5799 [inline]
hub_event+0x1ecb/0x55e0 drivers/usb/core/hub.c:5881
process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
process_scheduled_works kernel/workqueue.c:2373 [inline]
worker_thread+0xd60/0x1290 kernel/workqueue.c:2459
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
</TASK>

The buggy address belongs to the page:
page:ffffea0001ea6400 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7a990
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea00018ab708 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 25378, ts 1321969741527, free_ts 1322525328570
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:5487
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:2542
em28xx_init_extension+0x118/0x1b0 drivers/media/usb/em28xx/em28xx-core.c:1126
process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 kernel/workqueue.c:2457
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:2911
em28xx_init_extension+0x118/0x1b0 drivers/media/usb/em28xx/em28xx-core.c:1126
process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 kernel/workqueue.c:2457
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:
ffff88807a990100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88807a990180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88807a990200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88807a990280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88807a990300: 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