================================================================== BUG: KASAN: use-after-free in __lock_acquire+0xfe/0x6100 kernel/locking/lockdep.c:4885 Read of size 8 at addr ffff8880311f60a0 by task kworker/0:4/8698 CPU: 0 PID: 8698 Comm: kworker/0:4 Not tainted 5.14.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events l2cap_chan_timeout 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_chan_timeout+0x12c/0x280 net/bluetooth/l2cap_core.c:436 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276 worker_thread+0xac1/0x1320 kernel/workqueue.c:2422 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 8807: 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+0xc4/0xf0 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 8807: 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+0x109/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+0x1d8/0x290 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 get_signal+0x1fd9/0x2080 kernel/signal.c:2581 arch_do_signal_or_restart+0x8e/0x6d0 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x191/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 ffff8880311f6000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 160 bytes inside of 2048-byte region [ffff8880311f6000, ffff8880311f6800) The buggy address belongs to the page: page:ffffea0000c47c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880311f4000 pfn:0x311f0 head:ffffea0000c47c00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000b19a00 0000000200000002 ffff888011042000 raw: ffff8880311f4000 0000000080080004 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 0x52a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 8795, ts 1596947593189, free_ts 1596947331368 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4169 __alloc_pages+0x26c/0x5f0 mm/page_alloc.c:5391 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] slab_alloc mm/slub.c:2967 [inline] __kmalloc+0x2e7/0x390 mm/slub.c:4111 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 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 do_sys_openat2+0xba/0x460 fs/open.c:1198 do_sys_open fs/open.c:1220 [inline] __do_sys_openat fs/open.c:1236 [inline] __se_sys_openat fs/open.c:1231 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1231 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: ffff8880311f5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880311f6000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880311f6080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880311f6100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880311f6180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================