================================================================== BUG: KASAN: use-after-free in lockdep_register_key+0x356/0x3e0 kernel/locking/lockdep.c:1182 Read of size 8 at addr ffff88802aa112d8 by task syz-executor.3/13857 CPU: 0 PID: 13857 Comm: syz-executor.3 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:00007f35a23b3c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000001a00 RCX: 000000000045deb9 RDX: 0000000000000040 RSI: 0000000020000040 RDI: 0000000000000000 RBP: 000000000118c008 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bfd4 R13: 00007ffea34f30af R14: 00007f35a23b49c0 R15: 000000000118bfd4 Allocated by task 13435: 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] pskb_expand_head+0x15a/0x1040 net/core/skbuff.c:1622 __skb_cow include/linux/skbuff.h:3165 [inline] skb_cow_head include/linux/skbuff.h:3199 [inline] ip_tunnel_xmit+0xede/0x2b00 net/ipv4/ip_tunnel.c:803 ipgre_xmit+0x679/0x830 net/ipv4/ip_gre.c:648 __netdev_start_xmit include/linux/netdevice.h:4718 [inline] netdev_start_xmit include/linux/netdevice.h:4732 [inline] xmit_one net/core/dev.c:3562 [inline] dev_hard_start_xmit+0x188/0x880 net/core/dev.c:3578 __dev_queue_xmit+0x2062/0x2d30 net/core/dev.c:4137 __bpf_tx_skb net/core/filter.c:2116 [inline] __bpf_redirect_no_mac net/core/filter.c:2141 [inline] __bpf_redirect+0x52e/0xc60 net/core/filter.c:2164 ____bpf_clone_redirect net/core/filter.c:2448 [inline] bpf_clone_redirect+0x2ae/0x420 net/core/filter.c:2420 0xffffffffa0058912 bpf_dispatcher_nop_func include/linux/bpf.h:644 [inline] bpf_test_run+0x3be/0xcf0 net/bpf/test_run.c:50 bpf_prog_test_run_skb+0xabc/0x1c50 net/bpf/test_run.c:581 bpf_prog_test_run kernel/bpf/syscall.c:3125 [inline] __do_sys_bpf+0x1b29/0x5180 kernel/bpf/syscall.c:4417 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 13435: 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 net/core/skbuff.c:678 [inline] kfree_skb net/core/skbuff.c:696 [inline] kfree_skb+0x133/0x3f0 net/core/skbuff.c:690 kfree_skb_list+0x3f/0x60 net/core/skbuff.c:705 __dev_xmit_skb net/core/dev.c:3807 [inline] __dev_queue_xmit+0x14a4/0x2d30 net/core/dev.c:4106 neigh_connected_output+0x380/0x4c0 net/core/neighbour.c:1518 neigh_output include/net/neighbour.h:509 [inline] ip_finish_output2+0x81c/0x2120 net/ipv4/ip_output.c:230 __ip_finish_output net/ipv4/ip_output.c:308 [inline] __ip_finish_output+0x7cf/0xd10 net/ipv4/ip_output.c:290 ip_finish_output+0x34/0x1f0 net/ipv4/ip_output.c:318 NF_HOOK_COND include/linux/netfilter.h:290 [inline] ip_output+0x196/0x310 net/ipv4/ip_output.c:432 dst_output include/net/dst.h:443 [inline] ip_local_out+0xaf/0x1a0 net/ipv4/ip_output.c:126 iptunnel_xmit+0x5a3/0x9c0 net/ipv4/ip_tunnel_core.c:82 ip_tunnel_xmit+0x1b78/0x2b00 net/ipv4/ip_tunnel.c:810 ipgre_xmit+0x679/0x830 net/ipv4/ip_gre.c:648 __netdev_start_xmit include/linux/netdevice.h:4718 [inline] netdev_start_xmit include/linux/netdevice.h:4732 [inline] xmit_one net/core/dev.c:3562 [inline] dev_hard_start_xmit+0x188/0x880 net/core/dev.c:3578 __dev_queue_xmit+0x2062/0x2d30 net/core/dev.c:4137 __bpf_tx_skb net/core/filter.c:2116 [inline] __bpf_redirect_no_mac net/core/filter.c:2141 [inline] __bpf_redirect+0x52e/0xc60 net/core/filter.c:2164 ____bpf_clone_redirect net/core/filter.c:2448 [inline] bpf_clone_redirect+0x2ae/0x420 net/core/filter.c:2420 0xffffffffa0058912 bpf_dispatcher_nop_func include/linux/bpf.h:644 [inline] bpf_test_run+0x3be/0xcf0 net/bpf/test_run.c:50 bpf_prog_test_run_skb+0xabc/0x1c50 net/bpf/test_run.c:581 bpf_prog_test_run kernel/bpf/syscall.c:3125 [inline] __do_sys_bpf+0x1b29/0x5180 kernel/bpf/syscall.c:4417 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Last call_rcu(): kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_record_aux_stack+0xc0/0xf0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2953 [inline] call_rcu+0xbb/0x700 kernel/rcu/tree.c:3027 __bpf_prog_put_noref kernel/bpf/syscall.c:1740 [inline] __bpf_prog_put_noref+0x107/0x1a0 kernel/bpf/syscall.c:1730 __bpf_prog_put.constprop.0+0x162/0x1a0 kernel/bpf/syscall.c:1753 bpf_prog_put kernel/bpf/syscall.c:1759 [inline] bpf_prog_release+0x33/0x40 kernel/bpf/syscall.c:1767 __fput+0x285/0x920 fs/file_table.c:281 task_work_run+0xdd/0x190 kernel/task_work.c:151 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:164 [inline] exit_to_user_mode_prepare+0x17e/0x1a0 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x38/0x260 kernel/entry/common.c:266 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88802aa11000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 728 bytes inside of 1024-byte region [ffff88802aa11000, ffff88802aa11400) The buggy address belongs to the page: page:00000000b8d06acd refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2aa10 head:00000000b8d06acd 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: ffff88802aa11180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802aa11200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802aa11280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802aa11300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802aa11380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================