KASAN: use-after-free Read in ipt_do_table (2)

Status: premoderation: reported on 2026/10/01 15:11
Reported-by: syzbot+a9983e592063cf3f4c56@syzkaller.appspotmail.com
First crash: 2d02h, last: 2d02h
▶ ▼ Similar bugs (11)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in ipt_do_table 19 1 2430d 2430d 0/1 auto-closed as invalid on 2020/06/06 05:50
android-5-10 KASAN: use-after-free Read in ipt_do_table 19 4 257d 306d 0/2 auto-obsoleted due to no activity on 2026/04/19 06:45
android-5-15 KASAN: use-after-free Read in ipt_do_table 19 1 351d 351d 0/2 auto-obsoleted due to no activity on 2026/01/15 08:55
android-5-15 KASAN: use-after-free Read in ipt_do_table (2) 19 2 115d 126d 0/2 auto-obsoleted due to no activity on 2026/09/08 07:46
upstream KASAN: use-after-free Read in ipt_do_table netfilter 19 syz error error 16 1476d 1625d 0/29 closed as invalid on 2022/11/17 17:58
android-5-10 KASAN: use-after-free Read in ipt_do_table (2) 19 3 141d 158d 0/2 auto-obsoleted due to no activity on 2026/08/13 15:22
android-6-1 KASAN: use-after-free Read in ipt_do_table 19 1 342d 342d 0/2 auto-obsoleted due to no activity on 2026/01/24 06:12
android-5-10 KASAN: use-after-free Read in ipt_do_table (3) 19 3 10h12m 9d17h 0/2 premoderation: reported on 2026/09/24 00:31
upstream BUG: unable to handle kernel paging request in ipt_do_table netfilter 8 1 1901d 1897d 0/29 auto-closed as invalid on 2021/10/17 23:06
linux-4.19 general protection fault in ipt_do_table 2 1 2009d 2009d 0/1 auto-closed as invalid on 2021/08/01 14:21
upstream KASAN: slab-use-after-free Read in ipt_do_table netfilter 19 1 334d 334d 0/29 closed as invalid on 2026/01/07 12:42

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ifname_compare_aligned include/linux/netfilter/x_tables.h:412 [inline]
BUG: KASAN: use-after-free in ip_packet_match net/ipv4/netfilter/ip_tables.c:64 [inline]
BUG: KASAN: use-after-free in ipt_do_table+0x6e6/0x15a0 net/ipv4/netfilter/ip_tables.c:285
Read of size 8 at addr ffff888130054000 by task syz.0.44/427

CPU: 1 PID: 427 Comm: syz.0.44 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 __dump_stack+0x21/0x24 lib/dump_stack.c:88
 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
 print_address_description+0x71/0x200 mm/kasan/report.c:316
 print_report+0x4a/0x60 mm/kasan/report.c:420
 kasan_report+0x122/0x150 mm/kasan/report.c:524
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:351
 ifname_compare_aligned include/linux/netfilter/x_tables.h:412 [inline]
 ip_packet_match net/ipv4/netfilter/ip_tables.c:64 [inline]
 ipt_do_table+0x6e6/0x15a0 net/ipv4/netfilter/ip_tables.c:285
 iptable_mangle_hook+0x196/0x4d0 net/ipv4/netfilter/iptable_mangle.c:79
 nf_hook_entry_hookfn include/linux/netfilter.h:143 [inline]
 nf_hook_slow+0xca/0x200 net/netfilter/core.c:620
 nf_hook include/linux/netfilter.h:260 [inline]
 NF_HOOK include/linux/netfilter.h:303 [inline]
 ip_mc_output+0x802/0x8d0 net/ipv4/ip_output.c:394
 dst_output include/net/dst.h:453 [inline]
 ip_local_out net/ipv4/ip_output.c:126 [inline]
 ip_send_skb+0xc3/0x150 net/ipv4/ip_output.c:1608
 udp_send_skb+0xa6a/0x13a0 net/ipv4/udp.c:994
 udp_sendmsg+0x17e8/0x2170 net/ipv4/udp.c:1282
 inet_sendmsg+0xb6/0xd0 net/ipv4/af_inet.c:841
 sock_sendmsg_nosec net/socket.c:716 [inline]
 __sock_sendmsg net/socket.c:728 [inline]
 ____sys_sendmsg+0x5fb/0x9c0 net/socket.c:2509
 ___sys_sendmsg+0x2a2/0x360 net/socket.c:2563
 __sys_sendmmsg+0x2cc/0x4e0 net/socket.c:2649
 __do_sys_sendmmsg net/socket.c:2678 [inline]
 __se_sys_sendmmsg net/socket.c:2675 [inline]
 __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2675
 x64_sys_call+0x3f5/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:308
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f4944b9e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f49459d8028 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00007f4944e25fa0 RCX: 00007f4944b9e159
RDX: 000000000800001d RSI: 0000200000007fc0 RDI: 0000000000000005
RBP: 00007f4944c3506b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000300 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f4944e26038 R14: 00007f4944e25fa0 R15: 00007ffef458c958
 </TASK>

