================================================================== BUG: KASAN: use-after-free in __lock_acquire+0xfe/0x6100 kernel/locking/lockdep.c:4885 Read of size 8 at addr ffff8880234f00a0 by task syz-executor.0/8449 CPU: 1 PID: 8449 Comm: syz-executor.0 Not tainted 5.14.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1ae/0x29f lib/dump_stack.c:105 print_address_description+0x66/0x3b0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x163/0x210 mm/kasan/report.c:436 __lock_acquire+0xfe/0x6100 kernel/locking/lockdep.c:4885 lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:175 spin_lock_bh include/linux/spinlock.h:359 [inline] lock_sock_nested+0x48/0x110 net/core/sock.c:3162 l2cap_sock_teardown_cb+0x76/0x360 net/bluetooth/l2cap_sock.c:1528 l2cap_chan_del+0xaf/0x610 net/bluetooth/l2cap_core.c:622 l2cap_conn_del+0x406/0x650 net/bluetooth/l2cap_core.c:1898 hci_disconn_cfm include/net/bluetooth/hci_core.h:1501 [inline] hci_conn_hash_flush+0x112/0x240 net/bluetooth/hci_conn.c:1608 hci_dev_do_close+0x905/0x1010 net/bluetooth/hci_core.c:1778 hci_unregister_dev+0x2a2/0x510 net/bluetooth/hci_core.c:4015 vhci_release+0x73/0xc0 drivers/bluetooth/hci_vhci.c:340 __fput+0x352/0x7b0 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0x72b/0x2510 kernel/exit.c:825 do_group_exit+0x168/0x2d0 kernel/exit.c:922 __do_sys_exit_group+0x13/0x20 kernel/exit.c:933 __se_sys_exit_group+0x10/0x10 kernel/exit.c:931 __x64_sys_exit_group+0x37/0x40 kernel/exit.c:931 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4665e9 Code: Unable to access opcode bytes at RIP 0x4665bf. RSP: 002b:00007fff944df4b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 000000000000214d RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000043 RBP: 0000000000000000 R08: 0000000000000014 R09: 000000000000214d R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004bfe0f R13: 0000000000000000 R14: 0000000000000004 R15: 00007fff944df6b0 Allocated by task 19525: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xcd/0x100 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0xb4/0x390 mm/slub.c:4115 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0xf4/0x230 net/core/sock.c:1808 sk_alloc+0x35/0x300 net/core/sock.c:1861 l2cap_sock_alloc+0x34/0x1d0 net/bluetooth/l2cap_sock.c:1813 l2cap_sock_create+0x113/0x1d0 net/bluetooth/l2cap_sock.c:1859 bt_sock_create+0x15b/0x220 net/bluetooth/af_bluetooth.c:130 __sock_create+0x580/0x8d0 net/socket.c:1450 sock_create net/socket.c:1501 [inline] __sys_socket+0x115/0x350 net/socket.c:1543 __do_sys_socket net/socket.c:1552 [inline] __se_sys_socket net/socket.c:1550 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1550 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 19523: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x3d/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0x10d/0x150 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1628 [inline] slab_free_freelist_hook+0x1e8/0x2a0 mm/slub.c:1653 slab_free mm/slub.c:3213 [inline] kfree+0xcf/0x2e0 mm/slub.c:4267 sk_prot_free net/core/sock.c:1844 [inline] __sk_destruct+0x57f/0x830 net/core/sock.c:1929 l2cap_sock_release+0x149/0x1c0 net/bluetooth/l2cap_sock.c:1397 __sock_release net/socket.c:648 [inline] sock_close+0xd8/0x260 net/socket.c:1300 __fput+0x352/0x7b0 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x201/0x220 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302 do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff8880234f0000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 160 bytes inside of 2048-byte region [ffff8880234f0000, ffff8880234f0800) The buggy address belongs to the page: page:ffffea00008d3c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880234f2000 pfn:0x234f0 head:ffffea00008d3c00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea000081d408 ffff888011040948 ffff888011042000 raw: ffff8880234f2000 0000000000080007 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 8669, ts 1583688254244, free_ts 1583673427056 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4168 __alloc_pages+0x26c/0x5f0 mm/page_alloc.c:5390 alloc_slab_page mm/slub.c:1691 [inline] allocate_slab+0xf1/0x540 mm/slub.c:1831 new_slab mm/slub.c:1894 [inline] new_slab_objects mm/slub.c:2640 [inline] ___slab_alloc+0x1cf/0x350 mm/slub.c:2803 __slab_alloc mm/slub.c:2843 [inline] slab_alloc_node mm/slub.c:2925 [inline] __kmalloc_node_track_caller+0x2f4/0x410 mm/slub.c:4653 kmalloc_reserve net/core/skbuff.c:355 [inline] __alloc_skb+0x127/0x580 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1112 [inline] alloc_skb_with_frags+0xab/0x660 net/core/skbuff.c:6019 sock_alloc_send_pskb+0x930/0xa70 net/core/sock.c:2461 mld_newpack+0x19b/0x9d0 net/ipv6/mcast.c:1751 add_grhead net/ipv6/mcast.c:1854 [inline] add_grec+0x1178/0x15c0 net/ipv6/mcast.c:1992 mld_send_initial_cr+0x1f6/0x370 net/ipv6/mcast.c:2239 ipv6_mc_dad_complete+0x81/0x390 net/ipv6/mcast.c:2250 addrconf_dad_completed+0x695/0xbe0 net/ipv6/addrconf.c:4175 addrconf_dad_work+0xfc8/0x1cf0 net/ipv6/addrconf.c:4105 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276 worker_thread+0xac1/0x1320 kernel/workqueue.c:2422 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1346 [inline] free_pcp_prepare+0xc29/0xd20 mm/page_alloc.c:1397 free_unref_page_prepare mm/page_alloc.c:3332 [inline] free_unref_page+0x7e/0x550 mm/page_alloc.c:3411 free_slab mm/slub.c:1934 [inline] discard_slab mm/slub.c:1940 [inline] unfreeze_partials+0x18c/0x1e0 mm/slub.c:2421 put_cpu_partial+0xd2/0x210 mm/slub.c:2457 __slab_free+0x3a8/0x6b0 mm/slub.c:3107 do_slab_free mm/slub.c:3201 [inline] ___cache_free+0xfc/0x120 mm/slub.c:3220 qlist_free_all mm/kasan/quarantine.c:165 [inline] kasan_quarantine_reduce+0x151/0x1c0 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:2959 [inline] slab_alloc mm/slub.c:2967 [inline] kmem_cache_alloc+0x1d1/0x340 mm/slub.c:2972 getname_flags+0xba/0x640 fs/namei.c:138 user_path_at_empty+0x28/0x50 fs/namei.c:2747 do_readlinkat+0x10c/0x3d0 fs/stat.c:425 __do_sys_readlinkat fs/stat.c:452 [inline] __se_sys_readlinkat fs/stat.c:449 [inline] __x64_sys_readlinkat+0x96/0xb0 fs/stat.c:449 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff8880234eff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880234f0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880234f0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880234f0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880234f0180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================