syzbot


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

Status: premoderation: reported C repro on 2025/07/13 10:36
Bug presence: origin:lts
[Documentation on labels]
Reported-by: syzbot+e6c6a5a115e859205ddd@syzkaller.appspotmail.com
First crash: 2d22h, last: 2d18h
Bug presence (2)
Date Name Commit Repro Result
2025/07/13 lts (merge base) e0e2f7824338 C [report] KASAN: slab-use-after-free Read in unix_stream_read_actor
2025/07/13 upstream (ToT) 347e9f5043c8 C Didn't crash
Similar bugs (6)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-use-after-free Read in unix_stream_read_actor (2) net 19 C inconclusive 4 319d 314d 28/29 fixed on 2024/10/22 11:56
upstream KASAN: slab-use-after-free Read in unix_stream_read_actor net 19 C error 6 596d 613d 25/29 fixed on 2024/01/20 21:18
android-6-1 KASAN: use-after-free Read in unix_stream_read_actor missing-backport origin:upstream 19 C done done 2 538d 613d 0/2 auto-obsoleted due to no activity on 2024/05/03 09:45
linux-5.15 KASAN: use-after-free Read in unix_stream_read_actor origin:lts-only 19 C done 1 611d 613d 3/3 fixed on 2023/12/13 18:20
linux-6.1 KASAN: use-after-free Read in unix_stream_read_actor origin:lts-only 19 C done 1 609d 613d 3/3 fixed on 2023/12/18 16:47
android-5-15 KASAN: use-after-free Read in unix_stream_read_actor origin:upstream 19 C 1 613d 613d 0/2 auto-obsoleted due to no activity on 2024/02/19 03:43

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in unix_stream_read_actor+0xae/0xd0 net/unix/af_unix.c:2961
Read of size 4 at addr ffff8881027f47c4 by task syz-executor175/300

CPU: 1 UID: 0 PID: 300 Comm: syz-executor175 Not tainted 6.12.30-syzkaller-g21ed84930c16 #0 fa4558fba7fa11aa57b2c84caea5bf67b39b1b5f
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 __dump_stack+0x21/0x30 lib/dump_stack.c:94
 dump_stack_lvl+0x10c/0x190 lib/dump_stack.c:120
 print_address_description+0x71/0x220 mm/kasan/report.c:377
 print_report+0x4a/0x70 mm/kasan/report.c:488
 kasan_report+0x163/0x1a0 mm/kasan/report.c:601
 __asan_report_load4_noabort+0x18/0x20 mm/kasan/report_generic.c:380
 unix_stream_read_actor+0xae/0xd0 net/unix/af_unix.c:2961
 unix_stream_recv_urg+0x1f8/0x360 net/unix/af_unix.c:2641
 unix_stream_read_generic+0x21ed/0x22d0 net/unix/af_unix.c:2780
 unix_stream_recvmsg+0x16c/0x1c0 net/unix/af_unix.c:2998
 sock_recvmsg_nosec net/socket.c:1052 [inline]
 sock_recvmsg+0x219/0x270 net/socket.c:1074
 ____sys_recvmsg+0x1ca/0x460 net/socket.c:2829
 ___sys_recvmsg+0x1b6/0x510 net/socket.c:2871
 __sys_recvmsg net/socket.c:2901 [inline]
 __do_sys_recvmsg net/socket.c:2911 [inline]
 __se_sys_recvmsg net/socket.c:2908 [inline]
 __x64_sys_recvmsg+0x1e8/0x2c0 net/socket.c:2908
 x64_sys_call+0xdb5/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:48
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x58/0xf0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7fcb7d5d2909
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 18 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fcb7d55d158 EFLAGS: 00000246 ORIG_RAX: 000000000000002f
RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 00007fcb7d5d2909
RDX: 0000000040010041 RSI: 0000200000000840 RDI: 0000000000000003
RBP: 0000200000000840 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fcb7d65c3fc
R13: 0000000000000000 R14: 00007ffd676d9290 R15: 00007ffd676d9378
 </TASK>