The buggy address belongs to the physical page:
page:ffffea0004c01500 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x130054
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 ffff8881f6e3c9d8 ffff8881f6e3c9d8 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x446dc0(GFP_KERNEL_ACCOUNT|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_COMP|__GFP_ZERO), pid 289, tgid 289 (syz-executor), ts 23465126309, free_ts 28275711899
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2673
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2680
 get_page_from_freelist+0x2ca9/0x2d20 mm/page_alloc.c:4587
 __alloc_pages+0x1fa/0x610 mm/page_alloc.c:5931
 __alloc_pages_node include/linux/gfp.h:236 [inline]
 alloc_pages_node include/linux/gfp.h:259 [inline]
 __kmalloc_large_node+0xa1/0x1c0 mm/slab_common.c:1079
 __do_kmalloc_node mm/slab_common.c:926 [inline]
 __kmalloc_node+0xdf/0x1e0 mm/slab_common.c:945
 kmalloc_node include/linux/slab.h:589 [inline]
 kvmalloc_node+0x28a/0x460 mm/util.c:592
 kvmalloc include/linux/slab.h:716 [inline]
 kvzalloc include/linux/slab.h:724 [inline]
 alloc_netdev_mqs+0x8d/0xfb0 net/core/dev.c:10746
 tun_set_iff+0x547/0xee0 drivers/net/tun.c:2825
 __tun_chr_ioctl+0x88c/0x1ef0 drivers/net/tun.c:3117
 tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:3404
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0x12f/0x1b0 fs/ioctl.c:856
 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:856
 x64_sys_call+0x58b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:17
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:26 [inline]
 free_pages_prepare mm/page_alloc.c:1581 [inline]
 free_pcp_prepare mm/page_alloc.c:1655 [inline]
 free_unref_page_prepare+0x81b/0x820 mm/page_alloc.c:3622
 free_unref_page+0x93/0x530 mm/page_alloc.c:3720
 free_the_page mm/page_alloc.c:863 [inline]
 __free_pages+0x67/0x100 mm/page_alloc.c:6021
 free_large_kmalloc+0xae/0xf0 mm/slab_common.c:915
 kfree+0x8b/0xf0 mm/slab_common.c:984
 kvfree+0x35/0x40 mm/util.c:639
 netdev_freemem+0x3f/0x60 net/core/dev.c:10700
 netdev_release+0x7f/0xb0 net/core/net-sysfs.c:1904
 device_release+0xa4/0x1d0 drivers/base/core.c:-1
 kobject_cleanup lib/kobject.c:681 [inline]
 kobject_release lib/kobject.c:712 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x19d/0x280 lib/kobject.c:729
 netdev_run_todo+0xb48/0xc30 net/core/dev.c:10520
 rtnl_unlock net/core/rtnetlink.c:147 [inline]
 rtnetlink_rcv_msg+0xb75/0xde0 net/core/rtnetlink.c:6155
 netlink_rcv_skb+0x200/0x450 net/netlink/af_netlink.c:2526
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6172
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x8c1/0xa60 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x8b9/0xbd0 net/netlink/af_netlink.c:1878

Memory state around the buggy address:
 ffff888130053f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888130053f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888130054000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff888130054080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888130054100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/10/01 15:10 android14-6.1 6612ef9d0b09 f5cdae2f .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in ipt_do_table
* Struck through repros no longer work on HEAD.