================================================================== BUG: KASAN: use-after-free in lockdep_register_key+0x356/0x3e0 kernel/locking/lockdep.c:1182 Read of size 8 at addr ffff888028384ad8 by task syz-executor.1/13021 CPU: 1 PID: 13021 Comm: syz-executor.1 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:00007fdc18794c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000001a00 RCX: 000000000045deb9 RDX: 000000000000002c RSI: 0000000020000340 RDI: 0000000000000000 RBP: 000000000118bf60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c R13: 00007ffc87ee252f R14: 00007fdc187959c0 R15: 000000000118bf2c Allocated by task 12621: 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 include/linux/skbuff.h:1094 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1176 [inline] netlink_sendmsg+0x94f/0xd90 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:671 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2353 ___sys_sendmsg+0xf3/0x170 net/socket.c:2407 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2440 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 1: 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] consume_skb net/core/skbuff.c:834 [inline] consume_skb+0xc2/0x160 net/core/skbuff.c:828 skb_free_datagram+0x16/0xf0 net/core/datagram.c:325 netlink_recvmsg+0x61e/0xee0 net/netlink/af_netlink.c:1998 sock_recvmsg_nosec net/socket.c:885 [inline] sock_recvmsg net/socket.c:903 [inline] sock_recvmsg net/socket.c:899 [inline] ____sys_recvmsg+0x2c4/0x5f0 net/socket.c:2576 ___sys_recvmsg+0x127/0x200 net/socket.c:2618 __sys_recvmsg+0xe2/0x1a0 net/socket.c:2654 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 in6_dev_finish_destroy+0x143/0x1b0 net/ipv6/addrconf_core.c:264 in6_dev_put include/net/addrconf.h:379 [inline] addrconf_ifdown.isra.0+0x12af/0x1590 net/ipv6/addrconf.c:3848 addrconf_notify+0x55c/0x23f0 net/ipv6/addrconf.c:3627 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2034 call_netdevice_notifiers_extack net/core/dev.c:2046 [inline] call_netdevice_notifiers net/core/dev.c:2060 [inline] rollback_registered_many+0x92e/0x14c0 net/core/dev.c:9418 rollback_registered net/core/dev.c:9463 [inline] unregister_netdevice_queue+0x2dd/0x570 net/core/dev.c:10603 unregister_netdevice include/linux/netdevice.h:2824 [inline] __tun_detach+0x105a/0x13d0 drivers/net/tun.c:673 tun_detach drivers/net/tun.c:690 [inline] tun_chr_close+0xd9/0x180 drivers/net/tun.c:3390 __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 Second to 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 sctp_transport_destroy net/sctp/transport.c:167 [inline] sctp_transport_put+0x11d/0x180 net/sctp/transport.c:326 sctp_association_free+0x4d4/0x7d0 net/sctp/associola.c:379 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:930 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1318 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1185 [inline] sctp_do_sm+0x38b3/0x5120 net/sctp/sm_sideeffect.c:1156 sctp_primitive_SHUTDOWN+0x9b/0xc0 net/sctp/primitive.c:89 sctp_close+0x3e8/0x8f0 net/sctp/socket.c:1511 inet_release+0x12e/0x280 net/ipv4/af_inet.c:431 inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:475 __sock_release+0xcd/0x280 net/socket.c:596 sock_close+0x18/0x20 net/socket.c:1277 __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 ffff888028384800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 728 bytes inside of 1024-byte region [ffff888028384800, ffff888028384c00) The buggy address belongs to the page: page:0000000081719d23 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888028384800 pfn:0x28380 head:0000000081719d23 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 ffffea00018a6800 0000000200000002 ffff888010041140 raw: ffff888028384800 000000008010000f 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888028384980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888028384a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888028384a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888028384b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888028384b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================