Allocated by task 299:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:565
 unpoison_slab_object mm/kasan/common.c:319 [inline]
 __kasan_slab_alloc+0x73/0x90 mm/kasan/common.c:345
 kasan_slab_alloc include/linux/kasan.h:250 [inline]
 slab_post_alloc_hook mm/slub.c:4164 [inline]
 slab_alloc_node mm/slub.c:4213 [inline]
 kmem_cache_alloc_node_noprof+0x139/0x3b0 mm/slub.c:4267
 __alloc_skb+0x10c/0x370 net/core/skbuff.c:677
 alloc_skb include/linux/skbuff.h:1331 [inline]
 alloc_skb_with_frags+0xce/0x8b0 net/core/skbuff.c:6622
 sock_alloc_send_pskb+0x858/0x990 net/core/sock.c:2902
 sock_alloc_send_skb include/net/sock.h:1836 [inline]
 queue_oob+0xe7/0x4f0 net/unix/af_unix.c:2198
 unix_stream_sendmsg+0xf19/0x1080 net/unix/af_unix.c:2352
 sock_sendmsg_nosec net/socket.c:730 [inline]
 __sock_sendmsg net/socket.c:745 [inline]
 ____sys_sendmsg+0xa15/0xa70 net/socket.c:2610
 ___sys_sendmsg+0x220/0x2a0 net/socket.c:2664
 __sys_sendmsg net/socket.c:2693 [inline]
 __do_sys_sendmsg net/socket.c:2702 [inline]
 __se_sys_sendmsg net/socket.c:2700 [inline]
 __x64_sys_sendmsg+0x1eb/0x2c0 net/socket.c:2700
 x64_sys_call+0x2a4c/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:47
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x58/0xf0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x76/0x7e

Freed by task 301:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
 kasan_save_free_info+0x4a/0x60 mm/kasan/generic.c:579
 poison_slab_object mm/kasan/common.c:247 [inline]
 __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:264
 kasan_slab_free include/linux/kasan.h:233 [inline]
 slab_free_hook mm/slub.c:2413 [inline]
 slab_free mm/slub.c:4662 [inline]
 kmem_cache_free+0x1c1/0x510 mm/slub.c:4769
 kfree_skbmem net/core/skbuff.c:-1 [inline]
 __kfree_skb+0x18f/0x210 net/core/skbuff.c:1215
 consume_skb+0x65/0x1a0 net/core/skbuff.c:1446
 unix_stream_read_generic+0x1d36/0x22d0 net/unix/af_unix.c:2919
 unix_stream_recvmsg+0x16c/0x1c0 net/unix/af_unix.c:2998
 sock_recvmsg_nosec net/socket.c:1052 [inline]
 sock_recvmsg+0x219/0x270 net/socket.c:1074
 sock_read_iter+0x232/0x2f0 net/socket.c:1144
 new_sync_read fs/read_write.c:489 [inline]
 vfs_read+0x540/0xb60 fs/read_write.c:570
 ksys_read+0x141/0x250 fs/read_write.c:713
 __do_sys_read fs/read_write.c:723 [inline]
 __se_sys_read fs/read_write.c:721 [inline]
 __x64_sys_read+0x7f/0x90 fs/read_write.c:721
 x64_sys_call+0x2638/0x2ee0 arch/x86/include/generated/asm/syscalls_64.h:1
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x58/0xf0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x76/0x7e

The buggy address belongs to the object at ffff8881027f4780
 which belongs to the cache skbuff_head_cache of size 256
