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

Status: premoderation: reported on 2026/10/10 06:04
Reported-by: syzbot+ddb8fddfe7f1960fada8@syzkaller.appspotmail.com
First crash: 46d, last: 6h12m
▶ ▼ Similar bugs (12)
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 2483d 2483d 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 310d 359d 0/2 auto-obsoleted due to no activity on 2026/04/19 06:45
android-6-1 KASAN: use-after-free Read in ipt_do_table (2) 19 2 25d 54d 0/2 premoderation: reported on 2026/10/01 15:11
android-5-15 KASAN: use-after-free Read in ipt_do_table 19 1 404d 404d 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 168d 178d 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 1529d 1677d 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 193d 210d 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 395d 395d 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 5 30d 62d 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 1954d 1950d 0/29 auto-closed as invalid on 2021/10/17 23:06
linux-4.19 general protection fault in ipt_do_table 2 1 2061d 2061d 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 387d 387d 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+0x6ba/0x1510 net/ipv4/netfilter/ip_tables.c:284
Read of size 8 at addr ffff888125b60000 by task syz.5.5654/20645

CPU: 0 PID: 20645 Comm: syz.5.5654 Tainted: G        W         syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
 <TASK>
 __dump_stack+0x21/0x30 lib/dump_stack.c:88
 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:427 [inline]
 kasan_report+0x10f/0x150 mm/kasan/report.c:444
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309
 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+0x6ba/0x1510 net/ipv4/netfilter/ip_tables.c:284
 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+0xbc/0x200 net/netfilter/core.c:590
 nf_hook include/linux/netfilter.h:260 [inline]
 NF_HOOK include/linux/netfilter.h:303 [inline]
 ip_mc_output+0x7fd/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+0xb4/0x140 net/ipv4/ip_output.c:1598
 udp_send_skb+0x8e6/0x10f0 net/ipv4/udp.c:1000
 udp_sendmsg+0x176a/0x2110 net/ipv4/udp.c:1288
 inet_sendmsg+0xa5/0xc0 net/ipv4/af_inet.c:830
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 ____sys_sendmsg+0x5be/0x8f0 net/socket.c:2436
 ___sys_sendmsg+0x236/0x2e0 net/socket.c:2490
 __sys_sendmmsg+0x2ba/0x4e0 net/socket.c:2576
 __do_sys_sendmmsg net/socket.c:2605 [inline]
 __se_sys_sendmmsg net/socket.c:2602 [inline]
 __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2602
 x64_sys_call+0x6c6/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:308
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fa4723afa19
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:00007fa470dfd028 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00007fa47263bfa0 RCX: 00007fa4723afa19
RDX: 000000000800001d RSI: 0000200000001380 RDI: 0000000000000005
RBP: 00007fa47243f156 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000300 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fa47263c038 R14: 00007fa47263bfa0 R15: 00007ffc9518b2f8
 </TASK>

The buggy address belongs to the page:
page:ffffea000496d800 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x125b60
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 ffffea0004899f08 ffffea0004a3d108 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 0x546dc0(GFP_USER|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_COMP|__GFP_ZERO|__GFP_ACCOUNT), pid 20609, ts 1270170562755, free_ts 1271209888037
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2610
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2616
 get_page_from_freelist+0x2d42/0x2dd0 mm/page_alloc.c:4492
 __alloc_pages+0x1a2/0x460 mm/page_alloc.c:5829
 __alloc_pages_node include/linux/gfp.h:595 [inline]
 alloc_pages_node include/linux/gfp.h:609 [inline]
 alloc_pages include/linux/gfp.h:622 [inline]
 kmalloc_order+0x4c/0x160 mm/slab_common.c:995
 kmalloc_order_trace+0x18/0xb0 mm/slab_common.c:1014
 kmalloc_large include/linux/slab.h:548 [inline]
 __kmalloc+0x199/0x2c0 mm/slub.c:4425
 __kmalloc_node include/linux/slab.h:487 [inline]
 kmalloc_node include/linux/slab.h:642 [inline]
 kvmalloc_node+0x211/0x320 mm/util.c:621
 kvmalloc include/linux/mm.h:865 [inline]
 kvzalloc include/linux/mm.h:873 [inline]
 alloc_netdev_mqs+0x8d/0xe20 net/core/dev.c:10927
 tun_set_iff+0x55d/0xe70 drivers/net/tun.c:2787
 __tun_chr_ioctl+0x870/0x1f40 drivers/net/tun.c:3076
 tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:3363
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0x121/0x1a0 fs/ioctl.c:860
 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:860
 x64_sys_call+0x2f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:17
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:26 [inline]
 free_pages_prepare mm/page_alloc.c:1477 [inline]
 free_pcp_prepare mm/page_alloc.c:1549 [inline]
 free_unref_page_prepare+0x5fa/0x600 mm/page_alloc.c:3540
 free_unref_page+0xae/0x540 mm/page_alloc.c:3622
 free_the_page mm/page_alloc.c:808 [inline]
 __free_pages+0x6c/0x100 mm/page_alloc.c:5905
 free_nonslab_page+0x86/0xc0 mm/slub.c:3564
 kfree+0x19a/0x270 mm/slub.c:4585
 kvfree+0x35/0x40 mm/util.c:661
 netdev_freemem+0x3f/0x60 net/core/dev.c:10881
 netdev_release+0x7f/0xb0 net/core/net-sysfs.c:1903
 device_release+0x96/0x1c0 drivers/base/core.c:-1
 kobject_cleanup lib/kobject.c:713 [inline]
 kobject_release lib/kobject.c:744 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x18a/0x270 lib/kobject.c:761
 netdev_run_todo+0x7dc/0x950 net/core/dev.c:10737
 rtnl_unlock net/core/rtnetlink.c:112 [inline]
 rtnetlink_rcv_msg+0xa38/0xcb0 net/core/rtnetlink.c:5663
 netlink_rcv_skb+0x1e9/0x430 net/netlink/af_netlink.c:2528
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5680
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x993/0xb70 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x879/0xb80 net/netlink/af_netlink.c:1931

Memory state around the buggy address:
 ffff888125b5ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888125b5ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888125b60000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff888125b60080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888125b60100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/25 04:09 android13-5.15-lts 0d108e1e8c7b bda6e3c6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in ipt_do_table
2026/11/22 17:49 android13-5.15-lts 0d108e1e8c7b b2c69459 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in ipt_do_table
2026/11/08 20:50 android13-5.15-lts 2316d138a3c3 5cecaf1f .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in ipt_do_table
2026/10/26 11:58 android13-5.15-lts dde14ee8fb2e 1d9ca40b .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in ipt_do_table
2026/10/10 06:03 android13-5.15-lts d6c8aee048e0 4f92358f .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in ipt_do_table
* Struck through repros no longer work on HEAD.