syzbot


linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup

Status: fixed on 2023/12/21 03:45
Subsystems: usb
[Documentation on labels]
Reported-by: syzbot+6867a9777f4b8dc4e256@syzkaller.appspotmail.com
Fix commit: 17d6b82d2d6d usb/usbip: fix wrong data added to platform device
First crash: 201d, last: 193d
Duplicate bugs (1)
duplicates (1):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
usb-testing boot error: KASAN: slab-out-of-bounds Write in vhci_setup usb 24 193d 198d 26/26 closed as dup on 2023/10/13 11:08
Discussions (4)
Title Replies (including bot) Last reply
[syzbot] [kernel?] possible deadlock in console_flush_all (2) 13 (16) 2024/03/27 14:25
[syzbot] [usb?] linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup 5 (8) 2023/10/31 05:39
[PATCH v2 -next] usb/usbip: fix wrong data added to platform device 2 (2) 2023/10/16 17:42
[PATCH -next] usb/usbip: fix wrong data added to platform device 2 (2) 2023/10/13 12:05
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/10/13 11:16 12m i@zenithal.me https://github.com/ZenithalHourlyRate/linux.git usbip-fix-wrong-platform-data OK
2023/10/13 11:10 0m i@zenithal.me git@github.com:ZenithalHourlyRate/linux.git usbip-fix-wrong-platform-data error OK

Sample crash report:
usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb4: Product: Dummy host controller
usb usb4: Manufacturer: Linux 6.6.0-rc6-next-20231017-syzkaller dummy_hcd
usb usb4: SerialNumber: dummy_hcd.3
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 1 port detected
dummy_hcd dummy_hcd.4: USB Host+Gadget Emulator, driver 02 May 2005
dummy_hcd dummy_hcd.4: Dummy host controller
dummy_hcd dummy_hcd.4: new USB bus registered, assigned bus number 5
usb usb5: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb5: Product: Dummy host controller
usb usb5: Manufacturer: Linux 6.6.0-rc6-next-20231017-syzkaller dummy_hcd
usb usb5: SerialNumber: dummy_hcd.4
hub 5-0:1.0: USB hub found
hub 5-0:1.0: 1 port detected
dummy_hcd dummy_hcd.5: USB Host+Gadget Emulator, driver 02 May 2005
dummy_hcd dummy_hcd.5: Dummy host controller
dummy_hcd dummy_hcd.5: new USB bus registered, assigned bus number 6
usb usb6: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb6: Product: Dummy host controller
usb usb6: Manufacturer: Linux 6.6.0-rc6-next-20231017-syzkaller dummy_hcd
usb usb6: SerialNumber: dummy_hcd.5
hub 6-0:1.0: USB hub found
hub 6-0:1.0: 1 port detected
dummy_hcd dummy_hcd.6: USB Host+Gadget Emulator, driver 02 May 2005
dummy_hcd dummy_hcd.6: Dummy host controller
dummy_hcd dummy_hcd.6: new USB bus registered, assigned bus number 7
usb usb7: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
usb usb7: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb7: Product: Dummy host controller
usb usb7: Manufacturer: Linux 6.6.0-rc6-next-20231017-syzkaller dummy_hcd
usb usb7: SerialNumber: dummy_hcd.6
hub 7-0:1.0: USB hub found
hub 7-0:1.0: 1 port detected
dummy_hcd dummy_hcd.7: USB Host+Gadget Emulator, driver 02 May 2005
dummy_hcd dummy_hcd.7: Dummy host controller
dummy_hcd dummy_hcd.7: new USB bus registered, assigned bus number 8
usb usb8: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
usb usb8: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb8: Product: Dummy host controller
usb usb8: Manufacturer: Linux 6.6.0-rc6-next-20231017-syzkaller dummy_hcd
usb usb8: SerialNumber: dummy_hcd.7
hub 8-0:1.0: USB hub found
hub 8-0:1.0: 1 port detected
gadgetfs: USB Gadget filesystem, version 24 Aug 2004
vhci_hcd vhci_hcd.0: USB/IP Virtual Host Controller
vhci_hcd vhci_hcd.0: new USB bus registered, assigned bus number 9
==================================================================
BUG: KASAN: slab-out-of-bounds in vhci_setup+0x2d3/0x340 drivers/usb/usbip/vhci_hcd.c:1145
Write of size 8 at addr ffff88801fd99b88 by task swapper/0/1

CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.6.0-rc6-next-20231017-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
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:364 [inline]
 print_report+0xc4/0x620 mm/kasan/report.c:475
 kasan_report+0xda/0x110 mm/kasan/report.c:588
 vhci_setup+0x2d3/0x340 drivers/usb/usbip/vhci_hcd.c:1145
 usb_add_hcd+0x5bc/0x1770 drivers/usb/core/hcd.c:2911
 vhci_hcd_probe+0x12c/0x460 drivers/usb/usbip/vhci_hcd.c:1363
 platform_probe+0xff/0x1e0 drivers/base/platform.c:1404
 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
 platform_device_add+0x316/0x810 drivers/base/platform.c:716
 platform_device_register_full+0x3ec/0x550 drivers/base/platform.c:844
 vhci_hcd_init+0x1ad/0x360 drivers/usb/usbip/vhci_hcd.c:1532
 do_one_initcall+0x128/0x670 init/main.c:1232
 do_initcall_level init/main.c:1294 [inline]
 do_initcalls init/main.c:1310 [inline]
 do_basic_setup init/main.c:1329 [inline]
 kernel_init_freeable+0x5c2/0x900 init/main.c:1547
 kernel_init+0x1c/0x2a0 init/main.c:1437
 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 1:
 kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
 kasan_set_track+0x25/0x30 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:198 [inline]
 __do_kmalloc_node mm/slab_common.c:1007 [inline]
 __kmalloc_node_track_caller+0x65/0x130 mm/slab_common.c:1027
 kvasprintf+0xbd/0x150 lib/kasprintf.c:25
 kvasprintf_const+0x66/0x190 lib/kasprintf.c:49
 kobject_set_name_vargs+0x5a/0x130 lib/kobject.c:272
 device_create_groups_vargs+0x1b1/0x270 drivers/base/core.c:4308
 device_create+0xe9/0x120 drivers/base/core.c:4351
 mon_bin_add+0xba/0x160 drivers/usb/mon/mon_bin.c:1366
 mon_bus_init+0x18e/0x320 drivers/usb/mon/mon_main.c:291
 mon_bus_add drivers/usb/mon/mon_main.c:188 [inline]
 mon_notify+0x32e/0x490 drivers/usb/mon/mon_main.c:219
 notifier_call_chain+0xb6/0x3c0 kernel/notifier.c:93
 blocking_notifier_call_chain kernel/notifier.c:388 [inline]
 blocking_notifier_call_chain+0x69/0x90 kernel/notifier.c:376
 usb_register_bus drivers/usb/core/hcd.c:910 [inline]
 usb_add_hcd+0x34d/0x1770 drivers/usb/core/hcd.c:2852
 vhci_hcd_probe+0x12c/0x460 drivers/usb/usbip/vhci_hcd.c:1363
 platform_probe+0xff/0x1e0 drivers/base/platform.c:1404
 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
 platform_device_add+0x316/0x810 drivers/base/platform.c:716
 platform_device_register_full+0x3ec/0x550 drivers/base/platform.c:844
 vhci_hcd_init+0x1ad/0x360 drivers/usb/usbip/vhci_hcd.c:1532
 do_one_initcall+0x128/0x670 init/main.c:1232
 do_initcall_level init/main.c:1294 [inline]
 do_initcalls init/main.c:1310 [inline]
 do_basic_setup init/main.c:1329 [inline]
 kernel_init_freeable+0x5c2/0x900 init/main.c:1547
 kernel_init+0x1c/0x2a0 init/main.c:1437
 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 ffff88801fd99b68
 which belongs to the cache kmalloc-8 of size 8
The buggy address is located 24 bytes to the right of
 allocated 8-byte region [ffff88801fd99b68, ffff88801fd99b70)

