================================================================== BUG: KASAN: use-after-free in hci_chan_del+0x1c5/0x200 net/bluetooth/hci_conn.c:1769 Read of size 8 at addr ffff88802104c318 by task syz-executor.5/14223 CPU: 1 PID: 14223 Comm: syz-executor.5 Not tainted 5.12.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:436 hci_chan_del+0x1c5/0x200 net/bluetooth/hci_conn.c:1769 l2cap_conn_del+0x478/0x7b0 net/bluetooth/l2cap_core.c:1906 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:8168 [inline] l2cap_disconn_cfm+0x98/0xd0 net/bluetooth/l2cap_core.c:8161 hci_disconn_cfm include/net/bluetooth/hci_core.h:1486 [inline] hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1598 hci_dev_do_close+0x569/0x1110 net/bluetooth/hci_core.c:1778 hci_rfkill_set_block+0x19c/0x1d0 net/bluetooth/hci_core.c:2217 rfkill_set_block+0x1f9/0x540 net/rfkill/core.c:344 rfkill_fop_write+0x267/0x500 net/rfkill/core.c:1268 vfs_write+0x28e/0xa30 fs/read_write.c:603 ksys_write+0x1ee/0x250 fs/read_write.c:658 do_syscall_32_irqs_on arch/x86/entry/common.c:78 [inline] __do_fast_syscall_32+0x67/0xe0 arch/x86/entry/common.c:143 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:168 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf7f52549 Code: 03 74 c0 01 10 05 03 74 b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f554c5fc EFLAGS: 00000296 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000020000080 RDX: 0000000000000008 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 12638: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:427 [inline] ____kasan_kmalloc mm/kasan/common.c:506 [inline] ____kasan_kmalloc mm/kasan/common.c:465 [inline] __kasan_kmalloc+0x99/0xc0 mm/kasan/common.c:515 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:686 [inline] fl_create+0x10d/0xcb0 net/ipv6/ip6_flowlabel.c:387 ipv6_flowlabel_get net/ipv6/ip6_flowlabel.c:634 [inline] ipv6_flowlabel_opt+0xae7/0x2b40 net/ipv6/ip6_flowlabel.c:737 do_ipv6_setsockopt.constprop.0+0x1a48/0x41f0 net/ipv6/ipv6_sockglue.c:933 ipv6_setsockopt+0xd6/0x180 net/ipv6/ipv6_sockglue.c:1003 sctp_setsockopt+0x14c/0x9bf0 net/sctp/socket.c:4503 __sys_setsockopt+0x2db/0x610 net/socket.c:2117 __do_sys_setsockopt net/socket.c:2128 [inline] __se_sys_setsockopt net/socket.c:2125 [inline] __ia32_sys_setsockopt+0xb9/0x150 net/socket.c:2125 do_syscall_32_irqs_on arch/x86/entry/common.c:78 [inline] __do_fast_syscall_32+0x67/0xe0 arch/x86/entry/common.c:143 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:168 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Freed by task 25: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:357 ____kasan_slab_free mm/kasan/common.c:360 [inline] ____kasan_slab_free mm/kasan/common.c:325 [inline] __kasan_slab_free+0xf5/0x130 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:1563 [inline] slab_free_freelist_hook+0x92/0x210 mm/slub.c:1601 slab_free mm/slub.c:3162 [inline] kfree+0xe5/0x7f0 mm/slub.c:4216 mpls_dev_sysctl_unregister net/mpls/af_mpls.c:1443 [inline] mpls_dev_notify+0x4f9/0x900 net/mpls/af_mpls.c:1622 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2075 call_netdevice_notifiers_extack net/core/dev.c:2087 [inline] call_netdevice_notifiers net/core/dev.c:2101 [inline] unregister_netdevice_many+0x942/0x1760 net/core/dev.c:10936 ip_tunnel_delete_nets+0x3eb/0x5b0 net/ipv4/ip_tunnel.c:1113 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:178 cleanup_net+0x4ea/0xb10 net/core/net_namespace.c:595 process_one_work+0x98d/0x1600 kernel/workqueue.c:2275 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421 kthread+0x3b1/0x4a0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 The buggy address belongs to the object at ffff88802104c300 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of 128-byte region [ffff88802104c300, ffff88802104c380) The buggy address belongs to the page: page:ffffea0000841300 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2104c flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000049e540 0000000700000002 ffff8880110418c0 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88802104c200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802104c280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802104c300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802104c380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802104c400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================