================================================================== BUG: KASAN: use-after-free in lockdep_register_key+0x356/0x3e0 kernel/locking/lockdep.c:1182 Read of size 8 at addr ffff888018896ad8 by task syz-executor.4/23539 CPU: 1 PID: 23539 Comm: syz-executor.4 Not tainted 5.9.0-syzkaller #0 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+0x107/0x163 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x4c8 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562 lockdep_register_key+0x356/0x3e0 kernel/locking/lockdep.c:1182 htab_init_buckets kernel/bpf/hashtab.c:144 [inline] htab_map_alloc+0x6c5/0x14a0 kernel/bpf/hashtab.c:521 find_and_alloc_map kernel/bpf/syscall.c:122 [inline] map_create kernel/bpf/syscall.c:825 [inline] __do_sys_bpf+0xa80/0x5180 kernel/bpf/syscall.c:4381 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45deb9 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f8216b40c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000001a00 RCX: 000000000045deb9 RDX: 0000000000000040 RSI: 0000000020000480 RDI: 0000000000000000 RBP: 000000000118c158 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118c124 R13: 00007ffe88e3a30f R14: 00007f8216b419c0 R15: 000000000118c124 Allocated by task 8504: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461 slab_post_alloc_hook mm/slab.h:526 [inline] slab_alloc_node mm/slub.c:2891 [inline] __kmalloc_node_track_caller+0x1eb/0x410 mm/slub.c:4495 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xae/0x550 net/core/skbuff.c:210 alloc_skb_fclone include/linux/skbuff.h:1144 [inline] sk_stream_alloc_skb+0x109/0xc30 net/ipv4/tcp.c:886 tcp_sendmsg_locked+0xbb7/0x2d20 net/ipv4/tcp.c:1293 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1442 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:817 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:671 sock_write_iter+0x289/0x3c0 net/socket.c:998 call_write_iter include/linux/fs.h:1887 [inline] new_sync_write+0x426/0x650 fs/read_write.c:518 vfs_write+0x57d/0x700 fs/read_write.c:605 ksys_write+0x1ee/0x250 fs/read_write.c:658 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 4888: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0x102/0x140 mm/kasan/common.c:422 slab_free_hook mm/slub.c:1544 [inline] slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1577 slab_free mm/slub.c:3142 [inline] kfree+0xdb/0x360 mm/slub.c:4124 skb_free_head net/core/skbuff.c:590 [inline] skb_release_data+0x6d9/0x910 net/core/skbuff.c:610 skb_release_all net/core/skbuff.c:664 [inline] __kfree_skb+0x46/0x60 net/core/skbuff.c:678 sk_wmem_free_skb include/net/sock.h:1537 [inline] tcp_rtx_queue_unlink_and_free include/net/tcp.h:1852 [inline] tcp_clean_rtx_queue net/ipv4/tcp_input.c:3252 [inline] tcp_ack+0x1c06/0x5960 net/ipv4/tcp_input.c:3796 tcp_rcv_established+0x130e/0x1eb0 net/ipv4/tcp_input.c:5782 tcp_v4_do_rcv+0x5d1/0x870 net/ipv4/tcp_ipv4.c:1652 tcp_v4_rcv+0x2d10/0x3750 net/ipv4/tcp_ipv4.c:2034 ip_protocol_deliver_rcu+0x5c/0x8a0 net/ipv4/ip_input.c:204 ip_local_deliver_finish+0x20a/0x370 net/ipv4/ip_input.c:231 NF_HOOK include/linux/netfilter.h:301 [inline] NF_HOOK include/linux/netfilter.h:295 [inline] ip_local_deliver+0x1b3/0x200 net/ipv4/ip_input.c:252 dst_input include/net/dst.h:449 [inline] ip_sublist_rcv_finish+0x9a/0x2c0 net/ipv4/ip_input.c:550 ip_list_rcv_finish.constprop.0+0x514/0x6e0 net/ipv4/ip_input.c:600 ip_sublist_rcv net/ipv4/ip_input.c:608 [inline] ip_list_rcv+0x34e/0x490 net/ipv4/ip_input.c:643 __netif_receive_skb_list_ptype net/core/dev.c:5354 [inline] __netif_receive_skb_list_core+0x549/0x8e0 net/core/dev.c:5402 __netif_receive_skb_list net/core/dev.c:5454 [inline] netif_receive_skb_list_internal+0x777/0xd70 net/core/dev.c:5564 gro_normal_list net/core/dev.c:5718 [inline] gro_normal_list net/core/dev.c:5714 [inline] napi_complete_done+0x1f1/0x830 net/core/dev.c:6443 virtqueue_napi_complete+0x2c/0xc0 drivers/net/virtio_net.c:334 virtnet_poll+0xae2/0xd90 drivers/net/virtio_net.c:1460 napi_poll net/core/dev.c:6759 [inline] net_rx_action+0x4dc/0x1100 net/core/dev.c:6829 __do_softirq+0x2a0/0x9f6 kernel/softirq.c:298 The buggy address belongs to the object at ffff888018896800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 728 bytes inside of 1024-byte region [ffff888018896800, ffff888018896c00) The buggy address belongs to the page: page:0000000059a1c878 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x18890 head:0000000059a1c878 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010041140 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888018896980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888018896a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888018896a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888018896b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888018896b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================