The buggy address belongs to the physical page:
page:ffffea00007f6640 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1fd99
flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000800 ffff888012c41280 dead000000000122 0000000000000000
raw: 0000000000000000 0000000080660066 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 11779306913, free_ts 11665798559
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1540
 prep_new_page mm/page_alloc.c:1547 [inline]
 get_page_from_freelist+0x98f/0x32a0 mm/page_alloc.c:3339
 __alloc_pages+0x1d0/0x4c0 mm/page_alloc.c:4595
 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133
 alloc_slab_page mm/slub.c:1870 [inline]
 allocate_slab+0x251/0x380 mm/slub.c:2017
 new_slab mm/slub.c:2070 [inline]
 ___slab_alloc+0x8c7/0x1580 mm/slub.c:3223
 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322
 __slab_alloc_node mm/slub.c:3375 [inline]
 slab_alloc_node mm/slub.c:3468 [inline]
 __kmem_cache_alloc_node+0x131/0x310 mm/slub.c:3517
 kmalloc_trace+0x27/0xf0 mm/slab_common.c:1098
 kmalloc include/linux/slab.h:600 [inline]
 hub_configure drivers/usb/core/hub.c:1423 [inline]
 hub_probe+0xaef/0x3070 drivers/usb/core/hub.c:1930
 usb_probe_interface+0x307/0x930 drivers/usb/core/driver.c:396
 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
page last free 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+0x476/0xa40 mm/page_alloc.c:2389
 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2524
 vfree mm/vmalloc.c:2842 [inline]
 vfree+0x3fb/0xe40 mm/vmalloc.c:2807
 delayed_vfree_work+0x56/0x70 mm/vmalloc.c:2763
 process_one_work+0x8a2/0x15e0 kernel/workqueue.c:2630
 process_scheduled_works kernel/workqueue.c:2703 [inline]
 worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784
 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:
 ffff88801fd99a80: fc fc fc fc fa fc fc fc fc 00 fc fc fc fc 00 fc
 ffff88801fd99b00: fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc
>ffff88801fd99b80: fc fc 00 fc fc fc fc 00 fc fc fc fc 06 fc fc fc
                      ^
 ffff88801fd99c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88801fd99c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (34):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/10/17 05:13 linux-next 4d5ab2376ec5 342b9c55 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/17 05:13 linux-next 4d5ab2376ec5 342b9c55 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/17 05:13 linux-next 4d5ab2376ec5 342b9c55 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/16 05:52 linux-next 4d0515b235de 6388bc36 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/16 05:52 linux-next 4d0515b235de 6388bc36 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/16 05:52 linux-next 4d0515b235de 6388bc36 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/13 07:12 linux-next e3b18f7200f4 6388bc36 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/13 07:12 linux-next e3b18f7200f4 6388bc36 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/13 07:12 linux-next e3b18f7200f4 6388bc36 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/13 04:16 linux-next f9a6bea13184 6388bc36 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/13 04:16 linux-next f9a6bea13184 6388bc36 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/13 04:15 linux-next f9a6bea13184 6388bc36 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/12 15:46 linux-next f9a6bea13184 fc170927 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/12 15:46 linux-next f9a6bea13184 fc170927 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/12 15:46 linux-next f9a6bea13184 fc170927 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/12 06:30 linux-next f9a6bea13184 83165b57 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/12 06:30 linux-next f9a6bea13184 83165b57 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/12 06:30 linux-next f9a6bea13184 83165b57 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/11 07:33 linux-next 2933a1156742 83165b57 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/11 07:33 linux-next 2933a1156742 83165b57 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/11 07:33 linux-next 2933a1156742 83165b57 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/10 16:24 linux-next c0a6edb636cb 83165b57 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/10 16:23 linux-next c0a6edb636cb 83165b57 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/10 16:23 linux-next c0a6edb636cb 83165b57 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/10 06:20 linux-next c0a6edb636cb c9be5398 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/10 03:05 linux-next 2a860505b617 c9be5398 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/10 03:05 linux-next 2a860505b617 c9be5398 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/10 03:05 linux-next 2a860505b617 c9be5398 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/09 13:38 linux-next 2a860505b617 3c53c7d9 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/09 13:38 linux-next 2a860505b617 3c53c7d9 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/09 13:37 linux-next 2a860505b617 3c53c7d9 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/09 06:14 linux-next 2a860505b617 5e837c76 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/09 06:14 linux-next 2a860505b617 5e837c76 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
2023/10/09 06:14 linux-next 2a860505b617 5e837c76 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root linux-next boot error: KASAN: slab-out-of-bounds Write in vhci_setup
* Struck through repros no longer work on HEAD.