syzbot


KASAN: slab-use-after-free Read in __inet_lookup_established

Status: closed as invalid on 2025/11/14 06:50
Subsystems: net
[Documentation on labels]
First crash: 148d, last: 148d
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: uninit-value in __inet_lookup_established (2) net 7 1 1571d 1571d 0/29 auto-closed as invalid on 2022/02/18 00:51

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in __inet_lookup_established+0x3d3/0x830 net/ipv4/inet_hashtables.c:547
Read of size 4 at addr ffff88803c896008 by task rcuc/0/20

CPU: 0 UID: 0 PID: 20 Comm: rcuc/0 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xca/0x240 mm/kasan/report.c:482
 kasan_report+0x118/0x150 mm/kasan/report.c:595
 __inet_lookup_established+0x3d3/0x830 net/ipv4/inet_hashtables.c:547
 __inet_lookup include/net/inet_hashtables.h:405 [inline]
 __inet_lookup_skb include/net/inet_hashtables.h:490 [inline]
 tcp_v4_rcv+0xfff/0x2dc0 net/ipv4/tcp_ipv4.c:2246
 ip_protocol_deliver_rcu+0x221/0x440 net/ipv4/ip_input.c:205
 ip_local_deliver_finish+0x3bb/0x6f0 net/ipv4/ip_input.c:239
 NF_HOOK+0x30c/0x3a0 include/linux/netfilter.h:318
 NF_HOOK+0x30c/0x3a0 include/linux/netfilter.h:318
 __netif_receive_skb_one_core net/core/dev.c:6079 [inline]
 __netif_receive_skb+0x143/0x380 net/core/dev.c:6192
 process_backlog+0x31e/0x900 net/core/dev.c:6544
 __napi_poll+0xb6/0x540 net/core/dev.c:7594
 napi_poll net/core/dev.c:7657 [inline]
 net_rx_action+0x5f7/0xda0 net/core/dev.c:7784
 handle_softirqs+0x22f/0x710 kernel/softirq.c:622
 __do_softirq kernel/softirq.c:656 [inline]
 __local_bh_enable_ip+0x1a0/0x2e0 kernel/softirq.c:302
 local_bh_enable include/linux/bottom_half.h:33 [inline]
 rcu_do_batch kernel/rcu/tree.c:2624 [inline]
 rcu_core kernel/rcu/tree.c:2861 [inline]
 rcu_cpu_kthread+0xc3d/0x1b50 kernel/rcu/tree.c:2949
 smpboot_thread_fn+0x542/0xa60 kernel/smpboot.c:160
 kthread+0x711/0x8a0 kernel/kthread.c:463
 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

