Hello,
syzbot found the following issue on:
HEAD commit: c192ac735768 MAINTAINERS 2: Electric Boogaloo
git tree: upstream
console output:
https://syzkaller.appspot.com/x/log.txt?x=15e208d4a80000
kernel config:
https://syzkaller.appspot.com/x/.config?x=15873d91ff37a949
dashboard link:
https://syzkaller.appspot.com/bug?extid=55d1fa0c2146c6aa29e2
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
CC: [
is...@pobox.com linux-...@vger.kernel.org linux...@vger.kernel.org mch...@kernel.org pvr...@isely.net]
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/6da5bc5c8fe1/disk-c192ac73.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/3f81a7868d33/vmlinux-c192ac73.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/babc24de368c/bzImage-c192ac73.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+55d1fa...@syzkaller.appspotmail.com
pvrusb2: Device being rendered inoperable
pvrusb2: Device being rendered inoperable
==================================================================
BUG: KASAN: slab-use-after-free in pvr2_context_notify drivers/media/usb/pvrusb2/pvrusb2-context.c:95 [inline]
BUG: KASAN: slab-use-after-free in pvr2_context_disconnect+0x1c5/0x1f0 drivers/media/usb/pvrusb2/pvrusb2-context.c:271
Read of size 4 at addr ffff8880152c76d8 by task kworker/0:4/5079
CPU: 0 PID: 5079 Comm: kworker/0:4 Not tainted 6.4.0-syzkaller-12491-gc192ac735768 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023
Workqueue: usb_hub_wq hub_event
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0x163/0x540 mm/kasan/report.c:475
kasan_report+0x175/0x1b0 mm/kasan/report.c:588
pvr2_context_notify drivers/media/usb/pvrusb2/pvrusb2-context.c:95 [inline]
pvr2_context_disconnect+0x1c5/0x1f0 drivers/media/usb/pvrusb2/pvrusb2-context.c:271
pvr_disconnect+0x78/0xe0 drivers/media/usb/pvrusb2/pvrusb2-main.c:79
usb_unbind_interface+0x1d1/0x840 drivers/usb/core/driver.c:458
device_remove drivers/base/dd.c:569 [inline]
__device_release_driver drivers/base/dd.c:1270 [inline]
device_release_driver_internal+0x4f9/0x7a0 drivers/base/dd.c:1293
bus_remove_device+0x341/0x410 drivers/base/bus.c:574
device_del+0x538/0x9c0 drivers/base/core.c:3814
usb_disable_device+0x3bf/0x850 drivers/usb/core/message.c:1420
usb_disconnect+0x340/0x8d0 drivers/usb/core/hub.c:2253
hub_port_connect drivers/usb/core/hub.c:5261 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5566 [inline]
port_event drivers/usb/core/hub.c:5726 [inline]
hub_event+0x1f25/0x52c0 drivers/usb/core/hub.c:5808
process_one_work+0x92c/0x12c0 kernel/workqueue.c:2597
process_scheduled_works kernel/workqueue.c:2664 [inline]
worker_thread+0xd20/0x1210 kernel/workqueue.c:2750
kthread+0x2b8/0x350 kernel/kthread.c:389
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>
Allocated by task 5079:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4f/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:582 [inline]
kzalloc include/linux/slab.h:703 [inline]
pvr2_context_create+0x5b/0x370 drivers/media/usb/pvrusb2/pvrusb2-context.c:207
pvr_probe+0x26/0xd0 drivers/media/usb/pvrusb2/pvrusb2-main.c:54
usb_probe_interface+0x5c4/0xb00 drivers/usb/core/driver.c:396
really_probe+0x294/0xc30 drivers/base/dd.c:658
__driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:798
driver_probe_device+0x50/0x420 drivers/base/dd.c:828
__device_attach_driver+0x2d3/0x520 drivers/base/dd.c:956
bus_for_each_drv+0x24a/0x2d0 drivers/base/bus.c:457
__device_attach+0x32f/0x510 drivers/base/dd.c:1028
bus_probe_device+0x185/0x260 drivers/base/bus.c:532
device_add+0xb75/0xf60 drivers/base/core.c:3625
usb_set_configuration+0x1976/0x1fb0 drivers/usb/core/message.c:2211
usb_generic_driver_probe+0x88/0x140 drivers/usb/core/generic.c:238
usb_probe_device+0x134/0x270 drivers/usb/core/driver.c:293
really_probe+0x294/0xc30 drivers/base/dd.c:658
__driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:798
driver_probe_device+0x50/0x420 drivers/base/dd.c:828
__device_attach_driver+0x2d3/0x520 drivers/base/dd.c:956
bus_for_each_drv+0x24a/0x2d0 drivers/base/bus.c:457
__device_attach+0x32f/0x510 drivers/base/dd.c:1028
bus_probe_device+0x185/0x260 drivers/base/bus.c:532
device_add+0xb75/0xf60 drivers/base/core.c:3625
usb_new_device+0xb7e/0x18d0 drivers/usb/core/hub.c:2590
hub_port_connect drivers/usb/core/hub.c:5422 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5566 [inline]
port_event drivers/usb/core/hub.c:5726 [inline]
hub_event+0x2e9e/0x52c0 drivers/usb/core/hub.c:5808
process_one_work+0x92c/0x12c0 kernel/workqueue.c:2597
process_scheduled_works kernel/workqueue.c:2664 [inline]
worker_thread+0xd20/0x1210 kernel/workqueue.c:2750
kthread+0x2b8/0x350 kernel/kthread.c:389
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
Freed by task 1955:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4f/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522
____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:162 [inline]
slab_free_hook mm/slub.c:1792 [inline]
slab_free_freelist_hook mm/slub.c:1818 [inline]
slab_free mm/slub.c:3801 [inline]
__kmem_cache_free+0x25f/0x3b0 mm/slub.c:3814
pvr2_context_check drivers/media/usb/pvrusb2/pvrusb2-context.c:137 [inline]
pvr2_context_thread_func+0x401/0xb40 drivers/media/usb/pvrusb2/pvrusb2-context.c:158
kthread+0x2b8/0x350 kernel/kthread.c:389
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
The buggy address belongs to the object at ffff8880152c7600
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 216 bytes inside of
freed 256-byte region [ffff8880152c7600, ffff8880152c7700)
The buggy address belongs to the physical page:
page:ffffea000054b180 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x152c6
head:ffffea000054b180 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000010200 ffff888012841b40 ffffea0000a41c00 dead000000000002
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5233, tgid 5233 (udevd), ts 2502895348083, free_ts 2474659527550
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1570
prep_new_page mm/page_alloc.c:1577 [inline]
get_page_from_freelist+0x31e8/0x3370 mm/page_alloc.c:3221
__alloc_pages+0x255/0x670 mm/page_alloc.c:4477
alloc_slab_page+0x6a/0x160 mm/slub.c:1862
allocate_slab mm/slub.c:2009 [inline]
new_slab+0x84/0x2f0 mm/slub.c:2062
___slab_alloc+0xade/0x1100 mm/slub.c:3215
__slab_alloc mm/slub.c:3314 [inline]
__slab_alloc_node mm/slub.c:3367 [inline]
slab_alloc_node mm/slub.c:3460 [inline]
__kmem_cache_alloc_node+0x1af/0x270 mm/slub.c:3509
kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1076
kmalloc include/linux/slab.h:582 [inline]
kzalloc include/linux/slab.h:703 [inline]
smk_fetch+0x92/0x140 security/smack/smack_lsm.c:291
smack_d_instantiate+0x6d9/0xb40 security/smack/smack_lsm.c:3504
security_d_instantiate+0x9b/0xf0 security/security.c:3760
d_instantiate+0x55/0x90 fs/dcache.c:2034
shmem_mknod+0x17d/0x1c0 mm/shmem.c:3089
lookup_open fs/namei.c:3492 [inline]
open_last_lookups fs/namei.c:3560 [inline]
path_openat+0x13e7/0x3180 fs/namei.c:3790
do_filp_open+0x234/0x490 fs/namei.c:3820
do_sys_openat2+0x13e/0x1d0 fs/open.c:1407
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1161 [inline]
free_unref_page_prepare+0x903/0xa30 mm/page_alloc.c:2348
free_unref_page+0x37/0x3f0 mm/page_alloc.c:2443
__slab_free+0x2f6/0x390 mm/slub.c:3707
qlist_free_all+0x22/0x60 mm/kasan/quarantine.c:185
kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:292
__kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:186 [inline]
slab_post_alloc_hook+0x6c/0x3b0 mm/slab.h:762
slab_alloc_node mm/slub.c:3470 [inline]
slab_alloc mm/slub.c:3478 [inline]
__kmem_cache_alloc_lru mm/slub.c:3485 [inline]
kmem_cache_alloc+0x123/0x300 mm/slub.c:3494
getname_flags+0xbc/0x4e0 fs/namei.c:140
vfs_fstatat fs/stat.c:275 [inline]
__do_sys_newfstatat fs/stat.c:446 [inline]
__se_sys_newfstatat fs/stat.c:440 [inline]
__x64_sys_newfstatat+0x12e/0x1d0 fs/stat.c:440
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Memory state around the buggy address:
ffff8880152c7580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880152c7600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880152c7680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880152c7700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880152c7780: 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
syzk...@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup