================================================================== BUG: KASAN: use-after-free in ax88172a_remove_mdio drivers/net/usb/ax88172a.c:123 [inline] BUG: KASAN: use-after-free in ax88172a_unbind+0x6a/0xc0 drivers/net/usb/ax88172a.c:274 Read of size 8 at addr ffff8881d9f05280 by task kworker/0:6/3335 CPU: 0 PID: 3335 Comm: kworker/0:6 Not tainted 5.4.32-syzkaller-00194-ga9154741b880 #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+0x14a/0x1ce lib/dump_stack.c:118 print_address_description+0x93/0x620 mm/kasan/report.c:374 __kasan_report+0x16d/0x1e0 mm/kasan/report.c:506 kasan_report+0x34/0x60 mm/kasan/common.c:634 ax88172a_remove_mdio drivers/net/usb/ax88172a.c:123 [inline] ax88172a_unbind+0x6a/0xc0 drivers/net/usb/ax88172a.c:274 usbnet_disconnect+0x14b/0x340 drivers/net/usb/usbnet.c:1618 usb_unbind_interface+0x1cf/0x840 drivers/usb/core/driver.c:423 __device_release_driver drivers/base/dd.c:1137 [inline] device_release_driver_internal+0x505/0x790 drivers/base/dd.c:1168 bus_remove_device+0x2e0/0x350 drivers/base/bus.c:532 device_del+0x7a7/0x11f0 drivers/base/core.c:2684 usb_disable_device+0x3f3/0xb80 drivers/usb/core/message.c:1237 usb_disconnect+0x341/0x880 drivers/usb/core/hub.c:2211 hub_port_connect drivers/usb/core/hub.c:4961 [inline] hub_port_connect_change drivers/usb/core/hub.c:5225 [inline] port_event drivers/usb/core/hub.c:5371 [inline] hub_event+0x1c44/0x4fc0 drivers/usb/core/hub.c:5453 process_one_work+0x777/0xf90 kernel/workqueue.c:2274 worker_thread+0xa8f/0x1430 kernel/workqueue.c:2420 kthread+0x2df/0x300 kernel/kthread.c:255 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 3335: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc+0x12c/0x1c0 mm/kasan/common.c:510 kmem_cache_alloc_trace+0xc3/0x280 mm/slub.c:2793 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:690 [inline] ax88172a_bind+0xc7/0x980 drivers/net/usb/ax88172a.c:191 usbnet_probe+0xa8f/0x2760 drivers/net/usb/usbnet.c:1737 usb_probe_interface+0x621/0xac0 drivers/usb/core/driver.c:361 really_probe+0x75b/0xf50 drivers/base/dd.c:555 driver_probe_device+0xe6/0x230 drivers/base/dd.c:724 bus_for_each_drv+0x17a/0x200 drivers/base/bus.c:430 __device_attach+0x275/0x410 drivers/base/dd.c:897 bus_probe_device+0xb8/0x1e0 drivers/base/bus.c:490 device_add+0x1054/0x1740 drivers/base/core.c:2507 usb_set_configuration+0x184c/0x1dc0 drivers/usb/core/message.c:2023 generic_probe+0x82/0x140 drivers/usb/core/generic.c:210 really_probe+0x75b/0xf50 drivers/base/dd.c:555 driver_probe_device+0xe6/0x230 drivers/base/dd.c:724 bus_for_each_drv+0x17a/0x200 drivers/base/bus.c:430 __device_attach+0x275/0x410 drivers/base/dd.c:897 bus_probe_device+0xb8/0x1e0 drivers/base/bus.c:490 device_add+0x1054/0x1740 drivers/base/core.c:2507 usb_new_device+0x9ba/0xfc0 drivers/usb/core/hub.c:2548 hub_port_connect drivers/usb/core/hub.c:5110 [inline] hub_port_connect_change drivers/usb/core/hub.c:5225 [inline] port_event drivers/usb/core/hub.c:5371 [inline] hub_event+0x28eb/0x4fc0 drivers/usb/core/hub.c:5453 process_one_work+0x777/0xf90 kernel/workqueue.c:2274 worker_thread+0xa8f/0x1430 kernel/workqueue.c:2420 kthread+0x2df/0x300 kernel/kthread.c:255 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352 Freed by task 3335: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x181/0x230 mm/kasan/common.c:471 slab_free_hook mm/slub.c:1424 [inline] slab_free_freelist_hook+0xd0/0x150 mm/slub.c:1457 slab_free mm/slub.c:3014 [inline] kfree+0x12b/0x600 mm/slub.c:3975 ax88172a_bind+0x844/0x980 drivers/net/usb/ax88172a.c:250 usbnet_probe+0xa8f/0x2760 drivers/net/usb/usbnet.c:1737 usb_probe_interface+0x621/0xac0 drivers/usb/core/driver.c:361 really_probe+0x75b/0xf50 drivers/base/dd.c:555 driver_probe_device+0xe6/0x230 drivers/base/dd.c:724 bus_for_each_drv+0x17a/0x200 drivers/base/bus.c:430 __device_attach+0x275/0x410 drivers/base/dd.c:897 bus_probe_device+0xb8/0x1e0 drivers/base/bus.c:490 device_add+0x1054/0x1740 drivers/base/core.c:2507 usb_set_configuration+0x184c/0x1dc0 drivers/usb/core/message.c:2023 generic_probe+0x82/0x140 drivers/usb/core/generic.c:210 really_probe+0x75b/0xf50 drivers/base/dd.c:555 driver_probe_device+0xe6/0x230 drivers/base/dd.c:724 bus_for_each_drv+0x17a/0x200 drivers/base/bus.c:430 __device_attach+0x275/0x410 drivers/base/dd.c:897 bus_probe_device+0xb8/0x1e0 drivers/base/bus.c:490 device_add+0x1054/0x1740 drivers/base/core.c:2507 usb_new_device+0x9ba/0xfc0 drivers/usb/core/hub.c:2548 hub_port_connect drivers/usb/core/hub.c:5110 [inline] hub_port_connect_change drivers/usb/core/hub.c:5225 [inline] port_event drivers/usb/core/hub.c:5371 [inline] hub_event+0x28eb/0x4fc0 drivers/usb/core/hub.c:5453 process_one_work+0x777/0xf90 kernel/workqueue.c:2274 worker_thread+0xa8f/0x1430 kernel/workqueue.c:2420 kthread+0x2df/0x300 kernel/kthread.c:255 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff8881d9f05280 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff8881d9f05280, ffff8881d9f052c0) The buggy address belongs to the page: page:ffffea000767c140 refcount:1 mapcount:0 mapping:ffff8881da803600 index:0x0 flags: 0x8000000000000200(slab) raw: 8000000000000200 ffffea00071a1640 0000000200000002 ffff8881da803600 raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d9f05180: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff8881d9f05200: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc >ffff8881d9f05280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8881d9f05300: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881d9f05380: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ================================================================== asix 6-1:0.0 eth1 (unregistered): deregistering mdio bus ¿ ------------[ cut here ]------------ kernel BUG at drivers/net/phy/mdio_bus.c:456! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 3335 Comm: kworker/0:6 Tainted: G B 5.4.32-syzkaller-00194-ga9154741b880 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: usb_hub_wq hub_event RIP: 0010:mdiobus_unregister+0x1da/0x1e0 drivers/net/phy/mdio_bus.c:456 Code: fa fe e9 80 fe ff ff 44 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 94 fe ff ff 4c 89 ff e8 c0 4c fa fe e9 87 fe ff ff e8 d6 2d cc fe <0f> 0b 0f 1f 40 00 41 57 41 56 41 55 41 54 53 49 89 ff 49 bc 00 00 RSP: 0018:ffff8881c6d2f640 EFLAGS: 00010246 RAX: ffffffff8275988a RBX: 0000000000000fb9 RCX: 0000000000040000 RDX: ffffc9000e3dc000 RSI: 000000000003ffff RDI: 0000000000040000 RBP: 1ffff1103b39a85e R08: ffffffff827596f6 R09: ffffed103b705de0 R10: ffffed103b705de0 R11: 0000000000000000 R12: dffffc0000000000 R13: dffffc0000000000 R14: ffff8881d9cd4258 R15: ffff8881d9cd42f0 FS: 0000000000000000(0000) GS:ffff8881db800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2d422000 CR3: 00000001cd389004 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ax88172a_remove_mdio drivers/net/usb/ax88172a.c:124 [inline] ax88172a_unbind+0x99/0xc0 drivers/net/usb/ax88172a.c:274 usbnet_disconnect+0x14b/0x340 drivers/net/usb/usbnet.c:1618 usb_unbind_interface+0x1cf/0x840 drivers/usb/core/driver.c:423 __device_release_driver drivers/base/dd.c:1137 [inline] device_release_driver_internal+0x505/0x790 drivers/base/dd.c:1168 bus_remove_device+0x2e0/0x350 drivers/base/bus.c:532 device_del+0x7a7/0x11f0 drivers/base/core.c:2684 usb_disable_device+0x3f3/0xb80 drivers/usb/core/message.c:1237 usb_disconnect+0x341/0x880 drivers/usb/core/hub.c:2211 hub_port_connect drivers/usb/core/hub.c:4961 [inline] hub_port_connect_change drivers/usb/core/hub.c:5225 [inline] port_event drivers/usb/core/hub.c:5371 [inline] hub_event+0x1c44/0x4fc0 drivers/usb/core/hub.c:5453 process_one_work+0x777/0xf90 kernel/workqueue.c:2274 worker_thread+0xa8f/0x1430 kernel/workqueue.c:2420 kthread+0x2df/0x300 kernel/kthread.c:255 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352 Modules linked in: ---[ end trace 8efbf5393c109f00 ]--- RIP: 0010:mdiobus_unregister+0x1da/0x1e0 drivers/net/phy/mdio_bus.c:456 Code: fa fe e9 80 fe ff ff 44 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 94 fe ff ff 4c 89 ff e8 c0 4c fa fe e9 87 fe ff ff e8 d6 2d cc fe <0f> 0b 0f 1f 40 00 41 57 41 56 41 55 41 54 53 49 89 ff 49 bc 00 00 RSP: 0018:ffff8881c6d2f640 EFLAGS: 00010246 RAX: ffffffff8275988a RBX: 0000000000000fb9 RCX: 0000000000040000 RDX: ffffc9000e3dc000 RSI: 000000000003ffff RDI: 0000000000040000 RBP: 1ffff1103b39a85e R08: ffffffff827596f6 R09: ffffed103b705de0 R10: ffffed103b705de0 R11: 0000000000000000 R12: dffffc0000000000 R13: dffffc0000000000 R14: ffff8881d9cd4258 R15: ffff8881d9cd42f0 FS: 0000000000000000(0000) GS:ffff8881db800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2d422000 CR3: 00000001cd389004 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400