================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3455/0x4950 kernel/locking/lockdep.c:3314 Read of size 8 at addr ffff8800731de708 by task syz-executor.3/14022 CPU: 1 PID: 14022 Comm: syz-executor.3 Not tainted 4.18.0+ #1 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+0x109/0x15a lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x2fe mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 __lock_acquire+0x3455/0x4950 kernel/locking/lockdep.c:3314 lock_acquire+0x173/0x400 kernel/locking/lockdep.c:3924 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:168 spin_lock_bh include/linux/spinlock.h:334 [inline] psock_map_pop.isra.26+0x1f/0x1b0 kernel/bpf/sockmap.c:297 bpf_tcp_close+0x49c/0xbc0 kernel/bpf/sockmap.c:374 inet_release+0xd9/0x1c0 net/ipv4/af_inet.c:428 inet6_release+0x46/0x60 net/ipv6/af_inet6.c:457 __sock_release+0xc2/0x230 net/socket.c:579 sock_close+0x10/0x20 net/socket.c:1139 __fput+0x264/0x790 fs/file_table.c:251 ____fput+0x9/0x10 fs/file_table.c:282 task_work_run+0x108/0x180 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x1a9/0x200 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x407/0x4d0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x412f61 Code: 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 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007ffc27122fa0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000006 RCX: 0000000000412f61 RDX: 0000000000000000 RSI: 0000000000000081 RDI: 0000000000000005 RBP: 0000000000000000 R08: 0000000000761170 R09: ffffffffffffffff R10: 00007ffc27123070 R11: 0000000000000293 R12: 0000000000761178 R13: 0000000000000005 R14: 0000000000000000 R15: 000000000075bf2c Allocated by task 14038: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_node_trace+0x14c/0x770 mm/slab.c:3663 kmalloc_node include/linux/slab.h:551 [inline] kzalloc_node include/linux/slab.h:718 [inline] smap_init_psock kernel/bpf/sockmap.c:1601 [inline] __sock_map_ctx_update_elem.isra.20+0x544/0xd30 kernel/bpf/sockmap.c:1896 sock_map_ctx_update_elem.isra.21+0x134/0x340 kernel/bpf/sockmap.c:1983 sock_map_update_elem+0x199/0x3a0 kernel/bpf/sockmap.c:2086 map_update_elem+0x546/0xaa0 kernel/bpf/syscall.c:799 __do_sys_bpf kernel/bpf/syscall.c:2363 [inline] __se_sys_bpf kernel/bpf/syscall.c:2334 [inline] __x64_sys_bpf+0x208/0x380 kernel/bpf/syscall.c:2334 do_syscall_64+0xd0/0x4d0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8651: save_stack+0x43/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:3498 [inline] kfree+0xcf/0x270 mm/slab.c:3813 smap_gc_work+0x76b/0xa80 kernel/bpf/sockmap.c:1594 process_one_work+0x830/0x1650 kernel/workqueue.c:2153 worker_thread+0x85/0xb60 kernel/workqueue.c:2296 kthread+0x324/0x3e0 kernel/kthread.c:246 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:413 The buggy address belongs to the object at ffff8800731de4c0 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 584 bytes inside of 1024-byte region [ffff8800731de4c0, ffff8800731de8c0) The buggy address belongs to the page: page:ffffea0001cc7780 count:1 mapcount:0 mapping:ffff8800aa800ac0 index:0xffff8800731df6c0 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffffea00022a4b88 ffffea000286a088 ffff8800aa800ac0 raw: ffff8800731df6c0 ffff8800731de040 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8800731de600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8800731de680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8800731de700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8800731de780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8800731de800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================