================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x34ac/0x49c0 kernel/locking/lockdep.c:3290 Read of size 8 at addr ffff888080862248 by task syz-executor.1/13063 CPU: 1 PID: 13063 Comm: syz-executor.1 Not tainted 4.19.67 #41 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 __lock_acquire+0x34ac/0x49c0 kernel/locking/lockdep.c:3290 lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:3900 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x33/0x50 kernel/locking/spinlock.c:168 spin_lock_bh include/linux/spinlock.h:334 [inline] psock_map_pop.isra.0+0x2d/0x1f0 kernel/bpf/sockmap.c:302 bpf_tcp_remove+0x481/0xa20 kernel/bpf/sockmap.c:366 bpf_tcp_close+0x130/0x390 kernel/bpf/sockmap.c:403 inet_release+0xff/0x1e0 net/ipv4/af_inet.c:428 inet6_release+0x53/0x80 net/ipv6/af_inet6.c:472 __sock_release+0xce/0x2a0 net/socket.c:579 sock_close+0x1b/0x30 net/socket.c:1140 __fput+0x2dd/0x8b0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x53d/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4134f0 Code: 01 f0 ff ff 0f 83 30 1b 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 83 3d 9d 2d 66 00 00 75 14 b8 03 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 04 1b 00 00 c3 48 83 ec 08 e8 0a fc ff ff RSP: 002b:00007ffd5e8bdc08 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000006 RCX: 00000000004134f0 RDX: 0000001b2f720000 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffffffffffff R10: 0000000000000000 R11: 0000000000000246 R12: 000000000075bf20 R13: 0000000000000003 R14: 00000000007610a8 R15: ffffffffffffffff Allocated by task 13063: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531 kmem_cache_alloc_node_trace+0x153/0x720 mm/slab.c:3668 kmalloc_node include/linux/slab.h:553 [inline] kzalloc_node include/linux/slab.h:720 [inline] smap_init_psock kernel/bpf/sockmap.c:1636 [inline] __sock_map_ctx_update_elem.isra.0+0x675/0xdc0 kernel/bpf/sockmap.c:1940 sock_hash_ctx_update_elem.isra.0+0x6c2/0x10d0 kernel/bpf/sockmap.c:2411 sock_hash_update_elem+0x246/0x4b0 kernel/bpf/sockmap.c:2495 map_update_elem+0x791/0xda0 kernel/bpf/syscall.c:821 __do_sys_bpf kernel/bpf/syscall.c:2396 [inline] __se_sys_bpf kernel/bpf/syscall.c:2367 [inline] __x64_sys_bpf+0x2ec/0x4c0 kernel/bpf/syscall.c:2367 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9183: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 smap_gc_work+0x7e5/0xab0 kernel/bpf/sockmap.c:1629 process_one_work+0x989/0x1750 kernel/workqueue.c:2153 worker_thread+0x98/0xe40 kernel/workqueue.c:2296 kthread+0x354/0x420 kernel/kthread.c:246 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 The buggy address belongs to the object at ffff888080862000 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 584 bytes inside of 1024-byte region [ffff888080862000, ffff888080862400) The buggy address belongs to the page: page:ffffea0002021880 count:1 mapcount:0 mapping:ffff88812c3f0ac0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffffea0002959088 ffffea0002249e08 ffff88812c3f0ac0 kobject: 'loop4' (0000000033b1a4eb): kobject_uevent_env raw: 0000000000000000 ffff888080862000 0000000100000007 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888080862100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb kobject: 'loop4' (0000000033b1a4eb): fill_kobj_path: path = '/devices/virtual/block/loop4' ffff888080862180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888080862200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888080862280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888080862300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================