syzbot


KASAN: use-after-free Read in fib_flush

Status: premoderation: reported on 2025/06/08 04:46
Reported-by: syzbot+471e037cf6e8587a411a@syzkaller.appspotmail.com
First crash: 122d, last: 21d
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-6-1 KASAN: use-after-free Read in fib_flush 19 1 49d 49d 0/2 premoderation: reported on 2025/08/20 05:00

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in fib_flush+0x77/0x120 net/ipv4/fib_frontend.c:193
Read of size 8 at addr ffff8881134ae000 by task kworker/u4:6/3093

CPU: 0 PID: 3093 Comm: kworker/u4:6 Tainted: G        W         syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/14/2025
Workqueue: netns cleanup_net
Call Trace:
 __dump_stack+0x21/0x24 lib/dump_stack.c:77
 dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118
 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:435 [inline]
 kasan_report+0xe2/0x130 mm/kasan/report.c:452
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309
 fib_flush+0x77/0x120 net/ipv4/fib_frontend.c:193
 __remove_nexthop_fib+0xab/0x260 net/ipv4/nexthop.c:879
 __remove_nexthop net/ipv4/nexthop.c:893 [inline]
 remove_nexthop+0x75/0x4d0 net/ipv4/nexthop.c:919
 remove_nh_grp_entry net/ipv4/nexthop.c:797 [inline]
 remove_nexthop_from_groups+0x193/0xe40 net/ipv4/nexthop.c:846
 __remove_nexthop net/ipv4/nexthop.c:904 [inline]
 remove_nexthop+0x38a/0x4d0 net/ipv4/nexthop.c:919
 flush_all_nexthops net/ipv4/nexthop.c:1237 [inline]
 nexthop_net_exit+0x3a/0xa0 net/ipv4/nexthop.c:2012
 ops_exit_list net/core/net_namespace.c:185 [inline]
 cleanup_net+0x586/0xb70 net/core/net_namespace.c:609
 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301
 worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447
 kthread+0x346/0x3d0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

Allocated by task 3449:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:45 [inline]
 set_alloc_info mm/kasan/common.c:430 [inline]
 ____kasan_kmalloc mm/kasan/common.c:509 [inline]
 __kasan_kmalloc+0xda/0x110 mm/kasan/common.c:518
 kasan_kmalloc include/linux/kasan.h:254 [inline]
 kmem_cache_alloc_trace+0x184/0x2e0 mm/slub.c:2979
 kmalloc include/linux/slab.h:552 [inline]
 kzalloc include/linux/slab.h:664 [inline]
 ip_fib_net_init net/ipv4/fib_frontend.c:1547 [inline]
 fib_net_init+0xe0/0x2c0 net/ipv4/fib_frontend.c:1606
 ops_init+0x1ba/0x4a0 net/core/net_namespace.c:144
 setup_net+0x36d/0xb50 net/core/net_namespace.c:345
 copy_net_ns+0x314/0x520 net/core/net_namespace.c:486
 create_new_namespaces+0x3a2/0x650 kernel/nsproxy.c:110
 unshare_nsproxy_namespaces+0x120/0x170 kernel/nsproxy.c:231
 ksys_unshare+0x4ac/0x7d0 kernel/fork.c:3156
 __do_sys_unshare kernel/fork.c:3224 [inline]
 __se_sys_unshare kernel/fork.c:3222 [inline]
 __x64_sys_unshare+0x38/0x40 kernel/fork.c:3222
 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

Freed by task 3093:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4a/0x70 mm/kasan/common.c:45
 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:362
 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370
 kasan_slab_free include/linux/kasan.h:220 [inline]
 slab_free_hook mm/slub.c:1600 [inline]
 slab_free_freelist_hook+0xc5/0x190 mm/slub.c:1626
 slab_free mm/slub.c:3208 [inline]
 kfree+0xc0/0x270 mm/slub.c:4196
 ip_fib_net_exit+0x32f/0x350 net/ipv4/fib_frontend.c:1595
 fib_net_exit+0x6c/0x80 net/ipv4/fib_frontend.c:1629
 ops_exit_list net/core/net_namespace.c:185 [inline]
 cleanup_net+0x586/0xb70 net/core/net_namespace.c:609
 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301
 worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447
 kthread+0x346/0x3d0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

