================================================================== BUG: KASAN: slab-use-after-free in cfusbl_device_notify+0x8d5/0x960 net/caif/caif_usb.c:142 Read of size 8 at addr ffff888058b90d48 by task syz.0.1278/10760 CPU: 1 UID: 0 PID: 10760 Comm: syz.0.1278 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 cfusbl_device_notify+0x8d5/0x960 net/caif/caif_usb.c:142 notifier_call_chain+0xbc/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2230 call_netdevice_notifiers_extack net/core/dev.c:2268 [inline] call_netdevice_notifiers net/core/dev.c:2282 [inline] register_netdevice+0xe02/0x21d0 net/core/dev.c:11386 register_netdev+0x34/0x50 net/core/dev.c:11507 bnep_add_connection+0x71c/0xd40 net/bluetooth/bnep/core.c:624 do_bnep_sock_ioctl.constprop.0+0x442/0x5c0 net/bluetooth/bnep/sock.c:83 sock_do_ioctl+0x118/0x280 net/socket.c:1254 sock_ioctl+0x227/0x6b0 net/socket.c:1375 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fea47b8f7c9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fea4894d038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fea47de5fa0 RCX: 00007fea47b8f7c9 RDX: 0000200000000100 RSI: 00000000400442c8 RDI: 0000000000000005 RBP: 00007fea47c13f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fea47de6038 R14: 00007fea47de5fa0 R15: 00007ffff10ba918 Allocated by task 5946: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:397 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:414 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] __hci_conn_add+0xf8/0x1cc0 net/bluetooth/hci_conn.c:963 hci_conn_add_unset+0x76/0x130 net/bluetooth/hci_conn.c:1084 hci_conn_request_evt+0x909/0xb80 net/bluetooth/hci_event.c:3299 hci_event_func net/bluetooth/hci_event.c:7719 [inline] hci_event_packet+0xa39/0x1210 net/bluetooth/hci_event.c:7773 hci_rx_work+0x2c9/0x1020 net/bluetooth/hci_core.c:4076 process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Freed by task 10727: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2540 [inline] slab_free mm/slub.c:6668 [inline] kfree+0x2f8/0x6e0 mm/slub.c:6876 device_release+0xa4/0x240 drivers/base/core.c:2565 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1ef/0x6f0 lib/kobject.c:737 put_device+0x1f/0x30 drivers/base/core.c:3797 hci_conn_put include/net/bluetooth/hci_core.h:1671 [inline] hci_disconnect_all_sync.constprop.0+0x10c/0x3c0 net/bluetooth/hci_sync.c:5745 hci_suspend_sync+0x821/0xb40 net/bluetooth/hci_sync.c:6220 hci_suspend_dev+0x331/0x560 net/bluetooth/hci_core.c:2849 hci_suspend_notifier+0x2e0/0x340 net/bluetooth/hci_core.c:2420 notifier_call_chain+0xbc/0x3e0 kernel/notifier.c:85 notifier_call_chain_robust kernel/notifier.c:120 [inline] blocking_notifier_call_chain_robust kernel/notifier.c:345 [inline] blocking_notifier_call_chain_robust+0xc8/0x160 kernel/notifier.c:333 pm_notifier_call_chain_robust+0x27/0x60 kernel/power/main.c:172 snapshot_open+0x189/0x2b0 kernel/power/user.c:77 misc_open+0x26d/0x450 drivers/char/misc.c:163 chrdev_open+0x234/0x6a0 fs/char_dev.c:414 do_dentry_open+0x748/0x1590 fs/open.c:962 vfs_open+0x82/0x3f0 fs/open.c:1094 do_open fs/namei.c:4628 [inline] path_openat+0x2078/0x3140 fs/namei.c:4787 do_filp_open+0x20b/0x470 fs/namei.c:4814 do_sys_openat2+0x121/0x290 fs/open.c:1430 do_sys_open fs/open.c:1436 [inline] __do_sys_openat fs/open.c:1452 [inline] __se_sys_openat fs/open.c:1447 [inline] __x64_sys_openat+0x174/0x210 fs/open.c:1447 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:556 insert_work+0x36/0x230 kernel/workqueue.c:2180 __queue_work+0x94f/0x10e0 kernel/workqueue.c:2335 __queue_delayed_work+0x35b/0x460 kernel/workqueue.c:2503 queue_delayed_work_on+0x1b5/0x200 kernel/workqueue.c:2555 queue_delayed_work include/linux/workqueue.h:684 [inline] hci_conn_drop include/net/bluetooth/hci_core.h:1710 [inline] hci_conn_drop include/net/bluetooth/hci_core.h:1684 [inline] l2cap_chan_del+0x5a0/0x940 net/bluetooth/l2cap_core.c:672 l2cap_conn_del+0x380/0x760 net/bluetooth/l2cap_core.c:1788 l2cap_connect_cfm+0xa0a/0x1010 net/bluetooth/l2cap_core.c:7260 hci_connect_cfm include/net/bluetooth/hci_core.h:2131 [inline] hci_conn_failed+0x1bd/0x360 net/bluetooth/hci_conn.c:1336 hci_abort_conn_sync+0x76a/0xb20 net/bluetooth/hci_sync.c:5721 hci_disconnect_all_sync.constprop.0+0x104/0x3c0 net/bluetooth/hci_sync.c:5744 hci_suspend_sync+0x821/0xb40 net/bluetooth/hci_sync.c:6220 hci_suspend_dev+0x331/0x560 net/bluetooth/hci_core.c:2849 hci_suspend_notifier+0x2e0/0x340 net/bluetooth/hci_core.c:2420 notifier_call_chain+0xbc/0x3e0 kernel/notifier.c:85 notifier_call_chain_robust kernel/notifier.c:120 [inline] blocking_notifier_call_chain_robust kernel/notifier.c:345 [inline] blocking_notifier_call_chain_robust+0xc8/0x160 kernel/notifier.c:333 pm_notifier_call_chain_robust+0x27/0x60 kernel/power/main.c:172 snapshot_open+0x189/0x2b0 kernel/power/user.c:77 misc_open+0x26d/0x450 drivers/char/misc.c:163 chrdev_open+0x234/0x6a0 fs/char_dev.c:414 do_dentry_open+0x748/0x1590 fs/open.c:962 vfs_open+0x82/0x3f0 fs/open.c:1094 do_open fs/namei.c:4628 [inline] path_openat+0x2078/0x3140 fs/namei.c:4787 do_filp_open+0x20b/0x470 fs/namei.c:4814 do_sys_openat2+0x121/0x290 fs/open.c:1430 do_sys_open fs/open.c:1436 [inline] __do_sys_openat fs/open.c:1452 [inline] __se_sys_openat fs/open.c:1447 [inline] __x64_sys_openat+0x174/0x210 fs/open.c:1447 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888058b90000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 3400 bytes inside of freed 8192-byte region [ffff888058b90000, ffff888058b92000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x58b90 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b443180 ffffea0000a7e400 0000000000000005 raw: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b443180 ffffea0000a7e400 0000000000000005 head: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea000162e401 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1528c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 10661, tgid 10658 (syz.6.1259), ts 175501520611, free_ts 175311991615 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1846 prep_new_page mm/page_alloc.c:1854 [inline] get_page_from_freelist+0xd0b/0x31a0 mm/page_alloc.c:3915 __alloc_frozen_pages_noprof+0x25f/0x2430 mm/page_alloc.c:5210 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x2c3/0x430 mm/slub.c:3302 ___slab_alloc+0xe18/0x1c90 mm/slub.c:4656 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __do_kmalloc_node mm/slub.c:5656 [inline] __kvmalloc_node_noprof+0x592/0xa40 mm/slub.c:7134 kvmalloc_array_node_noprof include/linux/slab.h:1122 [inline] __ptr_ring_init_queue_alloc_noprof include/linux/ptr_ring.h:481 [inline] ptr_ring_init_noprof include/linux/ptr_ring.h:499 [inline] skb_array_init_noprof include/linux/skb_array.h:182 [inline] pfifo_fast_init+0x12a/0x3b0 net/sched/sch_generic.c:870 qdisc_create_dflt+0x125/0x460 net/sched/sch_generic.c:1015 attach_one_default_qdisc net/sched/sch_generic.c:1174 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2680 [inline] attach_default_qdiscs net/sched/sch_generic.c:1192 [inline] dev_activate+0x63f/0x12d0 net/sched/sch_generic.c:1251 __dev_open+0x4f1/0x960 net/core/dev.c:1692 __dev_change_flags+0x55d/0x6f0 net/core/dev.c:9734 netif_change_flags+0x8d/0x160 net/core/dev.c:9797 dev_change_flags+0xba/0x250 net/core/dev_api.c:68 dev_ifsioc+0x1498/0x1f70 net/core/dev_ioctl.c:583 page last free pid 5930 tgid 5930 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x7df/0x1170 mm/page_alloc.c:2943 discard_slab mm/slub.c:3346 [inline] __put_partials+0x130/0x170 mm/slub.c:3886 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4c/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:349 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4953 [inline] slab_alloc_node mm/slub.c:5263 [inline] kmem_cache_alloc_noprof+0x25e/0x770 mm/slub.c:5270 getname_flags.part.0+0x4c/0x550 fs/namei.c:146 getname_flags+0x93/0xf0 include/linux/audit.h:345 user_path_at+0x24/0x60 fs/namei.c:3566 ksys_umount fs/namespace.c:2058 [inline] __do_sys_umount fs/namespace.c:2066 [inline] __se_sys_umount fs/namespace.c:2064 [inline] __x64_sys_umount+0x10a/0x1a0 fs/namespace.c:2064 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888058b90c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888058b90c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888058b90d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888058b90d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888058b90e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================