================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x2cb4/0x3ff0 kernel/locking/lockdep.c:3295 Read of size 8 at addr ffff8880b527bb38 by task syz-executor.2/12568 CPU: 1 PID: 12568 Comm: syz-executor.2 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433 __lock_acquire+0x2cb4/0x3ff0 kernel/locking/lockdep.c:3295 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:168 bpf_tcp_remove+0x427/0xa00 kernel/bpf/sockmap.c:335 bpf_tcp_close+0x12b/0x390 kernel/bpf/sockmap.c:403 inet_release+0xd7/0x1e0 net/ipv4/af_inet.c:427 __sock_release+0xcd/0x2a0 net/socket.c:599 sock_close+0x15/0x20 net/socket.c:1214 __fput+0x2ce/0x890 fs/file_table.c:278 task_work_run+0x148/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xbf3/0x2be0 kernel/exit.c:870 do_group_exit+0x125/0x310 kernel/exit.c:967 get_signal+0x3f2/0x1f70 kernel/signal.c:2589 do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:799 exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath+0x3f0/0x4a0 arch/x86/entry/common.c:271 ret_from_fork+0x15/0x30 arch/x86/entry/entry_64.S:407 RIP: 0033:0x7fbaf91924f1 Code: Bad RIP value. RSP: 002b:00007fbaf75b92f0 EFLAGS: 00000206 ORIG_RAX: 0000000000000038 RAX: 0000000000000000 RBX: 00007fbaf75b9700 RCX: 00007fbaf91924f1 RDX: 00007fbaf75b99d0 RSI: 00007fbaf75b92f0 RDI: 00000000003d0f00 RBP: 00007fff389608d0 R08: 00007fbaf75b9700 R09: 00007fbaf75b9700 R10: 00007fbaf75b99d0 R11: 0000000000000206 R12: 00007fff3896073e R13: 00007fff3896073f R14: 00007fbaf75b9300 R15: 0000000000022000 Allocated by task 12545: kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] sock_map_alloc kernel/bpf/sockmap.c:1675 [inline] sock_map_alloc+0x2b8/0x510 kernel/bpf/sockmap.c:1657 find_and_alloc_map kernel/bpf/syscall.c:130 [inline] map_create kernel/bpf/syscall.c:510 [inline] __do_sys_bpf kernel/bpf/syscall.c:2408 [inline] __se_sys_bpf+0x82a/0x3a20 kernel/bpf/syscall.c:2384 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 6155: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 process_one_work+0x864/0x1570 kernel/workqueue.c:2153 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 The buggy address belongs to the object at ffff8880b527ba00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 312 bytes inside of 512-byte region [ffff8880b527ba00, ffff8880b527bc00) The buggy address belongs to the page: page:ffffea0002d49ec0 count:1 mapcount:0 mapping:ffff88813bff0940 index:0x0 flags: 0xfff00000000100(slab) raw: 00fff00000000100 ffffea00025ecf88 ffffea0002d45a08 ffff88813bff0940 raw: 0000000000000000 ffff8880b527b000 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880b527ba00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880b527ba80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880b527bb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880b527bb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880b527bc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================