Allocated by task 12377:
 kasan_save_stack mm/kasan/common.c:56 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:77
 poison_kmalloc_redzone mm/kasan/common.c:400 [inline]
 __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:417
 kasan_kmalloc include/linux/kasan.h:262 [inline]
 __do_kmalloc_node mm/slub.c:5627 [inline]
 __kmalloc_noprof+0x233/0x7d0 mm/slub.c:5639
 kmalloc_noprof include/linux/slab.h:961 [inline]
 sk_prot_alloc+0xe7/0x220 net/core/sock.c:2239
 sk_clone_lock+0x72/0x10b0 net/core/sock.c:2467
 inet_csk_clone_lock+0x26/0x5b0 net/ipv4/inet_connection_sock.c:1223
 tcp_create_openreq_child+0x30/0x2b10 net/ipv4/tcp_minisocks.c:551
 tcp_create_openreq_child+0x30/0x2b10 net/ipv4/tcp_minisocks.c:551
 tcp_v4_syn_recv_sock+0x161/0xfa0 net/ipv4/tcp_ipv4.c:1776
 tcp_v6_syn_recv_sock+0x134/0x19e0 net/ipv6/tcp_ipv6.c:1383
 subflow_syn_recv_sock+0x281/0x1270 net/mptcp/subflow.c:856
 tcp_check_req+0x109e/0x1a90 net/ipv4/tcp_minisocks.c:912
 tcp_v4_rcv+0x16c2/0x2dc0 net/ipv4/tcp_ipv4.c:2297
 ip_protocol_deliver_rcu+0x221/0x440 net/ipv4/ip_input.c:205
 ip_local_deliver_finish+0x3bb/0x6f0 net/ipv4/ip_input.c:239
 NF_HOOK+0x30c/0x3a0 include/linux/netfilter.h:318
 NF_HOOK+0x30c/0x3a0 include/linux/netfilter.h:318
 __netif_receive_skb_one_core net/core/dev.c:6079 [inline]
 __netif_receive_skb+0x143/0x380 net/core/dev.c:6192
 process_backlog+0x31e/0x900 net/core/dev.c:6544
 __napi_poll+0xb6/0x540 net/core/dev.c:7594
 napi_poll net/core/dev.c:7657 [inline]
 net_rx_action+0x5f7/0xda0 net/core/dev.c:7784
 handle_softirqs+0x22f/0x710 kernel/softirq.c:622
 __do_softirq kernel/softirq.c:656 [inline]
 __local_bh_enable_ip+0x1a0/0x2e0 kernel/softirq.c:302
 local_bh_enable include/linux/bottom_half.h:33 [inline]
 rcu_read_unlock_bh include/linux/rcupdate.h:936 [inline]
 __dev_queue_xmit+0x1d3d/0x3b70 net/core/dev.c:4790
 dev_queue_xmit include/linux/netdevice.h:3365 [inline]
 neigh_hh_output include/net/neighbour.h:531 [inline]
 neigh_output include/net/neighbour.h:545 [inline]
 ip_finish_output2+0xd5a/0x11d0 net/ipv4/ip_output.c:237
 NF_HOOK_COND include/linux/netfilter.h:307 [inline]
 ip_output+0x29f/0x450 net/ipv4/ip_output.c:438
 ip_local_out net/ipv4/ip_output.c:131 [inline]
 __ip_queue_xmit+0x118d/0x1c30 net/ipv4/ip_output.c:534
 __tcp_transmit_skb+0x24f6/0x3aa0 net/ipv4/tcp_output.c:1628
 tcp_rcv_synsent_state_process net/ipv4/tcp_input.c:6754 [inline]
 tcp_rcv_state_process+0x2d62/0x44d0 net/ipv4/tcp_input.c:6948
 tcp_v4_do_rcv+0x3fb/0xbf0 net/ipv4/tcp_ipv4.c:1954
 sk_backlog_rcv include/net/sock.h:1158 [inline]
 __release_sock+0x285/0x3e0 net/core/sock.c:3180
 release_sock+0x75/0x210 net/core/sock.c:3735
 mptcp_connect+0x649/0x830 net/mptcp/protocol.c:3786
 __inet_stream_connect+0x2ae/0xe70 net/ipv4/af_inet.c:679
 inet_stream_connect+0x66/0xa0 net/ipv4/af_inet.c:750
 __sys_connect_file net/socket.c:2102 [inline]
 __sys_connect+0x323/0x450 net/socket.c:2121
 __do_sys_connect net/socket.c:2127 [inline]
 __se_sys_connect net/socket.c:2124 [inline]
 __x64_sys_connect+0x7a/0x90 net/socket.c:2124
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 12375:
 kasan_save_stack mm/kasan/common.c:56 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:77
 __kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:587
 kasan_save_free_info mm/kasan/kasan.h:406 [inline]
 poison_slab_object mm/kasan/common.c:252 [inline]
 __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:284
 kasan_slab_free include/linux/kasan.h:234 [inline]
 slab_free_hook mm/slub.c:2523 [inline]
 slab_free mm/slub.c:6611 [inline]
 kfree+0x197/0x950 mm/slub.c:6818
 sk_prot_free net/core/sock.c:2278 [inline]
 __sk_destruct+0x4e4/0x670 net/core/sock.c:2373
 sock_put include/net/sock.h:1972 [inline]
 inet_csk_listen_stop+0x78c/0xac0 net/ipv4/inet_connection_sock.c:1526
 mptcp_check_listen_stop+0x1c6/0x2b0 net/mptcp/protocol.c:3063
 __mptcp_close+0xf6/0xa60 net/mptcp/protocol.c:3078
 mptcp_close+0x28/0x1a0 net/mptcp/protocol.c:3144
 inet_release+0x144/0x190 net/ipv4/af_inet.c:437
 __sock_release net/socket.c:662 [inline]
 sock_close+0xc3/0x240 net/socket.c:1455
 __fput+0x45b/0xa80 fs/file_table.c:468
 task_work_run+0x1d4/0x260 kernel/task_work.c:227
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 exit_to_user_mode_loop+0xe9/0x130 kernel/entry/common.c:43
 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
 syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
 do_syscall_64+0x2bd/0xfa0 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff88803c896000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 8 bytes inside of
 freed 4096-byte region [ffff88803c896000, ffff88803c897000)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88803c892000 pfn:0x3c890
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x80000000000240(workingset|head|node=0|zone=1)
page_type: f5(slab)
raw: 0080000000000240 ffff88813ff27140 ffffea000135c010 ffffea0000cb8810
raw: ffff88803c892000 0000000000040003 00000000f5000000 0000000000000000
head: 0080000000000240 ffff88813ff27140 ffffea000135c010 ffffea0000cb8810
head: ffff88803c892000 0000000000040003 00000000f5000000 0000000000000000
head: 0080000000000003 ffffea0000f22401 00000000ffffffff 00000000ffffffff
head: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000008
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5177, tgid 5177 (udevd), ts 49853528843, free_ts 0
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850
 prep_new_page mm/page_alloc.c:1858 [inline]
 get_page_from_freelist+0x28c0/0x2960 mm/page_alloc.c:3884
 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183
 alloc_pages_mpol+0xd1/0x380 mm/mempolicy.c:2416
 alloc_slab_page mm/slub.c:3039 [inline]
 allocate_slab+0x96/0x3a0 mm/slub.c:3212
 new_slab mm/slub.c:3266 [inline]
 ___slab_alloc+0xb12/0x13f0 mm/slub.c:4636
 __slab_alloc+0xc6/0x1f0 mm/slub.c:4755
 __slab_alloc_node mm/slub.c:4831 [inline]
 slab_alloc_node mm/slub.c:5253 [inline]
 __kmalloc_cache_noprof+0xec/0x6c0 mm/slub.c:5743
 kmalloc_noprof include/linux/slab.h:957 [inline]
 kzalloc_noprof include/linux/slab.h:1094 [inline]
 uevent_show+0x15a/0x310 drivers/base/core.c:2751
 dev_attr_show+0x58/0xc0 drivers/base/core.c:2421
 sysfs_kf_seq_show+0x310/0x490 fs/sysfs/file.c:65
 seq_read_iter+0x4f0/0xe20 fs/seq_file.c:230
 new_sync_read fs/read_write.c:491 [inline]
 vfs_read+0x563/0xa30 fs/read_write.c:572
 ksys_read+0x14b/0x260 fs/read_write.c:715
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88803c895f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88803c895f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88803c896000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff88803c896080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88803c896100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/13 13:18 upstream 3a8660878839 ff1712fe .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root KASAN: slab-use-after-free Read in __inet_lookup_established
* Struck through repros no longer work on HEAD.