UDC core: USB Raw Gadget: driver registration failed: -16 misc raw-gadget: fail, usb_gadget_register_driver returned -16 ================================================================== BUG: KASAN: invalid-access in driver_find drivers/base/driver.c:291 [inline] BUG: KASAN: invalid-access in driver_register+0x68/0x130 drivers/base/driver.c:233 Read at addr fbff0000290b3290 by task syz-executor.0/9061 Pointer tag: [fb], memory tag: [fe] CPU: 0 PID: 9061 Comm: syz-executor.0 Not tainted 5.19.0-rc3-syzkaller-00038-gca1fdab7fd27 #0 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace.part.0+0xcc/0xe0 arch/arm64/kernel/stacktrace.c:198 dump_backtrace arch/arm64/kernel/stacktrace.c:204 [inline] show_stack+0x18/0x6c arch/arm64/kernel/stacktrace.c:205 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x68/0x84 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:313 [inline] print_report+0xfc/0x5f0 mm/kasan/report.c:429 kasan_report+0x8c/0xb0 mm/kasan/report.c:491 __do_kernel_fault+0x100/0x1bc arch/arm64/mm/fault.c:319 do_bad_area arch/arm64/mm/fault.c:469 [inline] do_tag_check_fault+0x78/0x8c arch/arm64/mm/fault.c:738 do_mem_abort+0x48/0xa0 arch/arm64/mm/fault.c:814 el1_abort+0x40/0x60 arch/arm64/kernel/entry-common.c:366 el1h_64_sync_handler+0xb0/0xd0 arch/arm64/kernel/entry-common.c:417 el1h_64_sync+0x64/0x68 arch/arm64/kernel/entry.S:576 driver_find drivers/base/driver.c:291 [inline] driver_register+0x68/0x130 drivers/base/driver.c:233 usb_gadget_register_driver_owner+0x48/0x100 drivers/usb/gadget/udc/core.c:1558 raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:515 [inline] raw_ioctl+0x848/0xd60 drivers/usb/gadget/legacy/raw_gadget.c:1222 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0xa8/0xf0 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x48/0x114 arch/arm64/kernel/syscall.c:52 el0_svc_common.constprop.0+0x44/0xec arch/arm64/kernel/syscall.c:142 do_el0_svc+0xa0/0xc0 arch/arm64/kernel/syscall.c:206 el0_svc+0x44/0xb0 arch/arm64/kernel/entry-common.c:624 el0t_64_sync_handler+0x1ac/0x1b0 arch/arm64/kernel/entry-common.c:642 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:581 Allocated by task 9061: kasan_save_stack+0x2c/0x5c mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xb0/0xd0 mm/kasan/common.c:524 kasan_kmalloc include/linux/kasan.h:234 [inline] kmem_cache_alloc_trace include/linux/slab.h:498 [inline] kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] bus_add_driver+0x64/0x220 drivers/base/bus.c:602 driver_register+0x78/0x130 drivers/base/driver.c:240 usb_gadget_register_driver_owner+0x48/0x100 drivers/usb/gadget/udc/core.c:1558 raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:515 [inline] raw_ioctl+0x848/0xd60 drivers/usb/gadget/legacy/raw_gadget.c:1222 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0xa8/0xf0 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x48/0x114 arch/arm64/kernel/syscall.c:52 el0_svc_common.constprop.0+0x44/0xec arch/arm64/kernel/syscall.c:142 do_el0_svc+0xa0/0xc0 arch/arm64/kernel/syscall.c:206 el0_svc+0x44/0xb0 arch/arm64/kernel/entry-common.c:624 el0t_64_sync_handler+0x1ac/0x1b0 arch/arm64/kernel/entry-common.c:642 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:581 Freed by task 9061: kasan_save_stack+0x2c/0x5c mm/kasan/common.c:38 kasan_set_track+0x2c/0x40 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/tags.c:36 ____kasan_slab_free.constprop.0+0x1b8/0x214 mm/kasan/common.c:366 __kasan_slab_free+0x10/0x1c mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0xc4/0x230 mm/slub.c:1780 slab_free mm/slub.c:3536 [inline] kfree+0xa8/0x260 mm/slub.c:4584 driver_release+0x10/0x20 drivers/base/bus.c:91 kobject_cleanup lib/kobject.c:673 [inline] kobject_release lib/kobject.c:704 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x98/0x114 lib/kobject.c:721 driver_find drivers/base/driver.c:291 [inline] driver_register+0x68/0x130 drivers/base/driver.c:233 usb_gadget_register_driver_owner+0x48/0x100 drivers/usb/gadget/udc/core.c:1558 raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:515 [inline] raw_ioctl+0x848/0xd60 drivers/usb/gadget/legacy/raw_gadget.c:1222 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0xa8/0xf0 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x48/0x114 arch/arm64/kernel/syscall.c:52 el0_svc_common.constprop.0+0x44/0xec arch/arm64/kernel/syscall.c:142 do_el0_svc+0xa0/0xc0 arch/arm64/kernel/syscall.c:206 el0_svc+0x44/0xb0 arch/arm64/kernel/entry-common.c:624 el0t_64_sync_handler+0x1ac/0x1b0 arch/arm64/kernel/entry-common.c:642 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:581 The buggy address belongs to the object at ffff0000290b3200 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 144 bytes inside of 256-byte region [ffff0000290b3200, ffff0000290b3300) The buggy address belongs to the physical page: page:00000000afb49d1f refcount:1 mapcount:0 mapping:0000000000000000 index:0xfbff0000290b3200 pfn:0x690b2 head:00000000afb49d1f order:1 compound_mapcount:0 compound_pincount:0 flags: 0x1ffc00000010200(slab|head|node=0|zone=0|lastcpupid=0x7ff|kasantag=0x0) raw: 01ffc00000010200 fffffc0000972300 dead000000000006 fcff000002c01300 raw: fbff0000290b3200 000000008010000f 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000290b3000: fd fd fd fd fd fd fd fd fd fd fe fe fe fe fe fe ffff0000290b3100: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe >ffff0000290b3200: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ^ ffff0000290b3300: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ffff0000290b3400: f1 f1 f1 f1 f1 f1 f1 f1 f1 f1 fe fe fe fe fe fe ================================================================== Error: Driver 'raw-gadget' is already registered, aborting... UDC core: USB Raw Gadget: driver registration failed: -16 misc raw-gadget: fail, usb_gadget_register_driver returned -16