================================================================== BUG: KASAN: slab-out-of-bounds in decode_session6+0xe6d/0x1530 net/xfrm/xfrm_policy.c:3371 Read of size 1 at addr ffff888019c55831 by task syz-executor.0/12262 CPU: 1 PID: 12262 Comm: syz-executor.0 Not tainted 5.15.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x6c/0x2d6 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 decode_session6+0xe6d/0x1530 net/xfrm/xfrm_policy.c:3371 __xfrm_decode_session+0x50/0xb0 net/xfrm/xfrm_policy.c:3458 xfrm_decode_session include/net/xfrm.h:1149 [inline] vti6_tnl_xmit+0x41f/0x1fe0 net/ipv6/ip6_vti.c:577 __netdev_start_xmit include/linux/netdevice.h:4988 [inline] netdev_start_xmit include/linux/netdevice.h:5002 [inline] xmit_one net/core/dev.c:3576 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3592 sch_direct_xmit+0x19f/0xbc0 net/sched/sch_generic.c:342 qdisc_restart net/sched/sch_generic.c:407 [inline] __qdisc_run+0x4bc/0x1700 net/sched/sch_generic.c:415 __dev_xmit_skb net/core/dev.c:3861 [inline] __dev_queue_xmit+0x1f9c/0x36e0 net/core/dev.c:4170 neigh_connected_output+0x3b6/0x510 net/core/neighbour.c:1521 neigh_output include/net/neighbour.h:510 [inline] ip6_finish_output2+0x717/0x1500 net/ipv6/ip6_output.c:126 __ip6_finish_output net/ipv6/ip6_output.c:191 [inline] __ip6_finish_output+0x4c1/0x1050 net/ipv6/ip6_output.c:170 ip6_finish_output+0x32/0x200 net/ipv6/ip6_output.c:201 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x1e4/0x530 net/ipv6/ip6_output.c:224 dst_output include/net/dst.h:450 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] ndisc_send_skb+0xa99/0x17f0 net/ipv6/ndisc.c:508 ndisc_send_rs+0x12e/0x6f0 net/ipv6/ndisc.c:702 addrconf_rs_timer+0x3f2/0x820 net/ipv6/addrconf.c:3893 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x675/0xa20 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:636 irq_exit_rcu+0x5/0x20 kernel/softirq.c:648 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:check_preemption_disabled+0x31/0x170 lib/smp_processor_id.c:16 Code: 41 54 55 48 89 fd 53 0f 1f 44 00 00 65 44 8b 25 cd 24 cb 76 65 8b 1d 5e 7f cb 76 81 e3 ff ff ff 7f 31 ff 89 de 0f 1f 44 00 00 <85> db 74 11 0f 1f 44 00 00 44 89 e0 5b 5d 41 5c 41 5d 41 5e c3 0f RSP: 0018:ffffc9000519f398 EFLAGS: 00000246 RAX: 0000000000000001 RBX: 0000000000000002 RCX: ffffffff8161c024 RDX: 0000000000000001 RSI: 0000000000000002 RDI: 0000000000000000 RBP: ffffffff89e3a620 R08: 0000000000000000 R09: ffff8880b9d32a8b R10: ffffed10173a6551 R11: 0000000000000001 R12: 0000000000000001 R13: ffffffff89e3a5e0 R14: ffffffff8b97f0a0 R15: 0000000000000000 rcu_lockdep_current_cpu_online kernel/rcu/tree.c:1169 [inline] rcu_lockdep_current_cpu_online+0x2d/0x150 kernel/rcu/tree.c:1160 rcu_read_lock_held_common kernel/rcu/update.c:112 [inline] rcu_read_lock_held_common kernel/rcu/update.c:102 [inline] rcu_read_lock_sched_held+0x25/0x70 kernel/rcu/update.c:123 trace_lock_acquire include/trace/events/lock.h:13 [inline] lock_acquire+0x442/0x510 kernel/locking/lockdep.c:5596 rcu_lock_acquire include/linux/rcupdate.h:267 [inline] rcu_read_lock include/linux/rcupdate.h:687 [inline] ovs_ct_limit_get_zone_limit net/openvswitch/conntrack.c:2081 [inline] ovs_ct_limit_cmd_get+0x4c3/0x10b0 net/openvswitch/conntrack.c:2218 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:731 genl_family_rcv_msg net/netlink/genetlink.c:775 [inline] genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:792 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2510 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1935 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2409 ___sys_sendmsg+0xf3/0x170 net/socket.c:2463 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2492 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f9516f17a39 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f951448d188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f951701af60 RCX: 00007f9516f17a39 RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000004 RBP: 00007f9516f71c5f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffddfd7cb3f R14: 00007f951448d300 R15: 0000000000022000 Allocated by task 6553: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x80/0xa0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc mm/slab.c:3323 [inline] kmem_cache_alloc+0x25f/0x540 mm/slab.c:3507 kmem_cache_zalloc include/linux/slab.h:711 [inline] __kernfs_new_node+0xd4/0x8b0 fs/kernfs/dir.c:585 kernfs_new_node+0x93/0x120 fs/kernfs/dir.c:647 __kernfs_create_file+0x51/0x350 fs/kernfs/file.c:985 sysfs_add_file_mode_ns+0x226/0x540 fs/sysfs/file.c:317 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x328/0xb20 fs/sysfs/group.c:149 internal_create_groups.part.0+0x90/0x140 fs/sysfs/group.c:189 internal_create_groups fs/sysfs/group.c:185 [inline] sysfs_create_groups+0x25/0x50 fs/sysfs/group.c:215 device_add_groups drivers/base/core.c:2475 [inline] device_add_attrs drivers/base/core.c:2623 [inline] device_add+0x81f/0x1ee0 drivers/base/core.c:3347 netdev_register_kobject+0x181/0x430 net/core/net-sysfs.c:1955 register_netdevice+0xd33/0x1500 net/core/dev.c:10299 veth_newlink+0x3f5/0xb20 drivers/net/veth.c:1695 __rtnl_newlink+0x106d/0x1750 net/core/rtnetlink.c:3458 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3506 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5572 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2510 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1935 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 __sys_sendto+0x21c/0x320 net/socket.c:2036 __do_sys_sendto net/socket.c:2048 [inline] __se_sys_sendto net/socket.c:2044 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2044 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888019c55780 which belongs to the cache kernfs_node_cache of size 168 The buggy address is located 9 bytes to the right of 168-byte region [ffff888019c55780, ffff888019c55828) The buggy address belongs to the page: page:ffffea0000671540 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x19c55 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001c24a88 ffffea0001a00c88 ffff8881400a2300 raw: 0000000000000000 ffff888019c55040 0000000100000011 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 6541, ts 186629559874, free_ts 186576065199 prep_new_page mm/page_alloc.c:2424 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4153 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5375 __alloc_pages_node include/linux/gfp.h:570 [inline] kmem_getpages mm/slab.c:1377 [inline] cache_grow_begin+0x75/0x460 mm/slab.c:2593 cache_alloc_refill+0x27f/0x380 mm/slab.c:2965 ____cache_alloc mm/slab.c:3048 [inline] ____cache_alloc mm/slab.c:3031 [inline] __do_cache_alloc mm/slab.c:3275 [inline] slab_alloc mm/slab.c:3316 [inline] kmem_cache_alloc+0x454/0x540 mm/slab.c:3507 kmem_cache_zalloc include/linux/slab.h:711 [inline] __kernfs_new_node+0xd4/0x8b0 fs/kernfs/dir.c:585 kernfs_new_node+0x93/0x120 fs/kernfs/dir.c:647 __kernfs_create_file+0x51/0x350 fs/kernfs/file.c:985 sysfs_add_file_mode_ns+0x226/0x540 fs/sysfs/file.c:317 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x328/0xb20 fs/sysfs/group.c:149 netdev_queue_add_kobject net/core/net-sysfs.c:1616 [inline] netdev_queue_update_kobjects+0x353/0x460 net/core/net-sysfs.c:1655 register_queue_kobjects net/core/net-sysfs.c:1716 [inline] netdev_register_kobject+0x35a/0x430 net/core/net-sysfs.c:1959 register_netdevice+0xd33/0x1500 net/core/dev.c:10299 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:317 [inline] nsim_create+0x3ce/0x530 drivers/net/netdevsim/netdev.c:365 __nsim_dev_port_add+0x32e/0x830 drivers/net/netdevsim/dev.c:1312 nsim_dev_port_add_all+0x53/0x150 drivers/net/netdevsim/dev.c:1372 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3315 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3394 slab_destroy mm/slab.c:1627 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1647 cache_flusharray mm/slab.c:3418 [inline] ___cache_free+0x4c6/0x610 mm/slab.c:3480 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x4e/0x110 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x92/0xa0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc mm/slab.c:3323 [inline] kmem_cache_alloc+0x25f/0x540 mm/slab.c:3507 kmem_cache_zalloc include/linux/slab.h:711 [inline] __kernfs_new_node+0xd4/0x8b0 fs/kernfs/dir.c:585 kernfs_new_node fs/kernfs/dir.c:647 [inline] kernfs_create_dir_ns+0x9c/0x220 fs/kernfs/dir.c:984 sysfs_create_dir_ns+0x128/0x290 fs/sysfs/dir.c:59 create_dir lib/kobject.c:89 [inline] kobject_add_internal+0x2d2/0xa60 lib/kobject.c:255 kobject_add_varg lib/kobject.c:390 [inline] kobject_init_and_add+0x101/0x160 lib/kobject.c:473 netdev_queue_add_kobject net/core/net-sysfs.c:1610 [inline] netdev_queue_update_kobjects+0x1a2/0x460 net/core/net-sysfs.c:1655 register_queue_kobjects net/core/net-sysfs.c:1716 [inline] netdev_register_kobject+0x35a/0x430 net/core/net-sysfs.c:1959 register_netdevice+0xd33/0x1500 net/core/dev.c:10299 Memory state around the buggy address: ffff888019c55700: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff888019c55780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888019c55800: 00 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 00 ^ ffff888019c55880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888019c55900: 00 00 fc fc fc fc fc fc fc fc 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 41 54 push %r12 2: 55 push %rbp 3: 48 89 fd mov %rdi,%rbp 6: 53 push %rbx 7: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) c: 65 44 8b 25 cd 24 cb mov %gs:0x76cb24cd(%rip),%r12d # 0x76cb24e1 13: 76 14: 65 8b 1d 5e 7f cb 76 mov %gs:0x76cb7f5e(%rip),%ebx # 0x76cb7f79 1b: 81 e3 ff ff ff 7f and $0x7fffffff,%ebx 21: 31 ff xor %edi,%edi 23: 89 de mov %ebx,%esi 25: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) * 2a: 85 db test %ebx,%ebx <-- trapping instruction 2c: 74 11 je 0x3f 2e: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 33: 44 89 e0 mov %r12d,%eax 36: 5b pop %rbx 37: 5d pop %rbp 38: 41 5c pop %r12 3a: 41 5d pop %r13 3c: 41 5e pop %r14 3e: c3 retq 3f: 0f .byte 0xf