bisecting cause commit starting from 6799d4f2da496cab9b3fd26283a8ce3639b1a88d building syzkaller on 325a8dab43fe8af46c179dcb4e2426613440fe85 testing commit 6799d4f2da496cab9b3fd26283a8ce3639b1a88d with gcc (GCC) 10.2.1 20210217 kernel signature: 166cbc8c9e879c8538cdf128c7ca196467f77e0ed2c675d62dad6143923f9bbf all runs: crashed: WARNING: ODEBUG bug in smsusb_term_device testing release v5.12 testing commit 9f4ad9e425a1d3b6a34617b8ea226d56a119a717 with gcc (GCC) 10.2.1 20210217 kernel signature: d440b4cda7d2ab4e7a9fb717e84bf516b6131e0226170a2accac2a704eba3a26 all runs: crashed: WARNING: ODEBUG bug in smsusb_term_device testing release v5.11 testing commit f40ddce88593482919761f74910f42f4b84c004b with gcc (GCC) 10.2.1 20210217 kernel signature: 765cd1540c326c0950c950fbd0fec8db62a5661f5639cb7fd27d9b0db4d90c60 all runs: crashed: WARNING: ODEBUG bug in smsusb_term_device testing release v5.10 testing commit 2c85ebc57b3e1817b6ce1a6b703928e113a90442 with gcc (GCC) 10.2.1 20210217 kernel signature: df7feb4d91f8944dbc6f04c6ce0d62cee0e23c247a3d664c8d09e4380a1d4db4 all runs: crashed: WARNING: ODEBUG bug in smsusb_term_device testing release v5.9 testing commit bbf5c979011a099af5dc76498918ed7df445635b with gcc (GCC) 10.2.1 20210217 kernel signature: 729377365c17b92d66ed1bdf532053d69e13d473b5ea80ef6b5eacb7eb88528b run #0: crashed: WARNING: ODEBUG bug in smsusb_term_device run #1: crashed: WARNING: ODEBUG bug in smsusb_term_device run #2: crashed: WARNING: ODEBUG bug in smsusb_term_device run #3: crashed: WARNING: ODEBUG bug in smsusb_term_device run #4: crashed: WARNING: ODEBUG bug in smsusb_term_device run #5: crashed: WARNING: ODEBUG bug in corrupted run #6: crashed: WARNING: ODEBUG bug in smsusb_term_device run #7: crashed: WARNING: ODEBUG bug in smsusb_term_device run #8: crashed: WARNING: ODEBUG bug in smsusb_term_device run #9: crashed: WARNING: ODEBUG bug in smsusb_term_device testing release v5.8 testing commit bcf876870b95592b52519ed4aafcf9d95999bc9c with gcc (GCC) 8.4.1 20210217 kernel signature: fe4cf10963fe22623041f7dd2621a870da3a6c1c0337ee4720a2074a1ed96570 run #0: crashed: WARNING: ODEBUG bug in smsusb_term_device run #1: crashed: WARNING: ODEBUG bug in smsusb_term_device run #2: crashed: WARNING: ODEBUG bug in smsusb_term_device run #3: crashed: WARNING: ODEBUG bug in smsusb_term_device run #4: crashed: WARNING: ODEBUG bug in smsusb_term_device run #5: crashed: WARNING: ODEBUG bug in smsusb_term_device run #6: crashed: WARNING: ODEBUG bug in smsusb_term_device run #7: crashed: WARNING: ODEBUG bug in smsusb_term_device run #8: crashed: WARNING: ODEBUG bug in smsusb_term_device run #9: crashed: WARNING: ODEBUG bug in corrupted testing release v5.7 testing commit 3d77e6a8804abcc0504c904bd6e5cdf3a5cf8162 with gcc (GCC) 8.4.1 20210217 kernel signature: 2c6056a2dfdd16b432db0590dcf44d9466ab6d94a2975fdc54052aff1a1c3cf4 all runs: crashed: WARNING: ODEBUG bug in smsusb_term_device testing release v5.6 testing commit 7111951b8d4973bda27ff663f2cf18b663d15b48 with gcc (GCC) 8.4.1 20210217 kernel signature: 3e55c7c138041a575a7239b7dc3aeb1b6aecc1db234951c50f555812908a4b2a all runs: OK # git bisect start 3d77e6a8804abcc0504c904bd6e5cdf3a5cf8162 7111951b8d4973bda27ff663f2cf18b663d15b48 Bisecting: 7542 revisions left to test after this (roughly 13 steps) [50a5de895dbe5df947b3a695777db5b2c313e065] Merge tag 'for-linus-hmm' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma testing commit 50a5de895dbe5df947b3a695777db5b2c313e065 with gcc (GCC) 8.4.1 20210217 kernel signature: d5f4d81b23e95f18faadcc720741b77c66489cbf2e05f8b28565d2c7c51e5314 all runs: crashed: WARNING: ODEBUG bug in smsusb_term_device # git bisect bad 50a5de895dbe5df947b3a695777db5b2c313e065 Bisecting: 4204 revisions left to test after this (roughly 12 steps) [56a451b780676bc1cdac011735fe2869fa2e9abf] Merge tag 'ntb-5.7' of git://github.com/jonmason/ntb testing commit 56a451b780676bc1cdac011735fe2869fa2e9abf with gcc (GCC) 8.4.1 20210217 kernel signature: ffc7280f4a3b228a71843faed3b4a8aa6b49e90b816029334bd8c797a4900326 all runs: crashed: WARNING: ODEBUG bug in smsusb_term_device # git bisect bad 56a451b780676bc1cdac011735fe2869fa2e9abf Bisecting: 1643 revisions left to test after this (roughly 11 steps) [49835c15a55225e9b3ff9cc9317135b334ea2d49] Merge tag 'pm-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm testing commit 49835c15a55225e9b3ff9cc9317135b334ea2d49 with gcc (GCC) 8.4.1 20210217 kernel signature: 41978dd5cf4c767d835e0096ff02ffd103ca1c2ba755b57377469bc7633a4cba all runs: crashed: WARNING: ODEBUG bug in smsusb_term_device # git bisect bad 49835c15a55225e9b3ff9cc9317135b334ea2d49 Bisecting: 934 revisions left to test after this (roughly 10 steps) [063d1942247668eb0bb800aef5afbbef337344be] Merge tag 'media/v5.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media testing commit 063d1942247668eb0bb800aef5afbbef337344be with gcc (GCC) 8.4.1 20210217 kernel signature: 8842be13eb075fe52153fa6d4225ac715e0368d5f881b8296dbff0e4addb8615 all runs: OK # git bisect good 063d1942247668eb0bb800aef5afbbef337344be Bisecting: 516 revisions left to test after this (roughly 9 steps) [e681bb287f40e7a9dbcb04cef80fd87a2511ab86] staging: vt6656: Use DIV_ROUND_UP macro instead of specific code testing commit e681bb287f40e7a9dbcb04cef80fd87a2511ab86 with gcc (GCC) 8.4.1 20210217 kernel signature: 90af3d910531ae36759570bae4e6d753dd13d94af578637a48f7d19fc3ed0763 all runs: OK # git bisect good e681bb287f40e7a9dbcb04cef80fd87a2511ab86 Bisecting: 266 revisions left to test after this (roughly 8 steps) [db34c5ffee649e2c4c870d1031a996398a187cf5] Merge tag 'usb-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb testing commit db34c5ffee649e2c4c870d1031a996398a187cf5 with gcc (GCC) 8.4.1 20210217 kernel signature: bd792a50b39787300292b272dd53b9bb7cda0abb488087a5e202b39cf4fe16cd all runs: crashed: WARNING: ODEBUG bug in smsusb_term_device # git bisect bad db34c5ffee649e2c4c870d1031a996398a187cf5 Bisecting: 121 revisions left to test after this (roughly 7 steps) [a8ab3e76297ea85d92f4ee0833bd469816a13ccf] Merge tag 'usb-for-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next testing commit a8ab3e76297ea85d92f4ee0833bd469816a13ccf with gcc (GCC) 8.4.1 20210217 kernel signature: 6bfc6704aa5ef96c66331c73890cfeb9c96160ddf15e5b5b22b29a6a2ad20f71 all runs: crashed: WARNING: ODEBUG bug in smsusb_term_device # git bisect bad a8ab3e76297ea85d92f4ee0833bd469816a13ccf Bisecting: 63 revisions left to test after this (roughly 6 steps) [d1c6a769cdf466053ae211789f2b0671c8a72331] usb: typec: mux: Allow the mux handles to be requested with fwnode testing commit d1c6a769cdf466053ae211789f2b0671c8a72331 with gcc (GCC) 8.4.1 20210217 kernel signature: d774fd58598d66d625069c71623dbeccd9b4c9535b2cbc6adf0726771c7bfbec all runs: OK # git bisect good d1c6a769cdf466053ae211789f2b0671c8a72331 Bisecting: 31 revisions left to test after this (roughly 5 steps) [eeead847487f726fa177d0f4060c4f0816ad9cd9] usb: gadget: amd5536udc: fix spelling mistake "reserverd" -> "reserved" testing commit eeead847487f726fa177d0f4060c4f0816ad9cd9 with gcc (GCC) 8.4.1 20210217 kernel signature: 58bbaaca7abf76c642414e779af97819c304f91a61386f384840d0d6451d897e all runs: crashed: WARNING: ODEBUG bug in smsusb_term_device # git bisect bad eeead847487f726fa177d0f4060c4f0816ad9cd9 Bisecting: 15 revisions left to test after this (roughly 4 steps) [3d157c28d2289edf0439e8308e8de3a06acaaf0e] doc: dt: bindings: usb: dwc3: Update entries for disabling SS instances in park mode testing commit 3d157c28d2289edf0439e8308e8de3a06acaaf0e with gcc (GCC) 8.4.1 20210217 kernel signature: 1d62b86df0e93a136a36493170c35899654afa0a4f635f6d9c559933d5c49120 all runs: OK # git bisect good 3d157c28d2289edf0439e8308e8de3a06acaaf0e Bisecting: 7 revisions left to test after this (roughly 3 steps) [0227cc84c44417a29c8102e41db8ec2c11ebc6b2] usb: dwc3: core: don't do suspend for device mode if already suspended testing commit 0227cc84c44417a29c8102e41db8ec2c11ebc6b2 with gcc (GCC) 8.4.1 20210217 kernel signature: e69142b9cda635a2873d5f48e1e8aad2274f0dfa1e42f4b39a38df5b7301c780 all runs: OK # git bisect good 0227cc84c44417a29c8102e41db8ec2c11ebc6b2 Bisecting: 3 revisions left to test after this (roughly 2 steps) [95b18f28979e12539cc02f6ec4e2c776e8551f39] dt-bindings: usb: dwc2: add compatible property for rk3328 usb testing commit 95b18f28979e12539cc02f6ec4e2c776e8551f39 with gcc (GCC) 8.4.1 20210217 kernel signature: 50a371809a5019b3804b6bf3b90802be70a1ac20b93ab74b98695528049b0c5b all runs: crashed: WARNING: ODEBUG bug in smsusb_term_device # git bisect bad 95b18f28979e12539cc02f6ec4e2c776e8551f39 Bisecting: 1 revision left to test after this (roughly 1 step) [1a0808cb9e417170ed6ab97254cf319dc3e3c310] usb: dwc2: Implement set_selfpowered() testing commit 1a0808cb9e417170ed6ab97254cf319dc3e3c310 with gcc (GCC) 8.4.1 20210217 kernel signature: e69142b9cda635a2873d5f48e1e8aad2274f0dfa1e42f4b39a38df5b7301c780 all runs: OK # git bisect good 1a0808cb9e417170ed6ab97254cf319dc3e3c310 Bisecting: 0 revisions left to test after this (roughly 0 steps) [f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10] usb: gadget: add raw-gadget interface testing commit f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10 with gcc (GCC) 8.4.1 20210217 kernel signature: 50a371809a5019b3804b6bf3b90802be70a1ac20b93ab74b98695528049b0c5b all runs: crashed: WARNING: ODEBUG bug in smsusb_term_device # git bisect bad f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10 f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10 is the first bad commit commit f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10 Author: Andrey Konovalov Date: Mon Feb 24 17:13:03 2020 +0100 usb: gadget: add raw-gadget interface USB Raw Gadget is a kernel module that provides a userspace interface for the USB Gadget subsystem. Essentially it allows to emulate USB devices from userspace. Enabled with CONFIG_USB_RAW_GADGET. Raw Gadget is currently a strictly debugging feature and shouldn't be used in production. Raw Gadget is similar to GadgetFS, but provides a more low-level and direct access to the USB Gadget layer for the userspace. The key differences are: 1. Every USB request is passed to the userspace to get a response, while GadgetFS responds to some USB requests internally based on the provided descriptors. However note, that the UDC driver might respond to some requests on its own and never forward them to the Gadget layer. 2. GadgetFS performs some sanity checks on the provided USB descriptors, while Raw Gadget allows you to provide arbitrary data as responses to USB requests. 3. Raw Gadget provides a way to select a UDC device/driver to bind to, while GadgetFS currently binds to the first available UDC. 4. Raw Gadget uses predictable endpoint names (handles) across different UDCs (as long as UDCs have enough endpoints of each required transfer type). 5. Raw Gadget has ioctl-based interface instead of a filesystem-based one. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Andrey Konovalov Signed-off-by: Felipe Balbi Documentation/usb/index.rst | 1 + Documentation/usb/raw-gadget.rst | 61 ++ drivers/usb/gadget/legacy/Kconfig | 11 + drivers/usb/gadget/legacy/Makefile | 1 + drivers/usb/gadget/legacy/raw_gadget.c | 1078 ++++++++++++++++++++++++++++++++ include/uapi/linux/usb/raw_gadget.h | 167 +++++ 6 files changed, 1319 insertions(+) create mode 100644 Documentation/usb/raw-gadget.rst create mode 100644 drivers/usb/gadget/legacy/raw_gadget.c create mode 100644 include/uapi/linux/usb/raw_gadget.h culprit signature: 50a371809a5019b3804b6bf3b90802be70a1ac20b93ab74b98695528049b0c5b parent signature: e69142b9cda635a2873d5f48e1e8aad2274f0dfa1e42f4b39a38df5b7301c780 revisions tested: 22, total time: 4h33m35.904356689s (build: 2h40m42.161865809s, test: 1h49m54.475841152s) first bad commit: f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10 usb: gadget: add raw-gadget interface recipients (to): ["andreyknvl@google.com" "balbi@kernel.org" "gregkh@linuxfoundation.org"] recipients (cc): [] crash: WARNING: ODEBUG bug in smsusb_term_device smsusb:smsusb_init_device: smscore_start_device(...) failed ------------[ cut here ]------------ ODEBUG: free active (active state 0) object type: work_struct hint: do_submit_urb+0x0/0x50 drivers/media/usb/siano/smsusb.c:155 WARNING: CPU: 1 PID: 3523 at lib/debugobjects.c:488 debug_print_object+0x197/0x2b0 lib/debugobjects.c:485 Kernel panic - not syncing: panic_on_warn set ... CPU: 1 PID: 3523 Comm: kworker/1:7 Not tainted 5.6.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x96/0xe0 lib/dump_stack.c:118 panic+0x2a1/0x52a kernel/panic.c:221 __warn.cold.10+0x25/0x2f kernel/panic.c:582 report_bug+0x1aa/0x260 lib/bug.c:195 fixup_bug arch/x86/kernel/traps.c:174 [inline] fixup_bug arch/x86/kernel/traps.c:169 [inline] do_error_trap+0x12d/0x1e0 arch/x86/kernel/traps.c:267 do_invalid_op+0x31/0x40 arch/x86/kernel/traps.c:286 invalid_op+0x2d/0x40 arch/x86/entry/entry_64.S:1027 RIP: 0010:debug_print_object+0x197/0x2b0 lib/debugobjects.c:485 Code: ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 e3 00 00 00 48 8b 14 dd 20 b1 e1 8a 4c 89 ee 48 c7 c7 e0 8c b9 88 e8 a5 1f c0 fd <0f> 0b 83 05 14 3e e8 08 01 48 83 c4 18 5b 5d 41 5c 41 5d 41 5e c3 RSP: 0018:ffffc9000270ee48 EFLAGS: 00010286 RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000000000 RDX: 0000000000000001 RSI: ffffffff89deafc8 RDI: ffffffff8e4db220 RBP: 0000000000000001 R08: ffffed10173e6479 R09: ffffed10173e6479 R10: ffffed10173e6478 R11: ffff8880b9f323c7 R12: ffffffff8a269840 R13: ffffffff88b992e0 R14: ffffffff81423440 R15: ffff88809f700ac0 __debug_check_no_obj_freed lib/debugobjects.c:967 [inline] debug_check_no_obj_freed+0x2d1/0x410 lib/debugobjects.c:998 slab_free_hook mm/slub.c:1441 [inline] slab_free_freelist_hook+0xc0/0x140 mm/slub.c:1477 slab_free mm/slub.c:3024 [inline] kfree+0xd6/0x3c0 mm/slub.c:3976 smsusb_term_device+0xb2/0x130 drivers/media/usb/siano/smsusb.c:350 smsusb_init_device.cold.9+0x49/0xcd drivers/media/usb/siano/smsusb.c:487 smsusb_probe+0x581/0xe97 drivers/media/usb/siano/smsusb.c:566 usb_probe_interface+0x277/0x840 drivers/usb/core/driver.c:361 really_probe+0x20b/0xb00 drivers/base/dd.c:551 driver_probe_device+0x259/0x370 drivers/base/dd.c:724 bus_for_each_drv+0x118/0x1b0 drivers/base/bus.c:431 __device_attach+0x1be/0x2e0 drivers/base/dd.c:897 bus_probe_device+0x19e/0x250 drivers/base/bus.c:491 device_add+0x10f7/0x1920 drivers/base/core.c:2500 usb_set_configuration+0xc81/0x1940 drivers/usb/core/message.c:2023 generic_probe+0x61/0x8a drivers/usb/core/generic.c:210 really_probe+0x20b/0xb00 drivers/base/dd.c:551 driver_probe_device+0x259/0x370 drivers/base/dd.c:724 bus_for_each_drv+0x118/0x1b0 drivers/base/bus.c:431 __device_attach+0x1be/0x2e0 drivers/base/dd.c:897 bus_probe_device+0x19e/0x250 drivers/base/bus.c:491 device_add+0x10f7/0x1920 drivers/base/core.c:2500 usb_new_device+0x866/0x14e0 drivers/usb/core/hub.c:2548 hub_port_connect drivers/usb/core/hub.c:5195 [inline] hub_port_connect_change drivers/usb/core/hub.c:5335 [inline] port_event drivers/usb/core/hub.c:5481 [inline] hub_event+0x1079/0x3240 drivers/usb/core/hub.c:5563 process_one_work+0x8ff/0x1690 kernel/workqueue.c:2264 worker_thread+0x82/0xb50 kernel/workqueue.c:2410 kthread+0x31d/0x3e0 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Kernel Offset: disabled Rebooting in 86400 seconds..