* [syzbot] [pvrusb2?] [usb?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (3)
@ 2024-04-14 4:26 syzbot
2024-04-14 9:02 ` Hillf Danton
` (3 more replies)
0 siblings, 4 replies; 16+ messages in thread
From: syzbot @ 2024-04-14 4:26 UTC (permalink / raw)
To: isely, linux-kernel, linux-media, linux-usb, mchehab, pvrusb2,
syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: a788e53c05ae usb: usb-acpi: Fix oops due to freeing uninit..
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=157d4305180000
kernel config: https://syzkaller.appspot.com/x/.config?x=dd8c589043bc2b49
dashboard link: https://syzkaller.appspot.com/bug?extid=d0f14b2d5a3d1587fbe7
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16dd1e13180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=120ca915180000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/070d17d2f510/disk-a788e53c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/13f35a4bb3f0/vmlinux-a788e53c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6825f1cdc918/bzImage-a788e53c.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d0f14b2d5a3d1587fbe7@syzkaller.appspotmail.com
pvrusb2: Device being rendered inoperable
==================================================================
BUG: KASAN: slab-use-after-free in pvr2_context_set_notify+0x2c4/0x310 drivers/media/usb/pvrusb2/pvrusb2-context.c:35
Read of size 4 at addr ffff88811356ced8 by task kworker/0:2/720
CPU: 0 PID: 720 Comm: kworker/0:2 Not tainted 6.8.0-rc6-syzkaller-00190-ga788e53c05ae #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: usb_hub_wq hub_event
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:488
kasan_report+0xda/0x110 mm/kasan/report.c:601
pvr2_context_set_notify+0x2c4/0x310 drivers/media/usb/pvrusb2/pvrusb2-context.c:35
pvr2_context_notify drivers/media/usb/pvrusb2/pvrusb2-context.c:95 [inline]
pvr2_context_disconnect+0x94/0xb0 drivers/media/usb/pvrusb2/pvrusb2-context.c:272
pvr_disconnect+0x80/0xf0 drivers/media/usb/pvrusb2/pvrusb2-main.c:79
usb_unbind_interface+0x1e5/0x960 drivers/usb/core/driver.c:461
device_remove drivers/base/dd.c:569 [inline]
device_remove+0x11f/0x170 drivers/base/dd.c:561
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
bus_remove_device+0x22c/0x420 drivers/base/bus.c:574
device_del+0x39a/0xa50 drivers/base/core.c:3828
usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1418
usb_disconnect+0x2e1/0x910 drivers/usb/core/hub.c:2296
hub_port_connect drivers/usb/core/hub.c:5352 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5652 [inline]
port_event drivers/usb/core/hub.c:5812 [inline]
hub_event+0x1be0/0x4f40 drivers/usb/core/hub.c:5894
process_one_work+0x886/0x15d0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:243
</TASK>
Allocated by task 720:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:372 [inline]
__kasan_kmalloc+0x87/0x90 mm/kasan/common.c:389
kmalloc include/linux/slab.h:590 [inline]
kzalloc include/linux/slab.h:711 [inline]
pvr2_context_create+0x53/0x2a0 drivers/media/usb/pvrusb2/pvrusb2-context.c:207
pvr_probe+0x25/0xe0 drivers/media/usb/pvrusb2/pvrusb2-main.c:54
usb_probe_interface+0x307/0x9c0 drivers/usb/core/driver.c:399
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x234/0xc90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x117e/0x1aa0 drivers/base/core.c:3639
usb_set_configuration+0x10cb/0x1c40 drivers/usb/core/message.c:2210
usb_generic_driver_probe+0xad/0x110 drivers/usb/core/generic.c:254
usb_probe_device+0xec/0x3e0 drivers/usb/core/driver.c:294
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x234/0xc90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x117e/0x1aa0 drivers/base/core.c:3639
usb_new_device+0xd90/0x1a10 drivers/usb/core/hub.c:2643
hub_port_connect drivers/usb/core/hub.c:5512 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5652 [inline]
port_event drivers/usb/core/hub.c:5812 [inline]
hub_event+0x2e62/0x4f40 drivers/usb/core/hub.c:5894
process_one_work+0x886/0x15d0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:243
Freed by task 904:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
kasan_save_free_info+0x3f/0x60 mm/kasan/generic.c:643
poison_slab_object mm/kasan/common.c:241 [inline]
__kasan_slab_free+0x106/0x1b0 mm/kasan/common.c:257
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2121 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x105/0x340 mm/slub.c:4409
pvr2_context_check drivers/media/usb/pvrusb2/pvrusb2-context.c:137 [inline]
pvr2_context_thread_func+0x69d/0x960 drivers/media/usb/pvrusb2/pvrusb2-context.c:158
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:243
The buggy address belongs to the object at ffff88811356ce00
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 216 bytes inside of
freed 256-byte region [ffff88811356ce00, ffff88811356cf00)
The buggy address belongs to the physical page:
page:ffffea00044d5b00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11356c
head:ffffea00044d5b00 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0x200000000000840(slab|head|node=0|zone=2)
page_type: 0xffffffff()
raw: 0200000000000840 ffff888100041b40 ffffea000447f900 0000000000000003
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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 11334302324, free_ts 0
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1533
prep_new_page mm/page_alloc.c:1540 [inline]
get_page_from_freelist+0x139c/0x3470 mm/page_alloc.c:3311
__alloc_pages+0x228/0x2250 mm/page_alloc.c:4567
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page mm/slub.c:2190 [inline]
allocate_slab mm/slub.c:2354 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2407
___slab_alloc+0x4b0/0x1860 mm/slub.c:3540
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3625
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
__do_kmalloc_node mm/slub.c:3980 [inline]
__kmalloc_node_track_caller+0x171/0x420 mm/slub.c:4001
__do_krealloc mm/slab_common.c:1187 [inline]
krealloc+0x5d/0xf0 mm/slab_common.c:1220
add_sysfs_param+0xca/0x960 kernel/params.c:654
kernel_add_sysfs_param kernel/params.c:817 [inline]
param_sysfs_builtin kernel/params.c:856 [inline]
param_sysfs_builtin_init+0x2ca/0x450 kernel/params.c:990
do_one_initcall+0x11c/0x650 init/main.c:1236
do_initcall_level init/main.c:1298 [inline]
do_initcalls init/main.c:1314 [inline]
do_basic_setup init/main.c:1333 [inline]
kernel_init_freeable+0x682/0xc10 init/main.c:1551
kernel_init+0x1c/0x2a0 init/main.c:1441
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:243
page_owner free stack trace missing
Memory state around the buggy address:
ffff88811356cd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88811356ce00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88811356ce80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88811356cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88811356cf80: 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 syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
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] 16+ messages in thread
* Re: [syzbot] [pvrusb2?] [usb?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (3)
2024-04-14 4:26 [syzbot] [pvrusb2?] [usb?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (3) syzbot
@ 2024-04-14 9:02 ` Hillf Danton
2024-04-14 9:30 ` syzbot
2024-04-14 9:37 ` [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2) Edward Adam Davis
` (2 subsequent siblings)
3 siblings, 1 reply; 16+ messages in thread
From: Hillf Danton @ 2024-04-14 9:02 UTC (permalink / raw)
To: syzbot; +Cc: linux-kernel, syzkaller-bugs
On Sat, 13 Apr 2024 21:26:30 -0700
> syzbot found the following issue on:
>
> HEAD commit: a788e53c05ae usb: usb-acpi: Fix oops due to freeing uninit..
> git tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=120ca915180000
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
--- x/drivers/media/usb/pvrusb2/pvrusb2-context.c
+++ y/drivers/media/usb/pvrusb2/pvrusb2-context.c
@@ -26,6 +26,8 @@ static int pvr2_context_cleanup_flag;
static int pvr2_context_cleaned_flag;
static struct task_struct *pvr2_context_thread_ptr;
+static DEFINE_MUTEX(pvr2_disconn_mutex);
+static int pvr2_context_cleaning;
static void pvr2_context_set_notify(struct pvr2_context *mp, int fl)
{
@@ -152,6 +154,9 @@ static int pvr2_context_thread_func(void
pvr2_trace(PVR2_TRACE_CTXT,"pvr2_context thread start");
+ mutex_lock(&pvr2_disconn_mutex);
+ pvr2_context_cleaning = 1;
+ mutex_unlock(&pvr2_disconn_mutex);
do {
while ((mp = pvr2_context_notify_first) != NULL) {
pvr2_context_set_notify(mp, 0);
@@ -163,6 +168,9 @@ static int pvr2_context_thread_func(void
pvr2_context_shutok()));
} while (!pvr2_context_shutok());
+ mutex_lock(&pvr2_disconn_mutex);
+ pvr2_context_cleaning = 0;
+ mutex_unlock(&pvr2_disconn_mutex);
pvr2_context_cleaned_flag = !0;
wake_up(&pvr2_context_cleanup_data);
@@ -266,13 +274,17 @@ static void pvr2_context_exit(struct pvr
void pvr2_context_disconnect(struct pvr2_context *mp)
{
+ mutex_lock(&pvr2_disconn_mutex);
+ if (pvr2_context_cleaning)
+ goto out;
pvr2_hdw_disconnect(mp->hdw);
if (!pvr2_context_shutok())
pvr2_context_notify(mp);
mp->disconnect_flag = !0;
+out:
+ mutex_unlock(&pvr2_disconn_mutex);
}
-
void pvr2_channel_init(struct pvr2_channel *cp,struct pvr2_context *mp)
{
pvr2_context_enter(mp);
--
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [syzbot] [pvrusb2?] [usb?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (3)
2024-04-14 9:02 ` Hillf Danton
@ 2024-04-14 9:30 ` syzbot
0 siblings, 0 replies; 16+ messages in thread
From: syzbot @ 2024-04-14 9:30 UTC (permalink / raw)
To: hdanton, linux-kernel, syzkaller-bugs
Hello,
syzbot tried to test the proposed patch but the build/boot failed:
91][ T1] ACPI: 2 ACPI AML tables successfully acquired and loaded
[ 3.614673][ T1] ACPI: _OSC evaluation for CPUs failed, trying _PDC
[ 3.646357][ T1] ACPI: Interpreter enabled
[ 3.648193][ T1] ACPI: PM: (supports S0 S3 S4 S5)
[ 3.649163][ T1] ACPI: Using IOAPIC for interrupt routing
[ 3.650860][ T1] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[ 3.651369][ T1] PCI: Ignoring E820 reservations for host bridge windows
[ 3.662167][ T1] ACPI: Enabled 16 GPEs in block 00 to 0F
[ 4.033152][ T1] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[ 4.034764][ T1] acpi PNP0A03:00: _OSC: OS supports [ASPM ClockPM Segments MSI HPX-Type3]
[ 4.036247][ T1] acpi PNP0A03:00: _OSC: not requesting OS control; OS requires [ExtendedConfig ASPM ClockPM MSI]
[ 4.039584][ T1] acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended configuration space under this bridge
[ 4.075099][ T1] PCI host bridge to bus 0000:00
[ 4.076061][ T1] pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7 window]
[ 4.077387][ T1] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window]
[ 4.078606][ T1] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window]
[ 4.080065][ T1] pci_bus 0000:00: root bus resource [mem 0xc0000000-0xfebfefff window]
[ 4.081402][ T1] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 4.083887][ T1] pci 0000:00:00.0: [8086:1237] type 00 class 0x060000 conventional PCI endpoint
[ 4.094418][ T1] pci 0000:00:01.0: [8086:7110] type 00 class 0x060100 conventional PCI endpoint
[ 4.135316][ T1] pci 0000:00:01.3: [8086:7113] type 00 class 0x068000 conventional PCI endpoint
[ 4.166509][ T1] pci 0000:00:01.3: quirk: [io 0xb000-0xb03f] claimed by PIIX4 ACPI
[ 4.176175][ T1] pci 0000:00:03.0: [1af4:1004] type 00 class 0x000000 conventional PCI endpoint
[ 4.187818][ T1] pci 0000:00:03.0: BAR 0 [io 0xc000-0xc03f]
[ 4.196090][ T1] pci 0000:00:03.0: BAR 1 [mem 0xfe800000-0xfe80007f]
[ 4.223988][ T1] pci 0000:00:04.0: [1af4:1000] type 00 class 0x020000 conventional PCI endpoint
[ 4.234695][ T1] pci 0000:00:04.0: BAR 0 [io 0xc040-0xc07f]
[ 4.243163][ T1] pci 0000:00:04.0: BAR 1 [mem 0xfe801000-0xfe80107f]
[ 4.272806][ T1] pci 0000:00:05.0: [1ae0:a002] type 00 class 0x030000 conventional PCI endpoint
[ 4.285866][ T1] pci 0000:00:05.0: BAR 0 [mem 0xfe000000-0xfe7fffff]
[ 4.317757][ T1] pci 0000:00:05.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
[ 4.329713][ T1] pci 0000:00:06.0: [1af4:1002] type 00 class 0x00ff00 conventional PCI endpoint
[ 4.341390][ T1] pci 0000:00:06.0: BAR 0 [io 0xc080-0xc09f]
[ 4.348543][ T1] pci 0000:00:06.0: BAR 1 [mem 0xfe802000-0xfe80207f]
[ 4.376630][ T1] pci 0000:00:07.0: [1af4:1005] type 00 class 0x00ff00 conventional PCI endpoint
[ 4.387973][ T1] pci 0000:00:07.0: BAR 0 [io 0xc0a0-0xc0bf]
[ 4.396013][ T1] pci 0000:00:07.0: BAR 1 [mem 0xfe803000-0xfe80303f]
[ 4.481476][ T1] ACPI: PCI: Interrupt link LNKA configured for IRQ 10
[ 4.495349][ T1] ACPI: PCI: Interrupt link LNKB configured for IRQ 10
[ 4.508536][ T1] ACPI: PCI: Interrupt link LNKC configured for IRQ 11
[ 4.522312][ T1] ACPI: PCI: Interrupt link LNKD configured for IRQ 11
[ 4.529440][ T1] ACPI: PCI: Interrupt link LNKS configured for IRQ 9
[ 4.565749][ T1] iommu: Default domain type: Translated
[ 4.566927][ T1] iommu: DMA domain TLB invalidation policy: lazy mode
[ 4.574481][ T1] SCSI subsystem initialized
[ 4.579451][ T1] ACPI: bus type USB registered
[ 4.581306][ T1] usbcore: registered new interface driver usbfs
[ 4.589444][ T1] usbcore: registered new interface driver hub
[ 4.591072][ T1] usbcore: registered new device driver usb
[ 4.594960][ T1] mc: Linux media interface: v0.10
[ 4.596691][ T1] videodev: Linux video capture interface: v2.00
[ 4.601447][ T1] pps_core: LinuxPPS API ver. 1 registered
[ 4.602363][ T1] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 4.605231][ T1] PTP clock support registered
[ 4.609007][ T1] EDAC MC: Ver: 3.0.0
[ 4.616776][ T1] Advanced Linux Sound Architecture Driver Initialized.
[ 4.627872][ T1] Bluetooth: Core ver 2.22
[ 4.629284][ T1] NET: Registered PF_BLUETOOTH protocol family
[ 4.630417][ T1] Bluetooth: HCI device and connection manager initialized
[ 4.631589][ T1] Bluetooth: HCI socket layer initialized
[ 4.632742][ T1] Bluetooth: L2CAP socket layer initialized
[ 4.634185][ T1] Bluetooth: SCO socket layer initialized
[ 4.635853][ T1] NET: Registered PF_ATMPVC protocol family
[ 4.636961][ T1] NET: Registered PF_ATMSVC protocol family
[ 4.638662][ T1] NetLabel: Initializing
[ 4.639413][ T1] NetLabel: domain hash size = 128
[ 4.641372][ T1] NetLabel: protocols = UNLABELED CIPSOv4 CALIPSO
[ 4.644039][ T1] NetLabel: unlabeled traffic allowed by default
[ 4.649764][ T1] nfc: nfc_init: NFC Core ver 0.1
[ 4.652037][ T1] NET: Registered PF_NFC protocol family
[ 4.653537][ T1] PCI: Using ACPI for IRQ routing
[ 4.656664][ T1] pci 0000:00:05.0: vgaarb: setting as boot VGA device
[ 4.658465][ T1] pci 0000:00:05.0: vgaarb: bridge control possible
[ 4.659754][ T1] pci 0000:00:05.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[ 4.661395][ T1] vgaarb: loaded
[ 4.682286][ T1] clocksource: Switched to clocksource kvm-clock
[ 4.691143][ T1] VFS: Disk quotas dquot_6.6.0
[ 4.691361][ T1] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 4.696332][ T1] TOMOYO: 2.6.0
[ 4.697632][ T1] Mandatory Access Control activated.
[ 4.706768][ T1] AppArmor: AppArmor Filesystem Enabled
[ 4.709648][ T1] pnp: PnP ACPI init
[ 4.758720][ T1] pnp: PnP ACPI: found 7 devices
[ 4.839879][ T1] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[ 4.844298][ T1] NET: Registered PF_INET protocol family
[ 4.847213][ T1] IP idents hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[ 4.862177][ T1] ------------[ cut here ]------------
[ 4.863545][ T1] refcount_t: decrement hit 0; leaking memory.
[ 4.866291][ T1] WARNING: CPU: 0 PID: 1 at lib/refcount.c:31 refcount_warn_saturate+0x1ed/0x210
[ 4.868831][ T1] Modules linked in:
[ 4.869929][ T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.9.0-rc2-syzkaller-00077-g3d122e6d27e4-dirty #0
[ 4.872557][ T1] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
[ 4.874517][ T1] RIP: 0010:refcount_warn_saturate+0x1ed/0x210
[ 4.876676][ T1] Code: 86 e8 87 1c ca fe 90 0f 0b 90 90 e9 c3 fe ff ff e8 e8 f4 03 ff c6 05 d3 4f 3d 07 01 90 48 c7 c7 00 2e e7 86 e8 64 1c ca fe 90 <0f> 0b 90 90 e9 a0 fe ff ff 48 89 ef e8 52 d1 55 ff e9 44 fe ff ff
[ 4.881228][ T1] RSP: 0000:ffffc9000001fba0 EFLAGS: 00010282
[ 4.882527][ T1] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff8118c1a9
[ 4.884580][ T1] RDX: ffff8881012a8000 RSI: ffffffff8118c1b6 RDI: 0000000000000001
[ 4.885990][ T1] RBP: ffff888106ee853c R08: 0000000000000001 R09: 0000000000000000
[ 4.887750][ T1] R10: 0000000000000000 R11: 0000000000000001 R12: ffff888106ee853c
[ 4.890006][ T1] R13: 0000000000000000 R14: 0000000000a40059 R15: ffff888106679f28
[ 4.891526][ T1] FS: 0000000000000000(0000) GS:ffff8881f6400000(0000) knlGS:0000000000000000
[ 4.893530][ T1] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 4.895233][ T1] CR2: ffff88823ffff000 CR3: 000000000829e000 CR4: 00000000003506f0
[ 4.897559][ T1] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 4.899665][ T1] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 4.901169][ T1] Call Trace:
[ 4.901995][ T1] <TASK>
[ 4.902478][ T1] ? show_regs+0x8c/0xa0
[ 4.904000][ T1] ? __warn+0xe5/0x3c0
[ 4.905027][ T1] ? __wake_up_klogd.part.0+0x99/0xf0
[ 4.906240][ T1] ? refcount_warn_saturate+0x1ed/0x210
[ 4.908147][ T1] ? report_bug+0x3c0/0x580
[ 4.909407][ T1] ? handle_bug+0x3d/0x70
[ 4.910307][ T1] ? exc_invalid_op+0x17/0x50
[ 4.911531][ T1] ? asm_exc_invalid_op+0x1a/0x20
[ 4.913111][ T1] ? __warn_printk+0x199/0x350
[ 4.914285][ T1] ? __warn_printk+0x1a6/0x350
[ 4.915687][ T1] ? refcount_warn_saturate+0x1ed/0x210
[ 4.917380][ T1] __reset_page_owner+0x2ea/0x370
[ 4.918474][ T1] __free_pages_ok+0x5d0/0xbd0
[ 4.919831][ T1] ? __split_page_owner+0xdd/0x120
[ 4.921296][ T1] make_alloc_exact+0x165/0x260
[ 4.922990][ T1] alloc_large_system_hash+0x4e0/0x640
[ 4.924052][ T1] inet_hashinfo2_init+0x4b/0xd0
[ 4.925350][ T1] tcp_init+0xba/0x9f0
[ 4.926596][ T1] inet_init+0x419/0x6f0
[ 4.928032][ T1] ? __pfx_inet_init+0x10/0x10
[ 4.929343][ T1] do_one_initcall+0x128/0x700
[ 4.930535][ T1] ? __pfx_do_one_initcall+0x10/0x10
[ 4.932057][ T1] ? trace_kmalloc+0x2d/0xe0
[ 4.932985][ T1] ? __kmalloc+0x213/0x400
[ 4.933838][ T1] kernel_init_freeable+0x69d/0xca0
[ 4.934840][ T1] ? __pfx_kernel_init+0x10/0x10
[ 4.935868][ T1] kernel_init+0x1c/0x2b0
[ 4.937223][ T1] ? __pfx_kernel_init+0x10/0x10
[ 4.938288][ T1] ret_from_fork+0x45/0x80
[ 4.939009][ T1] ? __pfx_kernel_init+0x10/0x10
[ 4.940454][ T1] ret_from_fork_asm+0x1a/0x30
[ 4.941548][ T1] </TASK>
[ 4.942500][ T1] Kernel panic - not syncing: kernel: panic_on_warn set ...
[ 4.944326][ T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.9.0-rc2-syzkaller-00077-g3d122e6d27e4-dirty #0
[ 4.946854][ T1] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
[ 4.949083][ T1] Call Trace:
[ 4.950163][ T1] <TASK>
[ 4.950970][ T1] dump_stack_lvl+0x3d/0x1f0
[ 4.951524][ T1] panic+0x6f5/0x7a0
[ 4.951524][ T1] ? __pfx_panic+0x10/0x10
[ 4.951524][ T1] ? show_trace_log_lvl+0x363/0x500
[ 4.951524][ T1] ? check_panic_on_warn+0x1f/0xb0
[ 4.951524][ T1] ? refcount_warn_saturate+0x1ed/0x210
[ 4.951524][ T1] check_panic_on_warn+0xab/0xb0
[ 4.951524][ T1] __warn+0xf1/0x3c0
[ 4.951524][ T1] ? __wake_up_klogd.part.0+0x99/0xf0
[ 4.951524][ T1] ? refcount_warn_saturate+0x1ed/0x210
[ 4.951524][ T1] report_bug+0x3c0/0x580
[ 4.951524][ T1] handle_bug+0x3d/0x70
[ 4.951524][ T1] exc_invalid_op+0x17/0x50
[ 4.951524][ T1] asm_exc_invalid_op+0x1a/0x20
[ 4.951524][ T1] RIP: 0010:refcount_warn_saturate+0x1ed/0x210
[ 4.951524][ T1] Code: 86 e8 87 1c ca fe 90 0f 0b 90 90 e9 c3 fe ff ff e8 e8 f4 03 ff c6 05 d3 4f 3d 07 01 90 48 c7 c7 00 2e e7 86 e8 64 1c ca fe 90 <0f> 0b 90 90 e9 a0 fe ff ff 48 89 ef e8 52 d1 55 ff e9 44 fe ff ff
[ 4.951524][ T1] RSP: 0000:ffffc9000001fba0 EFLAGS: 00010282
[ 4.951524][ T1] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff8118c1a9
[ 4.951524][ T1] RDX: ffff8881012a8000 RSI: ffffffff8118c1b6 RDI: 0000000000000001
[ 4.951524][ T1] RBP: ffff888106ee853c R08: 0000000000000001 R09: 0000000000000000
[ 4.951524][ T1] R10: 0000000000000000 R11: 0000000000000001 R12: ffff888106ee853c
[ 4.951524][ T1] R13: 0000000000000000 R14: 0000000000a40059 R15: ffff888106679f28
[ 4.951524][ T1] ? __warn_printk+0x199/0x350
[ 4.951524][ T1] ? __warn_printk+0x1a6/0x350
[ 4.951524][ T1] __reset_page_owner+0x2ea/0x370
[ 4.951524][ T1] __free_pages_ok+0x5d0/0xbd0
[ 4.951524][ T1] ? __split_page_owner+0xdd/0x120
[ 4.951524][ T1] make_alloc_exact+0x165/0x260
[ 4.951524][ T1] alloc_large_system_hash+0x4e0/0x640
[ 4.951524][ T1] inet_hashinfo2_init+0x4b/0xd0
[ 4.951524][ T1] tcp_init+0xba/0x9f0
[ 4.951524][ T1] inet_init+0x419/0x6f0
[ 4.951524][ T1] ? __pfx_inet_init+0x10/0x10
[ 5.001542][ T1] do_one_initcall+0x128/0x700
[ 5.001542][ T1] ? __pfx_do_one_initcall+0x10/0x10
[ 5.001542][ T1] ? trace_kmalloc+0x2d/0xe0
[ 5.001542][ T1] ? __kmalloc+0x213/0x400
[ 5.001542][ T1] kernel_init_freeable+0x69d/0xca0
[ 5.001542][ T1] ? __pfx_kernel_init+0x10/0x10
[ 5.001542][ T1] kernel_init+0x1c/0x2b0
[ 5.001542][ T1] ? __pfx_kernel_init+0x10/0x10
[ 5.001542][ T1] ret_from_fork+0x45/0x80
[ 5.001542][ T1] ? __pfx_kernel_init+0x10/0x10
[ 5.001542][ T1] ret_from_fork_asm+0x1a/0x30
[ 5.001542][ T1] </TASK>
[ 5.001542][ T1] Rebooting in 86400 seconds..
syzkaller build log:
go env (err=<nil>)
GO111MODULE='auto'
GOARCH='amd64'
GOBIN=''
GOCACHE='/syzkaller/.cache/go-build'
GOENV='/syzkaller/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/syzkaller/jobs-2/linux/gopath/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/syzkaller/jobs-2/linux/gopath'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/syzkaller/jobs-2/linux/gopath/src/github.com/google/syzkaller/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1222580029=/tmp/go-build -gno-record-gcc-switches'
git status (err=<nil>)
HEAD detached at 171ec3714
nothing to commit, working tree clean
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
Makefile:31: run command via tools/syz-env for best compatibility, see:
Makefile:32: https://github.com/google/syzkaller/blob/master/docs/contributing.md#using-syz-env
go list -f '{{.Stale}}' ./sys/syz-sysgen | grep -q false || go install ./sys/syz-sysgen
make .descriptions
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
Makefile:31: run command via tools/syz-env for best compatibility, see:
Makefile:32: https://github.com/google/syzkaller/blob/master/docs/contributing.md#using-syz-env
bin/syz-sysgen
touch .descriptions
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=171ec3714ee4886a3f5ecbfe71f63c8f81c7fd7c -X 'github.com/google/syzkaller/prog.gitRevisionDate=20240409-121653'" "-tags=syz_target syz_os_linux syz_arch_amd64 " -o ./bin/linux_amd64/syz-fuzzer github.com/google/syzkaller/syz-fuzzer
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=171ec3714ee4886a3f5ecbfe71f63c8f81c7fd7c -X 'github.com/google/syzkaller/prog.gitRevisionDate=20240409-121653'" "-tags=syz_target syz_os_linux syz_arch_amd64 " -o ./bin/linux_amd64/syz-execprog github.com/google/syzkaller/tools/syz-execprog
GOOS=linux GOARCH=amd64 go build "-ldflags=-s -w -X github.com/google/syzkaller/prog.GitRevision=171ec3714ee4886a3f5ecbfe71f63c8f81c7fd7c -X 'github.com/google/syzkaller/prog.gitRevisionDate=20240409-121653'" "-tags=syz_target syz_os_linux syz_arch_amd64 " -o ./bin/linux_amd64/syz-stress github.com/google/syzkaller/tools/syz-stress
mkdir -p ./bin/linux_amd64
gcc -o ./bin/linux_amd64/syz-executor executor/executor.cc \
-m64 -O2 -pthread -Wall -Werror -Wparentheses -Wunused-const-variable -Wframe-larger-than=16384 -Wno-stringop-overflow -Wno-array-bounds -Wno-format-overflow -Wno-unused-but-set-variable -Wno-unused-command-line-argument -static-pie -fpermissive -w -DGOOS_linux=1 -DGOARCH_amd64=1 \
-DHOSTGOOS_linux=1 -DGIT_REVISION=\"171ec3714ee4886a3f5ecbfe71f63c8f81c7fd7c\"
Error text is too large and was truncated, full error text is at:
https://syzkaller.appspot.com/x/error.txt?x=10eba243180000
Tested on:
commit: 3d122e6d usb: typec: mux: gpio-sbu: Allow GPIO operati..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
kernel config: https://syzkaller.appspot.com/x/.config?x=bd9338c1f703fa5f
dashboard link: https://syzkaller.appspot.com/bug?extid=d0f14b2d5a3d1587fbe7
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1182aaf5180000
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2)
2024-04-14 4:26 [syzbot] [pvrusb2?] [usb?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (3) syzbot
2024-04-14 9:02 ` Hillf Danton
@ 2024-04-14 9:37 ` Edward Adam Davis
2024-04-14 9:53 ` [syzbot] [pvrusb2?] [usb?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (3) syzbot
2024-04-14 11:09 ` Hillf Danton
2024-04-14 12:58 ` [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2) Edward Adam Davis
3 siblings, 1 reply; 16+ messages in thread
From: Edward Adam Davis @ 2024-04-14 9:37 UTC (permalink / raw)
To: syzbot+d0f14b2d5a3d1587fbe7; +Cc: linux-kernel, syzkaller-bugs
please test uaf in pvr2_context_set_notify
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-context.c b/drivers/media/usb/pvrusb2/pvrusb2-context.c
index 1764674de98b..e93bca93ce4c 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-context.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-context.c
@@ -267,9 +267,9 @@ static void pvr2_context_exit(struct pvr2_context *mp)
void pvr2_context_disconnect(struct pvr2_context *mp)
{
pvr2_hdw_disconnect(mp->hdw);
- mp->disconnect_flag = !0;
if (!pvr2_context_shutok())
pvr2_context_notify(mp);
+ mp->disconnect_flag = !0;
}
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [syzbot] [pvrusb2?] [usb?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (3)
2024-04-14 4:26 [syzbot] [pvrusb2?] [usb?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (3) syzbot
2024-04-14 9:02 ` Hillf Danton
2024-04-14 9:37 ` [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2) Edward Adam Davis
@ 2024-04-14 11:09 ` Hillf Danton
2024-04-14 11:27 ` syzbot
2024-04-14 12:58 ` [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2) Edward Adam Davis
3 siblings, 1 reply; 16+ messages in thread
From: Hillf Danton @ 2024-04-14 11:09 UTC (permalink / raw)
To: syzbot; +Cc: linux-kernel, syzkaller-bugs
On Sat, 13 Apr 2024 21:26:30 -0700
> syzbot found the following issue on:
>
> HEAD commit: a788e53c05ae usb: usb-acpi: Fix oops due to freeing uninit..
> git tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=120ca915180000
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
--- x/drivers/media/usb/pvrusb2/pvrusb2-context.c
+++ y/drivers/media/usb/pvrusb2/pvrusb2-context.c
@@ -26,6 +26,8 @@ static int pvr2_context_cleanup_flag;
static int pvr2_context_cleaned_flag;
static struct task_struct *pvr2_context_thread_ptr;
+static DEFINE_MUTEX(pvr2_disconn_mutex);
+static int pvr2_context_cleaning;
static void pvr2_context_set_notify(struct pvr2_context *mp, int fl)
{
@@ -152,6 +154,9 @@ static int pvr2_context_thread_func(void
pvr2_trace(PVR2_TRACE_CTXT,"pvr2_context thread start");
+ mutex_lock(&pvr2_disconn_mutex);
+ pvr2_context_cleaning = 1;
+ mutex_unlock(&pvr2_disconn_mutex);
do {
while ((mp = pvr2_context_notify_first) != NULL) {
pvr2_context_set_notify(mp, 0);
@@ -163,6 +168,9 @@ static int pvr2_context_thread_func(void
pvr2_context_shutok()));
} while (!pvr2_context_shutok());
+ mutex_lock(&pvr2_disconn_mutex);
+ pvr2_context_cleaning = 0;
+ mutex_unlock(&pvr2_disconn_mutex);
pvr2_context_cleaned_flag = !0;
wake_up(&pvr2_context_cleanup_data);
@@ -266,13 +274,17 @@ static void pvr2_context_exit(struct pvr
void pvr2_context_disconnect(struct pvr2_context *mp)
{
+ mutex_lock(&pvr2_disconn_mutex);
+ if (pvr2_context_cleaning)
+ goto out;
pvr2_hdw_disconnect(mp->hdw);
if (!pvr2_context_shutok())
pvr2_context_notify(mp);
mp->disconnect_flag = !0;
+out:
+ mutex_unlock(&pvr2_disconn_mutex);
}
-
void pvr2_channel_init(struct pvr2_channel *cp,struct pvr2_context *mp)
{
pvr2_context_enter(mp);
--
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2)
2024-04-14 4:26 [syzbot] [pvrusb2?] [usb?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (3) syzbot
` (2 preceding siblings ...)
2024-04-14 11:09 ` Hillf Danton
@ 2024-04-14 12:58 ` Edward Adam Davis
2024-04-14 13:21 ` [syzbot] [pvrusb2?] [usb?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (3) syzbot
3 siblings, 1 reply; 16+ messages in thread
From: Edward Adam Davis @ 2024-04-14 12:58 UTC (permalink / raw)
To: syzbot+d0f14b2d5a3d1587fbe7; +Cc: linux-kernel, syzkaller-bugs
please test uaf in pvr2_context_set_notify
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git a788e53c05ae
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-context.c b/drivers/media/usb/pvrusb2/pvrusb2-context.c
index 1764674de98b..e93bca93ce4c 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-context.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-context.c
@@ -267,9 +267,9 @@ static void pvr2_context_exit(struct pvr2_context *mp)
void pvr2_context_disconnect(struct pvr2_context *mp)
{
pvr2_hdw_disconnect(mp->hdw);
- mp->disconnect_flag = !0;
if (!pvr2_context_shutok())
pvr2_context_notify(mp);
+ mp->disconnect_flag = !0;
}
^ permalink raw reply related [flat|nested] 16+ messages in thread
[parent not found: <CZ5SKT22SUPI.1CKVD5QORTT2B@getstate.dev>]
* Re: [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2)
[not found] <CZ5SKT22SUPI.1CKVD5QORTT2B@getstate.dev>
@ 2024-02-15 16:37 ` syzbot
0 siblings, 0 replies; 16+ messages in thread
From: syzbot @ 2024-02-15 16:37 UTC (permalink / raw)
To: linux-kernel, mazin, syzkaller-bugs
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: slab-use-after-free Read in pvr2_context_set_notify
usb 2-1: USB disconnect, device number 3
pvrusb2: Device being rendered inoperable
==================================================================
BUG: KASAN: slab-use-after-free in pvr2_context_set_notify+0x2da/0x330 drivers/media/usb/pvrusb2/pvrusb2-context.c:38
Read of size 4 at addr ffff8881118c18d8 by task kworker/1:3/5383
CPU: 1 PID: 5383 Comm: kworker/1:3 Not tainted 6.8.0-rc3-syzkaller-00049-g88bae831f381-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Workqueue: usb_hub_wq hub_event
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:488
kasan_report+0xda/0x110 mm/kasan/report.c:601
pvr2_context_set_notify+0x2da/0x330 drivers/media/usb/pvrusb2/pvrusb2-context.c:38
pvr2_context_notify drivers/media/usb/pvrusb2/pvrusb2-context.c:98 [inline]
pvr2_context_disconnect+0x94/0xb0 drivers/media/usb/pvrusb2/pvrusb2-context.c:276
pvr_disconnect+0x80/0xf0 drivers/media/usb/pvrusb2/pvrusb2-main.c:79
usb_unbind_interface+0x1e5/0x960 drivers/usb/core/driver.c:461
device_remove drivers/base/dd.c:569 [inline]
device_remove+0x11f/0x170 drivers/base/dd.c:561
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
bus_remove_device+0x22c/0x420 drivers/base/bus.c:574
device_del+0x39a/0xa50 drivers/base/core.c:3814
usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1416
usb_disconnect+0x2e1/0x910 drivers/usb/core/hub.c:2296
hub_port_connect drivers/usb/core/hub.c:5352 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5652 [inline]
port_event drivers/usb/core/hub.c:5812 [inline]
hub_event+0x1be0/0x4f40 drivers/usb/core/hub.c:5894
process_one_work+0x886/0x15d0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
</TASK>
Allocated by task 5383:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:372 [inline]
__kasan_kmalloc+0x87/0x90 mm/kasan/common.c:389
kmalloc include/linux/slab.h:590 [inline]
kzalloc include/linux/slab.h:711 [inline]
pvr2_context_create+0x53/0x2a0 drivers/media/usb/pvrusb2/pvrusb2-context.c:211
pvr_probe+0x25/0xe0 drivers/media/usb/pvrusb2/pvrusb2-main.c:54
usb_probe_interface+0x307/0x9c0 drivers/usb/core/driver.c:399
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x234/0xc90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x117e/0x1aa0 drivers/base/core.c:3625
usb_set_configuration+0x10cb/0x1c40 drivers/usb/core/message.c:2207
usb_generic_driver_probe+0xad/0x110 drivers/usb/core/generic.c:254
usb_probe_device+0xec/0x3e0 drivers/usb/core/driver.c:294
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x234/0xc90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x117e/0x1aa0 drivers/base/core.c:3625
usb_new_device+0xd90/0x1a10 drivers/usb/core/hub.c:2643
hub_port_connect drivers/usb/core/hub.c:5512 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5652 [inline]
port_event drivers/usb/core/hub.c:5812 [inline]
hub_event+0x2e62/0x4f40 drivers/usb/core/hub.c:5894
process_one_work+0x886/0x15d0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
Freed by task 903:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
kasan_save_free_info+0x3f/0x60 mm/kasan/generic.c:640
poison_slab_object mm/kasan/common.c:241 [inline]
__kasan_slab_free+0x106/0x1b0 mm/kasan/common.c:257
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2121 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x105/0x340 mm/slub.c:4409
pvr2_context_check drivers/media/usb/pvrusb2/pvrusb2-context.c:140 [inline]
pvr2_context_thread_func+0x69d/0x960 drivers/media/usb/pvrusb2/pvrusb2-context.c:162
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
The buggy address belongs to the object at ffff8881118c1800
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 216 bytes inside of
freed 256-byte region [ffff8881118c1800, ffff8881118c1900)
The buggy address belongs to the physical page:
page:ffffea0004463000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1118c0
head:ffffea0004463000 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x200000000000840(slab|head|node=0|zone=2)
page_type: 0xffffffff()
raw: 0200000000000840 ffff888100041b40 dead000000000122 0000000000000000
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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 725, tgid 725 (kworker/1:2), ts 126894022572, free_ts 126831374891
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1533
prep_new_page mm/page_alloc.c:1540 [inline]
get_page_from_freelist+0x139c/0x3470 mm/page_alloc.c:3311
__alloc_pages+0x228/0x2250 mm/page_alloc.c:4567
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page mm/slub.c:2190 [inline]
allocate_slab mm/slub.c:2354 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2407
___slab_alloc+0x4b0/0x1860 mm/slub.c:3540
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3625
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
kmalloc_trace+0x2ce/0x300 mm/slub.c:4007
kmalloc include/linux/slab.h:590 [inline]
kzalloc include/linux/slab.h:711 [inline]
pvr2_context_create+0x53/0x2a0 drivers/media/usb/pvrusb2/pvrusb2-context.c:211
pvr_probe+0x25/0xe0 drivers/media/usb/pvrusb2/pvrusb2-main.c:54
usb_probe_interface+0x307/0x9c0 drivers/usb/core/driver.c:399
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x234/0xc90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
page last free pid 725 tgid 725 stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1140 [inline]
free_unref_page_prepare+0x504/0xae0 mm/page_alloc.c:2346
free_unref_page+0x33/0x2d0 mm/page_alloc.c:2486
rcu_do_batch kernel/rcu/tree.c:2190 [inline]
rcu_core+0x819/0x1680 kernel/rcu/tree.c:2465
__do_softirq+0x20a/0x8c1 kernel/softirq.c:553
Memory state around the buggy address:
ffff8881118c1780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8881118c1800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881118c1880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881118c1900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8881118c1980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
Tested on:
commit: 88bae831 usb: typec: ucsi: Add qcm6490-pmic-glink as n..
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=10c5de84180000
kernel config: https://syzkaller.appspot.com/x/.config?x=28a3704ea90ef255
dashboard link: https://syzkaller.appspot.com/bug?extid=ce750e124675d4599449
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1706f648180000
^ permalink raw reply [flat|nested] 16+ messages in thread
[parent not found: <mailman.217.1706634262.2961.pvrusb2@isely.net>]
* Re: [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2)
[not found] <mailman.217.1706634262.2961.pvrusb2@isely.net>
@ 2024-01-31 10:22 ` syzbot
2024-02-16 0:42 ` Hillf Danton
2024-02-16 3:03 ` Edward Adam Davis
0 siblings, 2 replies; 16+ messages in thread
From: syzbot @ 2024-01-31 10:22 UTC (permalink / raw)
To: isely, linux-kernel, linux-media, linux-usb, mchehab,
pvrusb2-owner, pvrusb2, syzkaller-bugs
syzbot has found a reproducer for the following issue on:
HEAD commit: f1a27f081c1f usb: typec: qcom-pmic-typec: allow different ..
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=14800bdfe80000
kernel config: https://syzkaller.appspot.com/x/.config?x=986ce9258c6856ff
dashboard link: https://syzkaller.appspot.com/bug?extid=ce750e124675d4599449
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17c7cad3e80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1429ed40180000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c77efcf770e8/disk-f1a27f08.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a827d6ba40bf/vmlinux-f1a27f08.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9d21d228bf73/bzImage-f1a27f08.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ce750e124675d4599449@syzkaller.appspotmail.com
pvrusb2: Device being rendered inoperable
==================================================================
BUG: KASAN: slab-use-after-free in pvr2_context_set_notify+0x2c4/0x310 drivers/media/usb/pvrusb2/pvrusb2-context.c:35
Read of size 4 at addr ffff888112202ad8 by task kworker/0:1/9
CPU: 0 PID: 9 Comm: kworker/0:1 Not tainted 6.8.0-rc1-syzkaller-00046-gf1a27f081c1f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Workqueue: usb_hub_wq hub_event
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:488
kasan_report+0xda/0x110 mm/kasan/report.c:601
pvr2_context_set_notify+0x2c4/0x310 drivers/media/usb/pvrusb2/pvrusb2-context.c:35
pvr2_context_notify drivers/media/usb/pvrusb2/pvrusb2-context.c:95 [inline]
pvr2_context_disconnect+0x94/0xb0 drivers/media/usb/pvrusb2/pvrusb2-context.c:272
pvr_disconnect+0x80/0xf0 drivers/media/usb/pvrusb2/pvrusb2-main.c:79
usb_unbind_interface+0x1e5/0x960 drivers/usb/core/driver.c:461
device_remove drivers/base/dd.c:569 [inline]
device_remove+0x11f/0x170 drivers/base/dd.c:561
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
bus_remove_device+0x22c/0x420 drivers/base/bus.c:574
device_del+0x39a/0xa50 drivers/base/core.c:3814
usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1416
usb_disconnect+0x2e1/0x910 drivers/usb/core/hub.c:2286
hub_port_connect drivers/usb/core/hub.c:5334 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5634 [inline]
port_event drivers/usb/core/hub.c:5794 [inline]
hub_event+0x1be0/0x4f40 drivers/usb/core/hub.c:5876
process_one_work+0x886/0x15d0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
</TASK>
Allocated by task 9:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:372 [inline]
__kasan_kmalloc+0x87/0x90 mm/kasan/common.c:389
kmalloc include/linux/slab.h:590 [inline]
kzalloc include/linux/slab.h:711 [inline]
pvr2_context_create+0x53/0x2a0 drivers/media/usb/pvrusb2/pvrusb2-context.c:207
pvr_probe+0x25/0xe0 drivers/media/usb/pvrusb2/pvrusb2-main.c:54
usb_probe_interface+0x307/0x9c0 drivers/usb/core/driver.c:399
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x234/0xc90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x117e/0x1aa0 drivers/base/core.c:3625
usb_set_configuration+0x10cb/0x1c40 drivers/usb/core/message.c:2207
usb_generic_driver_probe+0xad/0x110 drivers/usb/core/generic.c:254
usb_probe_device+0xec/0x3e0 drivers/usb/core/driver.c:294
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x234/0xc90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x117e/0x1aa0 drivers/base/core.c:3625
usb_new_device+0xd80/0x19f0 drivers/usb/core/hub.c:2625
hub_port_connect drivers/usb/core/hub.c:5494 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5634 [inline]
port_event drivers/usb/core/hub.c:5794 [inline]
hub_event+0x2e62/0x4f40 drivers/usb/core/hub.c:5876
process_one_work+0x886/0x15d0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
Freed by task 901:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
kasan_save_free_info+0x3f/0x60 mm/kasan/generic.c:640
poison_slab_object mm/kasan/common.c:241 [inline]
__kasan_slab_free+0x106/0x1b0 mm/kasan/common.c:257
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2121 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x105/0x340 mm/slub.c:4409
pvr2_context_check drivers/media/usb/pvrusb2/pvrusb2-context.c:137 [inline]
pvr2_context_thread_func+0x69d/0x960 drivers/media/usb/pvrusb2/pvrusb2-context.c:158
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
The buggy address belongs to the object at ffff888112202a00
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 216 bytes inside of
freed 256-byte region [ffff888112202a00, ffff888112202b00)
The buggy address belongs to the physical page:
page:ffffea0004488080 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x112202
head:ffffea0004488080 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0x200000000000840(slab|head|node=0|zone=2)
page_type: 0xffffffff()
raw: 0200000000000840 ffff888100041b40 ffffea0004498080 0000000000000005
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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 7680321640, free_ts 0
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1533
prep_new_page mm/page_alloc.c:1540 [inline]
get_page_from_freelist+0x139c/0x3470 mm/page_alloc.c:3311
__alloc_pages+0x228/0x2250 mm/page_alloc.c:4567
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page mm/slub.c:2190 [inline]
allocate_slab mm/slub.c:2354 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2407
___slab_alloc+0x4b0/0x1860 mm/slub.c:3540
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3625
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
__do_kmalloc_node mm/slub.c:3980 [inline]
__kmalloc_node_track_caller+0x171/0x420 mm/slub.c:4001
__do_krealloc mm/slab_common.c:1187 [inline]
krealloc+0x5d/0xf0 mm/slab_common.c:1220
add_sysfs_param+0xca/0x960 kernel/params.c:654
kernel_add_sysfs_param kernel/params.c:817 [inline]
param_sysfs_builtin kernel/params.c:856 [inline]
param_sysfs_builtin_init+0x2ca/0x450 kernel/params.c:990
do_one_initcall+0x11c/0x650 init/main.c:1236
do_initcall_level init/main.c:1298 [inline]
do_initcalls init/main.c:1314 [inline]
do_basic_setup init/main.c:1333 [inline]
kernel_init_freeable+0x682/0xc10 init/main.c:1551
kernel_init+0x1c/0x2a0 init/main.c:1441
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
page_owner free stack trace missing
Memory state around the buggy address:
ffff888112202980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888112202a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888112202a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888112202b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888112202b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2)
2024-01-31 10:22 ` syzbot
@ 2024-02-16 0:42 ` Hillf Danton
2024-02-16 4:58 ` syzbot
2024-02-16 3:03 ` Edward Adam Davis
1 sibling, 1 reply; 16+ messages in thread
From: Hillf Danton @ 2024-02-16 0:42 UTC (permalink / raw)
To: syzbot; +Cc: linux-kernel, syzkaller-bugs
On Wed, 31 Jan 2024 02:22:39 -0800
> HEAD commit: f1a27f081c1f usb: typec: qcom-pmic-typec: allow different ..
> git tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1429ed40180000
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
--- x/drivers/media/usb/pvrusb2/pvrusb2-context.c
+++ y/drivers/media/usb/pvrusb2/pvrusb2-context.c
@@ -267,9 +267,9 @@ static void pvr2_context_exit(struct pvr
void pvr2_context_disconnect(struct pvr2_context *mp)
{
pvr2_hdw_disconnect(mp->hdw);
- mp->disconnect_flag = !0;
if (!pvr2_context_shutok())
pvr2_context_notify(mp);
+ pvr2_context_destroy(mp);
}
--
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2)
2024-02-16 0:42 ` Hillf Danton
@ 2024-02-16 4:58 ` syzbot
0 siblings, 0 replies; 16+ messages in thread
From: syzbot @ 2024-02-16 4:58 UTC (permalink / raw)
To: hdanton, linux-kernel, syzkaller-bugs
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: slab-use-after-free Read in pvr2_context_set_notify
pvrusb2: You might need to power cycle the pvrusb2 device in order to recover.
==================================================================
BUG: KASAN: slab-use-after-free in pvr2_context_set_notify+0x2ba/0x310 drivers/media/usb/pvrusb2/pvrusb2-context.c:48
Read of size 4 at addr ffff88810fb02ed8 by task pvrusb2-context/902
CPU: 0 PID: 902 Comm: pvrusb2-context Not tainted 6.8.0-rc4-syzkaller-00180-g4f5e5092fdbf-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:488
kasan_report+0xda/0x110 mm/kasan/report.c:601
pvr2_context_set_notify+0x2ba/0x310 drivers/media/usb/pvrusb2/pvrusb2-context.c:48
pvr2_context_thread_func+0x10d/0x960 drivers/media/usb/pvrusb2/pvrusb2-context.c:157
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
</TASK>
Allocated by task 724:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:372 [inline]
__kasan_kmalloc+0x87/0x90 mm/kasan/common.c:389
kmalloc include/linux/slab.h:590 [inline]
kzalloc include/linux/slab.h:711 [inline]
pvr2_context_create+0x53/0x2a0 drivers/media/usb/pvrusb2/pvrusb2-context.c:207
pvr_probe+0x25/0xe0 drivers/media/usb/pvrusb2/pvrusb2-main.c:54
usb_probe_interface+0x307/0x930 drivers/usb/core/driver.c:399
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x234/0xc90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x117e/0x1aa0 drivers/base/core.c:3625
usb_set_configuration+0x10cb/0x1c40 drivers/usb/core/message.c:2207
usb_generic_driver_probe+0xad/0x110 drivers/usb/core/generic.c:254
usb_probe_device+0xec/0x350 drivers/usb/core/driver.c:294
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x234/0xc90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x117e/0x1aa0 drivers/base/core.c:3625
usb_new_device+0xd90/0x1a10 drivers/usb/core/hub.c:2614
hub_port_connect drivers/usb/core/hub.c:5483 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5623 [inline]
port_event drivers/usb/core/hub.c:5783 [inline]
hub_event+0x2e62/0x4f40 drivers/usb/core/hub.c:5865
process_one_work+0x886/0x15d0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
Freed by task 724:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
kasan_save_free_info+0x3f/0x60 mm/kasan/generic.c:640
poison_slab_object mm/kasan/common.c:241 [inline]
__kasan_slab_free+0x106/0x1b0 mm/kasan/common.c:257
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2121 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x105/0x340 mm/slub.c:4409
pvr_disconnect+0x80/0xf0 drivers/media/usb/pvrusb2/pvrusb2-main.c:79
usb_unbind_interface+0x1dd/0x8d0 drivers/usb/core/driver.c:461
device_remove drivers/base/dd.c:569 [inline]
device_remove+0x11f/0x170 drivers/base/dd.c:561
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
bus_remove_device+0x22c/0x420 drivers/base/bus.c:574
device_del+0x39a/0xa50 drivers/base/core.c:3814
usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1416
usb_disconnect+0x2e1/0x910 drivers/usb/core/hub.c:2267
hub_port_connect drivers/usb/core/hub.c:5323 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5623 [inline]
port_event drivers/usb/core/hub.c:5783 [inline]
hub_event+0x1be0/0x4f40 drivers/usb/core/hub.c:5865
process_one_work+0x886/0x15d0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
The buggy address belongs to the object at ffff88810fb02e00
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 216 bytes inside of
freed 256-byte region [ffff88810fb02e00, ffff88810fb02f00)
The buggy address belongs to the physical page:
page:ffffea00043ec080 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10fb02
head:ffffea00043ec080 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x200000000000840(slab|head|node=0|zone=2)
page_type: 0xffffffff()
raw: 0200000000000840 ffff888100041b40 ffffea00041ef600 0000000000000002
raw: 0000000000000000 0000000080100010 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5358, tgid 5358 (kworker/1:4), ts 131458586273, free_ts 131438325014
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1533
prep_new_page mm/page_alloc.c:1540 [inline]
get_page_from_freelist+0x139c/0x3470 mm/page_alloc.c:3311
__alloc_pages+0x228/0x2250 mm/page_alloc.c:4567
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page mm/slub.c:2190 [inline]
allocate_slab mm/slub.c:2354 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2407
___slab_alloc+0x4b0/0x1860 mm/slub.c:3540
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3625
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
kmalloc_trace+0x2ce/0x300 mm/slub.c:4007
kmalloc include/linux/slab.h:590 [inline]
kzalloc include/linux/slab.h:711 [inline]
pvr2_context_create+0x53/0x2a0 drivers/media/usb/pvrusb2/pvrusb2-context.c:207
pvr_probe+0x25/0xe0 drivers/media/usb/pvrusb2/pvrusb2-main.c:54
usb_probe_interface+0x307/0x930 drivers/usb/core/driver.c:399
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x234/0xc90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
page last free pid 5341 tgid 5341 stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1140 [inline]
free_unref_page_prepare+0x504/0xae0 mm/page_alloc.c:2346
free_unref_page+0x33/0x2d0 mm/page_alloc.c:2486
qlink_free mm/kasan/quarantine.c:160 [inline]
qlist_free_all+0x58/0x150 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x4a/0x70 mm/kasan/common.c:324
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3813 [inline]
slab_alloc_node mm/slub.c:3860 [inline]
kmem_cache_alloc+0x131/0x2e0 mm/slub.c:3867
getname_flags.part.0+0x50/0x4e0 fs/namei.c:140
getname_flags+0x9c/0xf0 include/linux/audit.h:322
vfs_fstatat+0x9a/0x140 fs/stat.c:303
__do_sys_newfstatat+0x98/0x110 fs/stat.c:468
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xd3/0x250 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Memory state around the buggy address:
ffff88810fb02d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88810fb02e00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88810fb02e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88810fb02f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88810fb02f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
Tested on:
commit: 4f5e5092 Merge tag 'net-6.8-rc5' of git://git.kernel.o..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=17133c1c180000
kernel config: https://syzkaller.appspot.com/x/.config?x=4f5e432f25b85a97
dashboard link: https://syzkaller.appspot.com/bug?extid=ce750e124675d4599449
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=12c58494180000
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2)
2024-01-31 10:22 ` syzbot
2024-02-16 0:42 ` Hillf Danton
@ 2024-02-16 3:03 ` Edward Adam Davis
2024-02-16 5:09 ` syzbot
1 sibling, 1 reply; 16+ messages in thread
From: Edward Adam Davis @ 2024-02-16 3:03 UTC (permalink / raw)
To: syzbot+ce750e124675d4599449; +Cc: linux-kernel, syzkaller-bugs
please test uaf in pvr2_context_set_notify
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-context.c b/drivers/media/usb/pvrusb2/pvrusb2-context.c
index 1764674de98b..e93bca93ce4c 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-context.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-context.c
@@ -267,9 +267,9 @@ static void pvr2_context_exit(struct pvr2_context *mp)
void pvr2_context_disconnect(struct pvr2_context *mp)
{
pvr2_hdw_disconnect(mp->hdw);
- mp->disconnect_flag = !0;
if (!pvr2_context_shutok())
pvr2_context_notify(mp);
+ mp->disconnect_flag = !0;
}
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2)
@ 2024-01-30 17:04 syzbot
0 siblings, 0 replies; 16+ messages in thread
From: syzbot @ 2024-01-30 17:04 UTC (permalink / raw)
To: isely, linux-kernel, linux-media, linux-usb, mchehab, pvrusb2,
syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: f1a27f081c1f usb: typec: qcom-pmic-typec: allow different ..
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=159f19fde80000
kernel config: https://syzkaller.appspot.com/x/.config?x=70204d1d16341bf4
dashboard link: https://syzkaller.appspot.com/bug?extid=ce750e124675d4599449
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/5c37a861daee/disk-f1a27f08.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/09f1af46fd09/vmlinux-f1a27f08.xz
kernel image: https://storage.googleapis.com/syzbot-assets/82eb085e0be1/bzImage-f1a27f08.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ce750e124675d4599449@syzkaller.appspotmail.com
pvrusb2: Device being rendered inoperable
==================================================================
BUG: KASAN: slab-use-after-free in pvr2_context_set_notify+0x2c4/0x310 drivers/media/usb/pvrusb2/pvrusb2-context.c:35
Read of size 4 at addr ffff888111b8fed8 by task kworker/0:6/8544
CPU: 0 PID: 8544 Comm: kworker/0:6 Not tainted 6.8.0-rc1-syzkaller-00046-gf1a27f081c1f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Workqueue: usb_hub_wq hub_event
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:488
kasan_report+0xda/0x110 mm/kasan/report.c:601
pvr2_context_set_notify+0x2c4/0x310 drivers/media/usb/pvrusb2/pvrusb2-context.c:35
pvr2_context_notify drivers/media/usb/pvrusb2/pvrusb2-context.c:95 [inline]
pvr2_context_disconnect+0x94/0xb0 drivers/media/usb/pvrusb2/pvrusb2-context.c:272
pvr_disconnect+0x80/0xf0 drivers/media/usb/pvrusb2/pvrusb2-main.c:79
usb_unbind_interface+0x1e5/0x960 drivers/usb/core/driver.c:461
device_remove drivers/base/dd.c:569 [inline]
device_remove+0x11f/0x170 drivers/base/dd.c:561
__device_release_driver drivers/base/dd.c:1272 [inline]
device_release_driver_internal+0x44a/0x610 drivers/base/dd.c:1295
bus_remove_device+0x22c/0x420 drivers/base/bus.c:574
device_del+0x39a/0xa50 drivers/base/core.c:3814
usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1416
usb_disconnect+0x2e1/0x910 drivers/usb/core/hub.c:2286
hub_port_connect drivers/usb/core/hub.c:5334 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5634 [inline]
port_event drivers/usb/core/hub.c:5794 [inline]
hub_event+0x1be0/0x4f40 drivers/usb/core/hub.c:5876
process_one_work+0x884/0x15c0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787
kthread+0x33c/0x440 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
</TASK>
Allocated by task 8544:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:372 [inline]
__kasan_kmalloc+0x87/0x90 mm/kasan/common.c:389
kmalloc include/linux/slab.h:590 [inline]
kzalloc include/linux/slab.h:711 [inline]
pvr2_context_create+0x53/0x2a0 drivers/media/usb/pvrusb2/pvrusb2-context.c:207
pvr_probe+0x25/0xe0 drivers/media/usb/pvrusb2/pvrusb2-main.c:54
usb_probe_interface+0x307/0x9c0 drivers/usb/core/driver.c:399
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x234/0xc90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x117e/0x1aa0 drivers/base/core.c:3625
usb_set_configuration+0x10cb/0x1c40 drivers/usb/core/message.c:2207
usb_generic_driver_probe+0xad/0x110 drivers/usb/core/generic.c:254
usb_probe_device+0xec/0x3e0 drivers/usb/core/driver.c:294
call_driver_probe drivers/base/dd.c:579 [inline]
really_probe+0x234/0xc90 drivers/base/dd.c:658
__driver_probe_device+0x1de/0x4b0 drivers/base/dd.c:800
driver_probe_device+0x4c/0x1a0 drivers/base/dd.c:830
__device_attach_driver+0x1d4/0x300 drivers/base/dd.c:958
bus_for_each_drv+0x157/0x1d0 drivers/base/bus.c:457
__device_attach+0x1e8/0x4b0 drivers/base/dd.c:1030
bus_probe_device+0x17c/0x1c0 drivers/base/bus.c:532
device_add+0x117e/0x1aa0 drivers/base/core.c:3625
usb_new_device+0xd80/0x19f0 drivers/usb/core/hub.c:2625
hub_port_connect drivers/usb/core/hub.c:5494 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5634 [inline]
port_event drivers/usb/core/hub.c:5794 [inline]
hub_event+0x2e62/0x4f40 drivers/usb/core/hub.c:5876
process_one_work+0x884/0x15c0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787
kthread+0x33c/0x440 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
Freed by task 897:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
kasan_save_free_info+0x3f/0x60 mm/kasan/generic.c:640
poison_slab_object mm/kasan/common.c:241 [inline]
__kasan_slab_free+0x106/0x1b0 mm/kasan/common.c:257
kasan_slab_free include/linux/kasan.h:184 [inline]
slab_free_hook mm/slub.c:2121 [inline]
slab_free mm/slub.c:4299 [inline]
kfree+0x105/0x330 mm/slub.c:4409
pvr2_context_check drivers/media/usb/pvrusb2/pvrusb2-context.c:137 [inline]
pvr2_context_thread_func+0x69d/0x960 drivers/media/usb/pvrusb2/pvrusb2-context.c:158
kthread+0x33c/0x440 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
The buggy address belongs to the object at ffff888111b8fe00
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 216 bytes inside of
freed 256-byte region [ffff888111b8fe00, ffff888111b8ff00)
The buggy address belongs to the physical page:
page:ffffea000446e380 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x111b8e
head:ffffea000446e380 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0x200000000000840(slab|head|node=0|zone=2)
page_type: 0xffffffff()
raw: 0200000000000840 ffff888100041b40 ffffea0004698e80 dead000000000003
raw: 0000000000000000 0000000080100010 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 6208, tgid 6208 (dhcpcd-run-hook), ts 253184444708, free_ts 252376724208
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1533
prep_new_page mm/page_alloc.c:1540 [inline]
get_page_from_freelist+0x139a/0x3460 mm/page_alloc.c:3311
__alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4567
__alloc_pages_node include/linux/gfp.h:238 [inline]
alloc_pages_node include/linux/gfp.h:261 [inline]
alloc_slab_page mm/slub.c:2190 [inline]
allocate_slab+0xa3/0x360 mm/slub.c:2354
new_slab mm/slub.c:2407 [inline]
___slab_alloc+0x4d2/0x1950 mm/slub.c:3540
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3625
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
__do_kmalloc_node mm/slub.c:3980 [inline]
__kmalloc_node+0x177/0x4b0 mm/slub.c:3988
kmalloc_array_node include/linux/slab.h:688 [inline]
kcalloc_node include/linux/slab.h:693 [inline]
memcg_alloc_slab_cgroups+0xa9/0x170 mm/memcontrol.c:2988
account_slab mm/slub.c:2317 [inline]
allocate_slab+0x2b5/0x360 mm/slub.c:2372
new_slab mm/slub.c:2407 [inline]
___slab_alloc+0x4d2/0x1950 mm/slub.c:3540
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3625
__slab_alloc_node mm/slub.c:3678 [inline]
slab_alloc_node mm/slub.c:3850 [inline]
kmem_cache_alloc+0x326/0x370 mm/slub.c:3867
anon_vma_chain_alloc mm/rmap.c:142 [inline]
anon_vma_fork+0x1fc/0x610 mm/rmap.c:365
dup_mmap kernel/fork.c:712 [inline]
dup_mm kernel/fork.c:1685 [inline]
copy_mm kernel/fork.c:1734 [inline]
copy_process+0x9306/0x9920 kernel/fork.c:2496
kernel_clone+0xfc/0x850 kernel/fork.c:2901
__do_sys_clone+0xba/0x100 kernel/fork.c:3044
page last free pid 4799 tgid 4799 stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1140 [inline]
free_unref_page_prepare+0x503/0xae0 mm/page_alloc.c:2346
free_unref_page+0x33/0x2c0 mm/page_alloc.c:2486
__put_partials+0x149/0x160 mm/slub.c:2922
qlink_free mm/kasan/quarantine.c:160 [inline]
qlist_free_all+0x58/0x150 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x4a/0x70 mm/kasan/common.c:324
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook mm/slub.c:3813 [inline]
slab_alloc_node mm/slub.c:3860 [inline]
kmalloc_trace+0x13a/0x390 mm/slub.c:4007
kmalloc include/linux/slab.h:590 [inline]
usb_control_msg+0xbd/0x4a0 drivers/usb/core/message.c:144
get_bMaxPacketSize0+0xc3/0x280 drivers/usb/core/hub.c:4779
hub_port_init+0x6a8/0x3a50 drivers/usb/core/hub.c:4975
hub_port_connect drivers/usb/core/hub.c:5423 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5634 [inline]
port_event drivers/usb/core/hub.c:5794 [inline]
hub_event+0x2c20/0x4f40 drivers/usb/core/hub.c:5876
process_one_work+0x884/0x15c0 kernel/workqueue.c:2633
process_scheduled_works kernel/workqueue.c:2706 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787
kthread+0x33c/0x440 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
Memory state around the buggy address:
ffff888111b8fd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888111b8fe00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888111b8fe80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888111b8ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888111b8ff80: 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] 16+ messages in thread
end of thread, other threads:[~2024-04-14 13:21 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-14 4:26 [syzbot] [pvrusb2?] [usb?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (3) syzbot
2024-04-14 9:02 ` Hillf Danton
2024-04-14 9:30 ` syzbot
2024-04-14 9:37 ` [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2) Edward Adam Davis
2024-04-14 9:53 ` [syzbot] [pvrusb2?] [usb?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (3) syzbot
2024-04-14 11:09 ` Hillf Danton
2024-04-14 11:27 ` syzbot
2024-04-14 12:58 ` [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2) Edward Adam Davis
2024-04-14 13:21 ` [syzbot] [pvrusb2?] [usb?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (3) syzbot
[not found] <CZ5SKT22SUPI.1CKVD5QORTT2B@getstate.dev>
2024-02-15 16:37 ` [syzbot] [pvrusb2?] KASAN: slab-use-after-free Read in pvr2_context_set_notify (2) syzbot
[not found] <mailman.217.1706634262.2961.pvrusb2@isely.net>
2024-01-31 10:22 ` syzbot
2024-02-16 0:42 ` Hillf Danton
2024-02-16 4:58 ` syzbot
2024-02-16 3:03 ` Edward Adam Davis
2024-02-16 5:09 ` syzbot
-- strict thread matches above, loose matches on Subject: below --
2024-01-30 17:04 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.