Last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38
 __kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348
 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
 kvfree_call_rcu+0x10c/0x620 kernel/rcu/tree.c:3539
 drop_sysctl_table+0x2ef/0x410 fs/proc/proc_sysctl.c:1684
 unregister_sysctl_table+0x75/0x120 fs/proc/proc_sysctl.c:1722
 unregister_net_sysctl_table+0x15/0x20 net/sysctl_net.c:127
 __devinet_sysctl_unregister net/ipv4/devinet.c:2621 [inline]
 devinet_sysctl_unregister net/ipv4/devinet.c:2649 [inline]
 inetdev_destroy net/ipv4/devinet.c:326 [inline]
 inetdev_event+0x79d/0x1030 net/ipv4/devinet.c:1612
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0x90/0x100 kernel/notifier.c:410
 call_netdevice_notifiers_info net/core/dev.c:2054 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2066 [inline]
 call_netdevice_notifiers net/core/dev.c:2080 [inline]
 unregister_netdevice_many+0xf8b/0x1980 net/core/dev.c:10767
 default_device_exit_batch+0x330/0x390 net/core/dev.c:11287
 ops_exit_list net/core/net_namespace.c:190 [inline]
 cleanup_net+0x5fb/0xb70 net/core/net_namespace.c:609
 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301
 worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447
 kthread+0x346/0x3d0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

Second to last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38
 __kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348
 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
 __call_rcu kernel/rcu/tree.c:2980 [inline]
 call_rcu+0x10e/0x1050 kernel/rcu/tree.c:3054
 netlink_release+0x1288/0x1690 net/netlink/af_netlink.c:795
 __sock_release net/socket.c:597 [inline]
 sock_close+0xe0/0x270 net/socket.c:1286
 __fput+0x2fb/0x770 fs/file_table.c:281
 ____fput+0x15/0x20 fs/file_table.c:314
 task_work_run+0x127/0x190 kernel/task_work.c:189
 tracehook_notify_resume include/linux/tracehook.h:188 [inline]
 exit_to_user_mode_loop+0xcb/0xe0 kernel/entry/common.c:172
 exit_to_user_mode_prepare+0x76/0xa0 kernel/entry/common.c:199
 syscall_exit_to_user_mode+0x1d/0x40 kernel/entry/common.c:274
 do_syscall_64+0x3d/0x40 arch/x86/entry/common.c:56
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

The buggy address belongs to the object at ffff8881134ae000
 which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 0 bytes inside of
 2048-byte region [ffff8881134ae000, ffff8881134ae800)
