================================================================== BUG: KASAN: slab-out-of-bounds in decode_session6+0xfd7/0x1820 net/xfrm/xfrm_policy.c:3371 Read of size 1 at addr ffff8880572d7c75 by task syz-executor.2/28742 CPU: 0 PID: 28742 Comm: syz-executor.2 Not tainted 5.16.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:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 decode_session6+0xfd7/0x1820 net/xfrm/xfrm_policy.c:3371 __xfrm_decode_session+0x50/0xb0 net/xfrm/xfrm_policy.c:3477 xfrm_decode_session include/net/xfrm.h:1155 [inline] vti6_tnl_xmit+0x41f/0x1fe0 net/ipv6/ip6_vti.c:577 __netdev_start_xmit include/linux/netdevice.h:4682 [inline] netdev_start_xmit include/linux/netdevice.h:4696 [inline] xmit_one net/core/dev.c:3473 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3489 sch_direct_xmit+0x19f/0xbe0 net/sched/sch_generic.c:342 qdisc_restart net/sched/sch_generic.c:407 [inline] __qdisc_run+0x4c0/0x1720 net/sched/sch_generic.c:415 __dev_xmit_skb net/core/dev.c:3762 [inline] __dev_queue_xmit+0x2084/0x3660 net/core/dev.c:4081 neigh_connected_output+0x3b6/0x510 net/core/neighbour.c:1551 neigh_output include/net/neighbour.h:541 [inline] ip6_finish_output2+0x56e/0x14f0 net/ipv6/ip6_output.c:126 __ip6_finish_output net/ipv6/ip6_output.c:191 [inline] __ip6_finish_output+0x61e/0xe90 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:451 [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:3898 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x67c/0xa30 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:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 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:put_cpu_partial+0x134/0x210 mm/slub.c:2611 Code: 00 00 48 c7 c6 74 53 be 81 48 89 df e8 c5 36 9e ff 4d 85 e4 75 4c 9c 58 f6 c4 02 0f 85 ae 00 00 00 4d 85 e4 74 01 fb 4d 85 ed <74> 21 5b 4c 89 ee 48 89 ef 5d 41 5c 41 5d 41 5e 41 5f e9 95 f7 ff RSP: 0018:ffffc900079278d8 EFLAGS: 00000246 RAX: 0000000000000006 RBX: ffff8880b9c404c0 RCX: 1ffffffff1b24b71 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff888010cc2dc0 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff817db708 R11: 0000000000000001 R12: 0000000000000200 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000003 do_slab_free mm/slub.c:3497 [inline] slab_free mm/slub.c:3510 [inline] kmem_cache_free+0x323/0x340 mm/slub.c:3526 anon_vma_free mm/rmap.c:132 [inline] __put_anon_vma+0x110/0x390 mm/rmap.c:2230 put_anon_vma include/linux/rmap.h:111 [inline] unlink_anon_vmas+0x56c/0x860 mm/rmap.c:437 free_pgtables+0xe2/0x2f0 mm/memory.c:412 exit_mmap+0x1df/0x630 mm/mmap.c:3171 __mmput+0x122/0x4b0 kernel/fork.c:1113 mmput+0x56/0x60 kernel/fork.c:1134 exit_mm kernel/exit.c:507 [inline] do_exit+0xb27/0x2b40 kernel/exit.c:819 do_group_exit+0x125/0x310 kernel/exit.c:929 get_signal+0x47d/0x2220 kernel/signal.c:2852 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f79f807efe9 Code: Unable to access opcode bytes at RIP 0x7f79f807efbf. RSP: 002b:00007f79f69f4218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007f79f8191f68 RCX: 00007f79f807efe9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f79f8191f68 RBP: 00007f79f8191f60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f79f8191f6c R13: 00007fff4df9861f R14: 00007f79f69f4300 R15: 0000000000022000 Allocated by task 21675: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:525 kmalloc_node include/linux/slab.h:605 [inline] kvmalloc_node+0xb4/0x120 mm/util.c:587 kvmalloc include/linux/slab.h:733 [inline] kvzalloc include/linux/slab.h:741 [inline] alloc_netdev_mqs+0x98/0x1060 net/core/dev.c:10157 rtnl_create_link+0x9d7/0xc00 net/core/rtnetlink.c:3202 __rtnl_newlink+0xf74/0x1750 net/core/rtnetlink.c:3469 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3527 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5592 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x539/0x7e0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496 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 Last potentially related work creation: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 insert_work+0x48/0x370 kernel/workqueue.c:1354 __queue_work+0x5ca/0xee0 kernel/workqueue.c:1520 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1461 [inline] __run_timers.part.0+0x4a6/0xa30 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 Second to last potentially related work creation: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 insert_work+0x48/0x370 kernel/workqueue.c:1354 __queue_work+0x5ca/0xee0 kernel/workqueue.c:1520 queue_work_on+0xee/0x110 kernel/workqueue.c:1547 queue_work include/linux/workqueue.h:502 [inline] schedule_work include/linux/workqueue.h:563 [inline] __rhashtable_remove_fast_one include/linux/rhashtable.h:1059 [inline] __rhashtable_remove_fast include/linux/rhashtable.h:1083 [inline] rhashtable_remove_fast include/linux/rhashtable.h:1112 [inline] fdb_delete+0xded/0x11a0 net/bridge/br_fdb.c:323 fdb_delete_local+0x53f/0x700 net/bridge/br_fdb.c:361 br_fdb_change_mac_address+0x4f1/0x5e0 net/bridge/br_fdb.c:508 br_stp_change_bridge_id+0xb2/0x3a0 net/bridge/br_stp_if.c:232 br_set_mac_address+0x23f/0x2c0 net/bridge/br_device.c:245 dev_set_mac_address+0x269/0x3e0 net/core/dev.c:8396 bond_enslave+0x9f7/0x53c0 drivers/net/bonding/bond_main.c:1925 do_set_master+0x1c8/0x220 net/core/rtnetlink.c:2532 do_setlink+0x9f3/0x3a10 net/core/rtnetlink.c:2736 __rtnl_newlink+0xde7/0x1750 net/core/rtnetlink.c:3412 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3527 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5592 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x539/0x7e0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496 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 ffff8880572d4000 which belongs to the cache kmalloc-cg-8k of size 8192 The buggy address is located 7285 bytes to the right of 8192-byte region [ffff8880572d4000, ffff8880572d6000) The buggy address belongs to the page: page:ffffea00015cb400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x572d0 head:ffffea00015cb400 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff88807e357041 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888010c4c3c0 raw: 0000000000000000 0000000000020002 00000001ffffffff ffff88807e357041 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 21599, ts 1602070094229, free_ts 1601976683868 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4149 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2190 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab mm/slub.c:1944 [inline] new_slab+0x28a/0x3b0 mm/slub.c:2004 ___slab_alloc+0x87c/0xe90 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] __kmalloc_node+0x2cb/0x390 mm/slub.c:4468 kmalloc_node include/linux/slab.h:605 [inline] kvmalloc_node+0xb4/0x120 mm/util.c:587 kvmalloc include/linux/slab.h:733 [inline] kvzalloc include/linux/slab.h:741 [inline] alloc_netdev_mqs+0x98/0x1060 net/core/dev.c:10157 rtnl_create_link+0x9d7/0xc00 net/core/rtnetlink.c:3202 __rtnl_newlink+0xf74/0x1750 net/core/rtnetlink.c:3469 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3527 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5592 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x539/0x7e0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1919 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+0x374/0x870 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3388 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5e/0xf0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:447 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:738 [inline] slab_alloc_node mm/slub.c:3230 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc+0x202/0x3a0 mm/slub.c:3243 getname_flags.part.0+0x50/0x4f0 fs/namei.c:138 getname_flags+0x9a/0xe0 include/linux/audit.h:323 user_path_at_empty+0x2b/0x60 fs/namei.c:2800 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0x142/0x390 fs/stat.c:221 vfs_fstatat fs/stat.c:243 [inline] __do_sys_newfstatat+0x96/0x120 fs/stat.c:412 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 Memory state around the buggy address: ffff8880572d7b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880572d7b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880572d7c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880572d7c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880572d7d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 48 c7 c6 74 53 be 81 mov $0xffffffff81be5374,%rsi 9: 48 89 df mov %rbx,%rdi c: e8 c5 36 9e ff callq 0xff9e36d6 11: 4d 85 e4 test %r12,%r12 14: 75 4c jne 0x62 16: 9c pushfq 17: 58 pop %rax 18: f6 c4 02 test $0x2,%ah 1b: 0f 85 ae 00 00 00 jne 0xcf 21: 4d 85 e4 test %r12,%r12 24: 74 01 je 0x27 26: fb sti 27: 4d 85 ed test %r13,%r13 * 2a: 74 21 je 0x4d <-- trapping instruction 2c: 5b pop %rbx 2d: 4c 89 ee mov %r13,%rsi 30: 48 89 ef mov %rbp,%rdi 33: 5d pop %rbp 34: 41 5c pop %r12 36: 41 5d pop %r13 38: 41 5e pop %r14 3a: 41 5f pop %r15 3c: e9 .byte 0xe9 3d: 95 xchg %eax,%ebp 3e: f7 ff idiv %edi