================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3f13/0x57d0 kernel/locking/lockdep.c:4702 Read of size 8 at addr ffff88802f43c0a0 by task kworker/1:2/3532 CPU: 1 PID: 3532 Comm: kworker/1:2 Not tainted 5.11.0-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:79 [inline] dump_stack+0x9a/0xcc lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:396 [inline] kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413 __lock_acquire+0x3f13/0x57d0 kernel/locking/lockdep.c:4702 lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x720 kernel/locking/lockdep.c:5407 __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+0x34/0xf0 net/core/sock.c:3049 l2cap_sock_teardown_cb+0x90/0x590 net/bluetooth/l2cap_sock.c:1520 l2cap_chan_close+0x304/0x990 net/bluetooth/l2cap_core.c:832 l2cap_chan_timeout+0x125/0x280 net/bluetooth/l2cap_core.c:436 process_one_work+0x828/0x1390 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 Allocated by task 7671: 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:401 [inline] ____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:429 kmalloc include/linux/slab.h:557 [inline] sk_prot_alloc+0x133/0x260 net/core/sock.c:1685 sk_alloc+0x27/0x8d0 net/core/sock.c:1739 l2cap_sock_alloc.constprop.0+0x22/0x200 net/bluetooth/l2cap_sock.c:1805 l2cap_sock_create+0xc8/0x160 net/bluetooth/l2cap_sock.c:1851 bt_sock_create+0x142/0x2e0 net/bluetooth/af_bluetooth.c:130 __sock_create+0x26b/0x580 net/socket.c:1406 sock_create net/socket.c:1457 [inline] __sys_socket+0xd6/0x1a0 net/socket.c:1499 __do_sys_socket net/socket.c:1508 [inline] __se_sys_socket net/socket.c:1506 [inline] __x64_sys_socket+0x6a/0xb0 net/socket.c:1506 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 7671: 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:356 ____kasan_slab_free+0xe1/0x110 mm/kasan/common.c:362 kasan_slab_free include/linux/kasan.h:192 [inline] slab_free_hook mm/slub.c:1547 [inline] slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1580 slab_free mm/slub.c:3143 [inline] kfree+0xdb/0x3b0 mm/slub.c:4139 sk_prot_free net/core/sock.c:1722 [inline] __sk_destruct+0x53f/0x730 net/core/sock.c:1807 l2cap_sock_release+0x16b/0x1e0 net/bluetooth/l2cap_sock.c:1389 __sock_release+0xbb/0x270 net/socket.c:597 sock_close+0xf/0x20 net/socket.c:1256 __fput+0x204/0x870 fs/file_table.c:280 task_work_run+0xc0/0x160 kernel/task_work.c:140 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:174 [inline] exit_to_user_mode_prepare+0x249/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88802f43c000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 160 bytes inside of 2048-byte region [ffff88802f43c000, ffff88802f43c800) The buggy address belongs to the page: page:0000000053367472 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2f438 head:0000000053367472 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff88800f442000 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 0x152a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 7669, ts 79692578921 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x144/0x1c0 mm/page_alloc.c:2297 prep_new_page mm/page_alloc.c:2306 [inline] get_page_from_freelist+0x1c6e/0x3f80 mm/page_alloc.c:3945 __alloc_pages_nodemask+0x2d6/0x730 mm/page_alloc.c:4995 alloc_pages include/linux/gfp.h:547 [inline] alloc_slab_page mm/slub.c:1618 [inline] allocate_slab+0x2b6/0x4a0 mm/slub.c:1758 new_slab mm/slub.c:1821 [inline] new_slab_objects mm/slub.c:2578 [inline] ___slab_alloc+0x476/0x790 mm/slub.c:2741 __slab_alloc.constprop.0+0x95/0xe0 mm/slub.c:2781 slab_alloc_node mm/slub.c:2857 [inline] slab_alloc mm/slub.c:2900 [inline] __kmalloc+0x34a/0x3e0 mm/slub.c:3981 kmalloc include/linux/slab.h:557 [inline] sk_prot_alloc+0x133/0x260 net/core/sock.c:1685 sk_alloc+0x27/0x8d0 net/core/sock.c:1739 l2cap_sock_alloc.constprop.0+0x22/0x200 net/bluetooth/l2cap_sock.c:1805 l2cap_sock_create+0xc8/0x160 net/bluetooth/l2cap_sock.c:1851 bt_sock_create+0x142/0x2e0 net/bluetooth/af_bluetooth.c:130 __sock_create+0x26b/0x580 net/socket.c:1406 sock_create net/socket.c:1457 [inline] __sys_socket+0xd6/0x1a0 net/socket.c:1499 __do_sys_socket net/socket.c:1508 [inline] __se_sys_socket net/socket.c:1506 [inline] __x64_sys_socket+0x6a/0xb0 net/socket.c:1506 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1271 [inline] __free_pages_ok+0x4da/0xed0 mm/page_alloc.c:1536 unfreeze_partials+0x16c/0x1b0 mm/slub.c:2359 put_cpu_partial+0x129/0x200 mm/slub.c:2395 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165 quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 ____kasan_kmalloc.constprop.0+0x98/0xa0 mm/kasan/common.c:412 kasan_slab_alloc include/linux/kasan.h:209 [inline] slab_post_alloc_hook mm/slab.h:512 [inline] slab_alloc_node mm/slub.c:2892 [inline] slab_alloc mm/slub.c:2900 [inline] kmem_cache_alloc+0x1c6/0x440 mm/slub.c:2905 create_nsproxy kernel/nsproxy.c:56 [inline] create_new_namespaces+0x2b/0x920 kernel/nsproxy.c:74 prepare_nsset kernel/nsproxy.c:316 [inline] __do_sys_setns+0x1e7/0x1190 kernel/nsproxy.c:551 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Memory state around the buggy address: ffff88802f43bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802f43c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802f43c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802f43c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802f43c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================