The buggy address belongs to the page:
page:ffffea00044d2a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1134a8
head:ffffea00044d2a00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head)
raw: 4000000000010200 0000000000000000 0000000100000001 ffff888100042d80
raw: 0000000000000000 0000000000080008 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 0x1d2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 411, ts 32321109713, free_ts 32315617816
 set_page_owner include/linux/page_owner.h:35 [inline]
 post_alloc_hook mm/page_alloc.c:2456 [inline]
 prep_new_page+0x179/0x180 mm/page_alloc.c:2462
 get_page_from_freelist+0x2235/0x23d0 mm/page_alloc.c:4254
 __alloc_pages_nodemask+0x268/0x5f0 mm/page_alloc.c:5370
 alloc_slab_page mm/slub.c:-1 [inline]
 allocate_slab mm/slub.c:1813 [inline]
 new_slab+0x84/0x3f0 mm/slub.c:1874
 new_slab_objects mm/slub.c:2632 [inline]
 ___slab_alloc+0x2a6/0x450 mm/slub.c:2796
 __slab_alloc+0x63/0xa0 mm/slub.c:2836
 slab_alloc_node mm/slub.c:2918 [inline]
 slab_alloc mm/slub.c:2960 [inline]
 __kmalloc_track_caller+0x1ef/0x320 mm/slub.c:4541
 __kmalloc_reserve net/core/skbuff.c:144 [inline]
 __alloc_skb+0xdc/0x520 net/core/skbuff.c:212
 alloc_skb include/linux/skbuff.h:1126 [inline]
 nlmsg_new include/net/netlink.h:953 [inline]
 audit_buffer_alloc kernel/audit.c:1799 [inline]
 audit_log_start+0x3df/0x860 kernel/audit.c:1917
 common_lsm_audit+0xd3/0x17f0 security/lsm_audit.c:457
 slow_avc_audit+0x1ac/0x220 security/selinux/avc.c:798
 avc_audit security/selinux/include/avc.h:140 [inline]
 avc_has_perm+0x1ca/0x360 security/selinux/avc.c:1201
 inode_has_perm security/selinux/hooks.c:1657 [inline]
 file_path_has_perm security/selinux/hooks.c:1702 [inline]
 selinux_file_open+0x467/0x620 security/selinux/hooks.c:3979
 security_file_open+0x62/0xa0 security/security.c:1582
 do_dentry_open+0x39b/0x1090 fs/open.c:806
 vfs_open+0x73/0x80 fs/open.c:942
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:28 [inline]
 free_pages_prepare mm/page_alloc.c:1349 [inline]
 __free_pages_ok+0x7fc/0x820 mm/page_alloc.c:1629
 free_the_page mm/page_alloc.c:5431 [inline]
 __free_pages+0xdd/0x380 mm/page_alloc.c:5440
 __free_slab+0xcf/0x190 mm/slub.c:1899
 free_slab mm/slub.c:1914 [inline]
 discard_slab+0x29/0x40 mm/slub.c:1920
 __slab_free+0x313/0x3a0 mm/slub.c:3136
 do_slab_free mm/slub.c:3196 [inline]
 ___cache_free+0x111/0x130 mm/slub.c:3215
 qlink_free+0x50/0x90 mm/kasan/quarantine.c:157
 qlist_free_all+0x5f/0xb0 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x14a/0x160 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0x2f/0xf0 mm/kasan/common.c:440
 kasan_slab_alloc include/linux/kasan.h:244 [inline]
 slab_post_alloc_hook+0x5d/0x2f0 mm/slab.h:580
 slab_alloc_node mm/slub.c:2952 [inline]
 slab_alloc mm/slub.c:2960 [inline]
 kmem_cache_alloc+0x165/0x2e0 mm/slub.c:2965
 getname_flags+0xb9/0x500 fs/namei.c:141
 getname+0x19/0x20 fs/namei.c:212
 do_sys_openat2+0xd9/0x6d0 fs/open.c:1211
 do_sys_open fs/open.c:1233 [inline]
 __do_sys_openat fs/open.c:1249 [inline]
 __se_sys_openat fs/open.c:1244 [inline]
 __x64_sys_openat+0x136/0x160 fs/open.c:1244

Memory state around the buggy address:
 ffff8881134adf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881134adf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8881134ae000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff8881134ae080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881134ae100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
