================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3d86/0x54a0 kernel/locking/lockdep.c:4885 Read of size 8 at addr ffff88801c6f60a0 by task syz-executor.0/8465 CPU: 0 PID: 8465 Comm: syz-executor.0 Not tainted 5.14.0-rc6-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+0xcd/0x134 lib/dump_stack.c:105 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 __lock_acquire+0x3d86/0x54a0 kernel/locking/lockdep.c:4885 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:175 spin_lock_bh include/linux/spinlock.h:359 [inline] lock_sock_nested+0x40/0x120 net/core/sock.c:3162 l2cap_sock_teardown_cb+0xa1/0x660 net/bluetooth/l2cap_sock.c:1528 l2cap_chan_del+0xbc/0xa80 net/bluetooth/l2cap_core.c:622 l2cap_conn_del+0x3c0/0x7b0 net/bluetooth/l2cap_core.c:1898 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:8177 [inline] l2cap_disconn_cfm+0x95/0xd0 net/bluetooth/l2cap_core.c:8170 hci_disconn_cfm include/net/bluetooth/hci_core.h:1501 [inline] hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1608 hci_dev_do_close+0x528/0x1130 net/bluetooth/hci_core.c:1778 hci_unregister_dev+0x1c0/0x5a0 net/bluetooth/hci_core.c:4015 vhci_release+0x70/0xe0 drivers/bluetooth/hci_vhci.c:340 __fput+0x288/0x920 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xbd4/0x2a60 kernel/exit.c:825 do_group_exit+0x125/0x310 kernel/exit.c:922 __do_sys_exit_group kernel/exit.c:933 [inline] __se_sys_exit_group kernel/exit.c:931 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:931 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/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:00007ffe82b64368 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 000000000000061b RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000043 RBP: 0000000000000000 R08: 0000000000000014 R09: 000000000000061b R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004bfe0f R13: 0000000000000000 R14: 0000000000000005 R15: 00007ffe82b64560 Allocated by task 10521: 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:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0x9b/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0x110/0x290 net/core/sock.c:1808 sk_alloc+0x32/0xbc0 net/core/sock.c:1861 l2cap_sock_alloc.constprop.0+0x31/0x230 net/bluetooth/l2cap_sock.c:1813 l2cap_sock_create+0x123/0x1f0 net/bluetooth/l2cap_sock.c:1859 bt_sock_create+0x17c/0x340 net/bluetooth/af_bluetooth.c:130 __sock_create+0x353/0x790 net/socket.c:1450 sock_create net/socket.c:1501 [inline] __sys_socket+0xef/0x200 net/socket.c:1543 __do_sys_socket net/socket.c:1552 [inline] __se_sys_socket net/socket.c:1550 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1550 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 10520: 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:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xfb/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1628 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1653 slab_free mm/slub.c:3213 [inline] kfree+0xe4/0x540 mm/slub.c:4267 sk_prot_free net/core/sock.c:1844 [inline] __sk_destruct+0x6a8/0x900 net/core/sock.c:1929 sk_destruct+0xbd/0xe0 net/core/sock.c:1944 __sk_free+0xef/0x3d0 net/core/sock.c:1955 sk_free+0x78/0xa0 net/core/sock.c:1966 sock_put include/net/sock.h:1816 [inline] l2cap_sock_kill+0x203/0x240 net/bluetooth/l2cap_sock.c:1227 l2cap_sock_release+0x184/0x200 net/bluetooth/l2cap_sock.c:1397 __sock_release+0xcd/0x280 net/socket.c:648 sock_close+0x18/0x20 net/socket.c:1300 __fput+0x288/0x920 fs/file_table.c:280 task_work_run+0xdd/0x1a0 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+0x27e/0x290 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3029 [inline] call_rcu+0xb1/0x750 kernel/rcu/tree.c:3109 netlink_release+0xdd4/0x1dd0 net/netlink/af_netlink.c:812 __sock_release+0xcd/0x280 net/socket.c:648 sock_close+0x18/0x20 net/socket.c:1300 __fput+0x288/0x920 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xbd4/0x2a60 kernel/exit.c:825 do_group_exit+0x125/0x310 kernel/exit.c:922 __do_sys_exit_group kernel/exit.c:933 [inline] __se_sys_exit_group kernel/exit.c:931 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:931 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88801c6f6000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 160 bytes inside of 2048-byte region [ffff88801c6f6000, ffff88801c6f6800) The buggy address belongs to the page: page:ffffea000071bc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c6f0 head:ffffea000071bc00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010842000 raw: 0000000000000000 0000000000080008 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 8605, ts 1584523777016, free_ts 1584487668141 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4169 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5391 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 alloc_slab_page mm/slub.c:1691 [inline] allocate_slab+0x32e/0x4b0 mm/slub.c:1831 new_slab mm/slub.c:1894 [inline] new_slab_objects mm/slub.c:2640 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2803 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2843 slab_alloc_node mm/slub.c:2925 [inline] __kmalloc_node_track_caller+0x2e3/0x360 mm/slub.c:4653 kmalloc_reserve net/core/skbuff.c:355 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1112 [inline] alloc_skb_with_frags+0x93/0x620 net/core/skbuff.c:6019 sock_alloc_send_pskb+0x783/0x910 net/core/sock.c:2461 mld_newpack+0x1df/0x770 net/ipv6/mcast.c:1751 add_grhead+0x265/0x330 net/ipv6/mcast.c:1854 add_grec+0x1053/0x14e0 net/ipv6/mcast.c:1992 mld_send_initial_cr.part.0+0xf6/0x230 net/ipv6/mcast.c:2239 mld_send_initial_cr net/ipv6/mcast.c:1227 [inline] mld_dad_work+0x1d3/0x690 net/ipv6/mcast.c:2265 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 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+0x2c5/0x780 mm/page_alloc.c:1397 free_unref_page_prepare mm/page_alloc.c:3332 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3411 unfreeze_partials+0x17c/0x1d0 mm/slub.c:2421 put_cpu_partial+0x13d/0x230 mm/slub.c:2457 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x8e/0xa0 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] __kmalloc+0x1f4/0x330 mm/slub.c:4111 kmalloc_array include/linux/slab.h:631 [inline] kcalloc include/linux/slab.h:660 [inline] ext4_find_extent+0xa47/0xd00 fs/ext4/extents.c:864 ext4_ext_map_blocks+0x1e2/0x6070 fs/ext4/extents.c:4061 ext4_map_blocks+0x653/0x17d0 fs/ext4/inode.c:638 ext4_getblk+0x13c/0x680 fs/ext4/inode.c:848 ext4_bread+0x2a/0x1c0 fs/ext4/inode.c:900 ext4_append+0x177/0x390 fs/ext4/namei.c:67 ext4_init_new_dir+0x33f/0x5e0 fs/ext4/namei.c:2885 ext4_mkdir+0x3cf/0xb20 fs/ext4/namei.c:2931 Memory state around the buggy address: ffff88801c6f5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801c6f6000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801c6f6080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801c6f6100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801c6f6180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================