================================================================== BUG: KASAN: use-after-free in __list_splice include/linux/list.h:440 [inline] BUG: KASAN: use-after-free in list_splice_init include/linux/list.h:482 [inline] BUG: KASAN: use-after-free in net_rx_action+0x9f4/0xb40 net/core/dev.c:7158 Write of size 8 at addr ffff88807deba620 by task syz-executor.1/11309 CPU: 1 PID: 11309 Comm: syz-executor.1 Not tainted 5.15.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+0x6c/0x309 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 __list_splice include/linux/list.h:440 [inline] list_splice_init include/linux/list.h:482 [inline] net_rx_action+0x9f4/0xb40 net/core/dev.c:7158 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 do_softirq.part.0+0xde/0x130 kernel/softirq.c:459 do_softirq kernel/softirq.c:451 [inline] __local_bh_enable_ip+0x102/0x120 kernel/softirq.c:383 local_bh_enable include/linux/bottom_half.h:32 [inline] fpregs_unlock arch/x86/include/asm/fpu/api.h:80 [inline] copy_fpstate_to_sigframe+0x316/0xae0 arch/x86/kernel/fpu/signal.c:233 get_sigframe.constprop.0.isra.0+0x433/0x5e0 arch/x86/kernel/signal.c:296 __setup_rt_frame arch/x86/kernel/signal.c:471 [inline] setup_rt_frame arch/x86/kernel/signal.c:781 [inline] handle_signal arch/x86/kernel/signal.c:825 [inline] arch_do_signal_or_restart+0xd8e/0x1c40 arch/x86/kernel/signal.c:870 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 irqentry_exit_to_user_mode+0x5/0x40 kernel/entry/common.c:313 exc_page_fault+0xc6/0x180 arch/x86/mm/fault.c:1544 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0033:0xe Code: Unable to access opcode bytes at RIP 0xffffffffffffffe4. RSP: 002b:00007f94a5bf8190 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007f94a8795f60 RCX: 00007f94a8682ae9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 03000000a0160101 RBP: 00007f94a86dcf25 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f94a8cc9b2f R14: 00007f94a5bf8300 R15: 0000000000022000 Allocated by task 11259: 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_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa4/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0x110/0x290 net/core/sock.c:1920 sk_alloc+0x30/0xa60 net/core/sock.c:1973 tun_chr_open+0x7b/0x540 drivers/net/tun.c:3361 misc_open+0x372/0x4a0 drivers/char/misc.c:141 chrdev_open+0x266/0x770 fs/char_dev.c:414 do_dentry_open+0x4c8/0x11d0 fs/open.c:822 do_open fs/namei.c:3426 [inline] path_openat+0x1c9a/0x2740 fs/namei.c:3559 do_filp_open+0x1aa/0x400 fs/namei.c:3586 do_sys_openat2+0x16d/0x4d0 fs/open.c:1200 do_sys_open fs/open.c:1216 [inline] __do_sys_openat fs/open.c:1232 [inline] __se_sys_openat fs/open.c:1227 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1227 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 Freed by task 11299: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xff/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1700 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1726 slab_free mm/slub.c:3492 [inline] kfree+0xf3/0x550 mm/slub.c:4552 sk_prot_free net/core/sock.c:1956 [inline] __sk_destruct+0x6a8/0x900 net/core/sock.c:2042 sk_destruct+0xbd/0xe0 net/core/sock.c:2057 __sk_free+0xef/0x3d0 net/core/sock.c:2068 sk_free+0x78/0xa0 net/core/sock.c:2079 sock_put include/net/sock.h:1878 [inline] __tun_detach+0xdb2/0x13d0 drivers/net/tun.c:675 tun_detach drivers/net/tun.c:687 [inline] tun_chr_close+0xc4/0x180 drivers/net/tun.c:3397 __fput+0x286/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/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 The buggy address belongs to the object at ffff88807deba000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1568 bytes inside of 4096-byte region [ffff88807deba000, ffff88807debb000) The buggy address belongs to the page: page:ffffea0001f7ae00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7deb8 head:ffffea0001f7ae00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010c42140 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2941, ts 181438436254, free_ts 180980089561 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4155 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5381 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2191 alloc_slab_page mm/slub.c:1770 [inline] allocate_slab mm/slub.c:1907 [inline] new_slab+0x319/0x490 mm/slub.c:1970 ___slab_alloc+0x921/0xfe0 mm/slub.c:3001 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3088 slab_alloc_node mm/slub.c:3179 [inline] slab_alloc mm/slub.c:3221 [inline] __kmalloc+0x303/0x320 mm/slub.c:4396 kmalloc include/linux/slab.h:596 [inline] tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x272/0x380 security/tomoyo/file.c:771 tomoyo_file_open security/tomoyo/tomoyo.c:311 [inline] tomoyo_file_open+0xa3/0xd0 security/tomoyo/tomoyo.c:306 security_file_open+0x45/0xb0 security/security.c:1635 do_dentry_open+0x353/0x11d0 fs/open.c:809 do_open fs/namei.c:3426 [inline] path_openat+0x1c9a/0x2740 fs/namei.c:3559 do_filp_open+0x1aa/0x400 fs/namei.c:3586 do_sys_openat2+0x16d/0x4d0 fs/open.c:1200 do_sys_open fs/open.c:1216 [inline] __do_sys_open fs/open.c:1224 [inline] __se_sys_open fs/open.c:1220 [inline] __x64_sys_open+0x119/0x1c0 fs/open.c:1220 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare+0x326/0x810 mm/page_alloc.c:1391 free_unref_page_prepare mm/page_alloc.c:3317 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3396 __put_page+0x27a/0x470 mm/swap.c:128 folio_put include/linux/mm.h:1269 [inline] put_page include/linux/mm.h:1287 [inline] __skb_frag_unref include/linux/skbuff.h:3111 [inline] skb_release_data+0x49d/0x790 net/core/skbuff.c:672 skb_release_all net/core/skbuff.c:742 [inline] __kfree_skb+0x46/0x60 net/core/skbuff.c:756 tcp_wmem_free_skb include/net/tcp.h:297 [inline] tcp_write_queue_purge+0x290/0xa30 net/ipv4/tcp.c:2907 tcp_reset+0x167/0x4a0 net/ipv4/tcp_input.c:4311 tcp_validate_incoming+0xfc1/0x1c40 net/ipv4/tcp_input.c:5720 tcp_rcv_state_process+0xa9a/0x4bd0 net/ipv4/tcp_input.c:6448 tcp_v6_do_rcv+0x7f9/0x1320 net/ipv6/tcp_ipv6.c:1547 tcp_v6_rcv+0x236d/0x2cb0 net/ipv6/tcp_ipv6.c:1765 ip6_protocol_deliver_rcu+0x2e9/0x1ca0 net/ipv6/ip6_input.c:422 ip6_input_finish+0x62/0x170 net/ipv6/ip6_input.c:463 NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:472 dst_input include/net/dst.h:460 [inline] ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ipv6_rcv+0x28c/0x3c0 net/ipv6/ip6_input.c:297 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5462 Memory state around the buggy address: ffff88807deba500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807deba580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807deba600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807deba680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807deba700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================