general protection fault, probably for non-canonical address 0xfd90650a6a882aa8: 0000 [#1] PREEMPT SMP KASAN
KASAN: maybe wild-memory-access in range [0xec83485354415540-0xec83485354415547]
CPU: 1 PID: 3093 Comm: kworker/u4:6 Tainted: G    B   W         syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/14/2025
Workqueue: netns cleanup_net
RIP: 0010:fib_table_flush+0x31a/0x1330 net/ipv4/fib_trie.c:1992
Code: 38 c1 0f 8c 71 ff ff ff 48 89 df e8 70 10 bf fd e9 64 ff ff ff 4c 89 6c 24 38 48 89 44 24 20 48 8d 58 05 48 89 d8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 0f 85 99 0d 00 00 0f b6 1b 31 ff 89 de e8 dd
RSP: 0018:ffffc90000b37840 EFLAGS: 00010a03
RAX: 1d90690a6a882aa8 RBX: ec83485354415546 RCX: ffff88811e37cf00
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc90000b379c0 R08: 0000000000000004 R09: 0000000000000003
R10: fffffbfff0d8ee48 R11: 1ffffffff0d8ee48 R12: dffffc0000000000
R13: 0000000000000001 R14: ffffffff83d9b840 R15: ffff8881180a4000
FS:  0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000003 CR3: 000000010c2fe000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 fib_flush+0xb5/0x120 net/ipv4/fib_frontend.c:194
 __remove_nexthop_fib+0xab/0x260 net/ipv4/nexthop.c:879
 __remove_nexthop net/ipv4/nexthop.c:893 [inline]
 remove_nexthop+0x75/0x4d0 net/ipv4/nexthop.c:919
 remove_nh_grp_entry net/ipv4/nexthop.c:797 [inline]
 remove_nexthop_from_groups+0x193/0xe40 net/ipv4/nexthop.c:846
 __remove_nexthop net/ipv4/nexthop.c:904 [inline]
 remove_nexthop+0x38a/0x4d0 net/ipv4/nexthop.c:919
 flush_all_nexthops net/ipv4/nexthop.c:1237 [inline]
 nexthop_net_exit+0x3a/0xa0 net/ipv4/nexthop.c:2012
 ops_exit_list net/core/net_namespace.c:185 [inline]
 cleanup_net+0x586/0xb70 net/core/net_namespace.c:609
 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301
 worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447
 kthread+0x346/0x3d0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
Modules linked in:
---[ end trace 06ac0d76b25e81df ]---
RIP: 0010:fib_table_flush+0x31a/0x1330 net/ipv4/fib_trie.c:1992
Code: 38 c1 0f 8c 71 ff ff ff 48 89 df e8 70 10 bf fd e9 64 ff ff ff 4c 89 6c 24 38 48 89 44 24 20 48 8d 58 05 48 89 d8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 0f 85 99 0d 00 00 0f b6 1b 31 ff 89 de e8 dd
RSP: 0018:ffffc90000b37840 EFLAGS: 00010a03
RAX: 1d90690a6a882aa8 RBX: ec83485354415546 RCX: ffff88811e37cf00
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc90000b379c0 R08: 0000000000000004 R09: 0000000000000003
R10: fffffbfff0d8ee48 R11: 1ffffffff0d8ee48 R12: dffffc0000000000
R13: 0000000000000001 R14: ffffffff83d9b840 R15: ffff8881180a4000
FS:  0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000010d069000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	38 c1                	cmp    %al,%cl
   2:	0f 8c 71 ff ff ff    	jl     0xffffff79
   8:	48 89 df             	mov    %rbx,%rdi
   b:	e8 70 10 bf fd       	call   0xfdbf1080
  10:	e9 64 ff ff ff       	jmp    0xffffff79
  15:	4c 89 6c 24 38       	mov    %r13,0x38(%rsp)
  1a:	48 89 44 24 20       	mov    %rax,0x20(%rsp)
  1f:	48 8d 58 05          	lea    0x5(%rax),%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 0f b6 04 20       	movzbl (%rax,%r12,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	0f 85 99 0d 00 00    	jne    0xdd0
  37:	0f b6 1b             	movzbl (%rbx),%ebx
  3a:	31 ff                	xor    %edi,%edi
  3c:	89 de                	mov    %ebx,%esi
  3e:	e8                   	.byte 0xe8
  3f:	dd                   	.byte 0xdd

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/17 00:48 android13-5.10-lts 911f602c2237 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in fib_flush
2025/09/02 14:17 android13-5.10-lts 68c598f9eb32 96a211bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in fib_flush
2025/07/22 10:49 android13-5.10-lts ad9a98ef27a4 1555463b .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in fib_flush
2025/07/10 13:41 android13-5.10-lts 59e9a7228857 956bd956 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in fib_flush
2025/07/09 23:32 android13-5.10-lts 59e9a7228857 f4e5e155 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in fib_flush
2025/07/09 23:27 android13-5.10-lts 59e9a7228857 f4e5e155 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in fib_flush
2025/06/08 04:45 android13-5.10-lts d76d4cd0623a 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in fib_flush
* Struck through repros no longer work on HEAD.