The buggy address is located 68 bytes inside of
 freed 256-byte region [ffff8881027f4780, ffff8881027f4880)

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027f4
flags: 0x4000000000000000(zone=1)
page_type: f5(slab)
raw: 4000000000000000 ffff888106649b40 dead000000000122 0000000000000000
raw: 0000000000000000 00000000000c000c 00000001f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 292, tgid 292 (sshd-session), ts 26431126717, free_ts 20666596481
 set_page_owner include/linux/page_owner.h:35 [inline]
 post_alloc_hook+0x3b9/0x3f0 mm/page_alloc.c:1795
 prep_new_page+0x1c/0x120 mm/page_alloc.c:1803
 get_page_from_freelist+0x46bb/0x4750 mm/page_alloc.c:3854
 __alloc_pages_noprof+0x30d/0x6c0 mm/page_alloc.c:5186
 alloc_slab_page+0x6b/0x1f0 mm/slub.c:-1
 allocate_slab+0x69/0x440 mm/slub.c:2655
 new_slab mm/slub.c:2709 [inline]
 ___slab_alloc+0x59a/0x8b0 mm/slub.c:3897
 __slab_alloc mm/slub.c:3987 [inline]
 __slab_alloc_node mm/slub.c:4040 [inline]
 slab_alloc_node mm/slub.c:4201 [inline]
 kmem_cache_alloc_noprof+0x202/0x3a0 mm/slub.c:4222
 skb_clone+0x229/0x460 net/core/skbuff.c:2094
 dev_queue_xmit_nit+0x1ad/0xae0 net/core/dev.c:2386
 xmit_one net/core/dev.c:3655 [inline]
 dev_hard_start_xmit+0x187/0x770 net/core/dev.c:3678
 sch_direct_xmit+0x259/0x8f0 net/sched/sch_generic.c:343
 __dev_xmit_skb net/core/dev.c:3904 [inline]
 __dev_queue_xmit+0x16c3/0x3790 net/core/dev.c:4480
 dev_queue_xmit include/linux/netdevice.h:3141 [inline]
 neigh_hh_output include/net/neighbour.h:534 [inline]
 neigh_output include/net/neighbour.h:548 [inline]
 ip_finish_output2+0xbd7/0xf20 net/ipv4/ip_output.c:236
 __ip_finish_output+0x17b/0x3e0 net/ipv4/ip_output.c:-1
 ip_finish_output+0x35/0x360 net/ipv4/ip_output.c:324
page last free pid 147 tgid 147 stack trace:
 reset_page_owner include/linux/page_owner.h:28 [inline]
 free_pages_prepare mm/page_alloc.c:1321 [inline]
 free_unref_page+0xae5/0xdd0 mm/page_alloc.c:2810
 __free_pages+0x6b/0x3b0 mm/page_alloc.c:5273
 __free_slab+0xb6/0x110 mm/slub.c:2726
 free_slab+0x18/0xf0 mm/slub.c:2749
 discard_slab mm/slub.c:2755 [inline]
 __put_partials+0x11b/0x150 mm/slub.c:3224
 put_cpu_partial+0x91/0xc0 mm/slub.c:3299
 __slab_free+0x1d3/0x2b0 mm/slub.c:4532
 do_slab_free mm/slub.c:4614 [inline]
 ___cache_free+0xc9/0xe0 mm/slub.c:4725
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0xb5/0x130 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x14f/0x180 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x28/0x90 mm/kasan/common.c:329
 kasan_slab_alloc include/linux/kasan.h:250 [inline]
 slab_post_alloc_hook mm/slub.c:4164 [inline]
 slab_alloc_node mm/slub.c:4213 [inline]
 kmem_cache_alloc_node_noprof+0x139/0x3b0 mm/slub.c:4267
 __alloc_skb+0x10c/0x370 net/core/skbuff.c:677
 alloc_skb include/linux/skbuff.h:1331 [inline]
 alloc_skb_with_frags+0xce/0x8b0 net/core/skbuff.c:6622
 sock_alloc_send_pskb+0x858/0x990 net/core/sock.c:2902
 unix_dgram_sendmsg+0x59a/0x1b70 net/unix/af_unix.c:2027

Memory state around the buggy address:
 ffff8881027f4680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881027f4700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff8881027f4780: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                           ^
 ffff8881027f4800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881027f4880: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/13 14:16 android16-6.12 21ed84930c16 3cda49cf .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci2-android-6-12-rust KASAN: slab-use-after-free Read in unix_stream_read_actor
2025/07/13 10:35 android16-6.12 21ed84930c16 3cda49cf .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-12-rust KASAN: slab-use-after-free Read in unix_stream_read_actor
* Struck through repros no longer work on HEAD.