syzbot


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

Status: auto-obsoleted due to no activity on 2025/01/02 12:32
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+6926ab9f6f7d7b50002e@syzkaller.appspotmail.com
First crash: 128d, last: 102d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [mm?] KASAN: slab-use-after-free Read in shrinker_free 2 (3) 2024/09/18 22:55
Last patch testing requests (7)
Created Duration User Patch Repo Result
2025/01/02 12:10 21m retest repro upstream OK log
2024/10/24 12:13 19m retest repro upstream OK log
2024/10/24 10:21 22m retest repro upstream report log
2024/10/24 10:21 22m retest repro upstream OK log
2024/10/24 10:21 22m retest repro upstream OK log
2024/10/24 10:21 22m retest repro upstream OK log
2024/10/24 10:21 19m retest repro upstream OK log

Sample crash report:
svc: failed to register nfsdv3 RPC service (errno 101).
svc: failed to register nfsaclv3 RPC service (errno 101).
==================================================================
BUG: KASAN: slab-use-after-free in shrinker_free+0x3b7/0x430 mm/shrinker.c:775
Read of size 4 at addr ffff88802fe35d1c by task syz.1.3567/22927

CPU: 0 UID: 0 PID: 22927 Comm: syz.1.3567 Not tainted 6.12.0-rc2-syzkaller-00074-gd3d1556696c1 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:377 [inline]
 print_report+0xc3/0x620 mm/kasan/report.c:488
 kasan_report+0xd9/0x110 mm/kasan/report.c:601
 shrinker_free+0x3b7/0x430 mm/shrinker.c:775
 nfsd_file_cache_shutdown+0xbc/0x4e0 fs/nfsd/filecache.c:923
 nfsd_shutdown_generic fs/nfsd/nfssvc.c:314 [inline]
 nfsd_shutdown_generic fs/nfsd/nfssvc.c:308 [inline]
 nfsd_startup_net fs/nfsd/nfssvc.c:429 [inline]
 nfsd_svc+0x6a9/0x940 fs/nfsd/nfssvc.c:820
 nfsd_nl_threads_set_doit+0x535/0xbe0 fs/nfsd/nfsctl.c:1722
 genl_family_rcv_msg_doit+0x202/0x2f0 net/netlink/genetlink.c:1115
 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
 genl_rcv_msg+0x565/0x800 net/netlink/genetlink.c:1210
 netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2550
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
 netlink_unicast+0x53c/0x7f0 net/netlink/af_netlink.c:1357
 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1901
 sock_sendmsg_nosec net/socket.c:729 [inline]
 __sock_sendmsg net/socket.c:744 [inline]
 ____sys_sendmsg+0x9ae/0xb40 net/socket.c:2602
 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2656
 __sys_sendmsg+0x117/0x1f0 net/socket.c:2685
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5730d7dff9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f5731a97038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f5730f36058 RCX: 00007f5730d7dff9
RDX: 0000000000008004 RSI: 0000000020000140 RDI: 0000000000000006
RBP: 00007f5730df0296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f5730f36058 R15: 00007fffd036add8
 </TASK>

Allocated by task 22856:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
 __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394
 kmalloc_noprof include/linux/slab.h:878 [inline]
 kzalloc_noprof include/linux/slab.h:1014 [inline]
 shrinker_alloc+0xf8/0xb00 mm/shrinker.c:683
 nfsd_file_cache_init+0x1cb/0x4c0 fs/nfsd/filecache.c:775
 nfsd_startup_generic fs/nfsd/nfssvc.c:292 [inline]
 nfsd_startup_net fs/nfsd/nfssvc.c:387 [inline]
 nfsd_svc+0x5db/0x940 fs/nfsd/nfssvc.c:820
 nfsd_nl_threads_set_doit+0x535/0xbe0 fs/nfsd/nfsctl.c:1722
 genl_family_rcv_msg_doit+0x202/0x2f0 net/netlink/genetlink.c:1115
 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
 genl_rcv_msg+0x565/0x800 net/netlink/genetlink.c:1210
 netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2550
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
 netlink_unicast+0x53c/0x7f0 net/netlink/af_netlink.c:1357
 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1901
 sock_sendmsg_nosec net/socket.c:729 [inline]
 __sock_sendmsg net/socket.c:744 [inline]
 ____sys_sendmsg+0x9ae/0xb40 net/socket.c:2602
 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2656
 __sys_sendmsg+0x117/0x1f0 net/socket.c:2685
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 11:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579
 poison_slab_object mm/kasan/common.c:247 [inline]
 __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:2342 [inline]
 slab_free mm/slub.c:4579 [inline]
 kfree+0x14f/0x4b0 mm/slub.c:4727
 rcu_do_batch kernel/rcu/tree.c:2567 [inline]
 rcu_core+0x79d/0x14d0 kernel/rcu/tree.c:2823
 handle_softirqs+0x213/0x8f0 kernel/softirq.c:554
 do_softirq kernel/softirq.c:455 [inline]
 do_softirq+0xb2/0xf0 kernel/softirq.c:442
 __local_bh_enable_ip+0x100/0x120 kernel/softirq.c:382
 spin_unlock_bh include/linux/spinlock.h:396 [inline]
 cfg80211_inform_single_bss_data+0x974/0x1e40 net/wireless/scan.c:2349
 cfg80211_inform_bss_data+0x254/0x3e30 net/wireless/scan.c:3184
 cfg80211_inform_bss_frame_data+0x253/0x8a0 net/wireless/scan.c:3279
 ieee80211_bss_info_update+0x311/0xab0 net/mac80211/scan.c:226
 ieee80211_rx_bss_info net/mac80211/ibss.c:1100 [inline]
 ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1579 [inline]
 ieee80211_ibss_rx_queued_mgmt+0x1952/0x3030 net/mac80211/ibss.c:1606
 ieee80211_iface_process_skb net/mac80211/iface.c:1603 [inline]
 ieee80211_iface_work+0xc0b/0xf00 net/mac80211/iface.c:1657
 cfg80211_wiphy_work+0x3d9/0x550 net/wireless/core.c:440
 process_one_work+0x958/0x1b30 kernel/workqueue.c:3229
 process_scheduled_works kernel/workqueue.c:3310 [inline]
 worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391
 kthread+0x2c1/0x3a0 kernel/kthread.c:389
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

Last potentially related work creation:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541
 __call_rcu_common.constprop.0+0x99/0x7a0 kernel/rcu/tree.c:3086
 shrinker_free+0xfe/0x430 mm/shrinker.c:807
 nfsd_file_cache_shutdown+0xbc/0x4e0 fs/nfsd/filecache.c:923
 nfsd_shutdown_generic fs/nfsd/nfssvc.c:314 [inline]
 nfsd_shutdown_generic fs/nfsd/nfssvc.c:308 [inline]
 nfsd_startup_net fs/nfsd/nfssvc.c:429 [inline]
 nfsd_svc+0x6a9/0x940 fs/nfsd/nfssvc.c:820
 nfsd_nl_threads_set_doit+0x535/0xbe0 fs/nfsd/nfsctl.c:1722
 genl_family_rcv_msg_doit+0x202/0x2f0 net/netlink/genetlink.c:1115
 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
 genl_rcv_msg+0x565/0x800 net/netlink/genetlink.c:1210
 netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2550
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
 netlink_unicast+0x53c/0x7f0 net/netlink/af_netlink.c:1357
 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1901
 sock_sendmsg_nosec net/socket.c:729 [inline]
 __sock_sendmsg net/socket.c:744 [inline]
 ____sys_sendmsg+0x9ae/0xb40 net/socket.c:2602
 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2656
 __sys_sendmsg+0x117/0x1f0 net/socket.c:2685
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff88802fe35d00
 which belongs to the cache kmalloc-192 of size 192
The buggy address is located 28 bytes inside of
 freed 192-byte region [ffff88802fe35d00, ffff88802fe35dc0)

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802fe35c00 pfn:0x2fe35
flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000200 ffff88801ac413c0 ffffea0000b76590 ffffea0001e9f590
raw: ffff88802fe35c00 000000000010000f 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 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 5235, tgid 5235 (syz-executor), ts 140013155476, free_ts 140006145667
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1537
 prep_new_page mm/page_alloc.c:1545 [inline]
 get_page_from_freelist+0x101e/0x3070 mm/page_alloc.c:3457
 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4733
 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
 alloc_slab_page mm/slub.c:2414 [inline]
 allocate_slab mm/slub.c:2578 [inline]
 new_slab+0xca/0x3f0 mm/slub.c:2631
 ___slab_alloc+0xd1d/0x16f0 mm/slub.c:3818
 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908
 __slab_alloc_node mm/slub.c:3961 [inline]
 slab_alloc_node mm/slub.c:4122 [inline]
 __do_kmalloc_node mm/slub.c:4263 [inline]
 __kmalloc_node_noprof+0x367/0x440 mm/slub.c:4270
 kmalloc_array_node_noprof include/linux/slab.h:995 [inline]
 alloc_slab_obj_exts+0x41/0xa0 mm/slub.c:1968
 __memcg_slab_post_alloc_hook+0x2a7/0x9b0 mm/memcontrol.c:2982
 memcg_slab_post_alloc_hook mm/slub.c:2156 [inline]
 slab_post_alloc_hook mm/slub.c:4095 [inline]
 slab_alloc_node mm/slub.c:4134 [inline]
 kmem_cache_alloc_lru_noprof+0x2c8/0x2f0 mm/slub.c:4153
 __d_alloc+0x35/0x8c0 fs/dcache.c:1636
 d_alloc_pseudo+0x1c/0xc0 fs/dcache.c:1768
 alloc_path_pseudo fs/file_table.c:337 [inline]
 alloc_file_pseudo+0xd2/0x200 fs/file_table.c:353
 sock_alloc_file+0x50/0x1d0 net/socket.c:468
 sock_map_fd net/socket.c:493 [inline]
 __sys_socket+0x1c2/0x260 net/socket.c:1720
 __do_sys_socket net/socket.c:1725 [inline]
 __se_sys_socket net/socket.c:1723 [inline]
 __x64_sys_socket+0x72/0xb0 net/socket.c:1723
page last free pid 5217 tgid 5217 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1108 [inline]
 free_unref_page+0x5f4/0xdc0 mm/page_alloc.c:2638
 __put_partials+0x14c/0x170 mm/slub.c:3145
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329
 kasan_slab_alloc include/linux/kasan.h:247 [inline]
 slab_post_alloc_hook mm/slub.c:4085 [inline]
 slab_alloc_node mm/slub.c:4134 [inline]
 kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4141
 new_handle fs/jbd2/transaction.c:461 [inline]
 jbd2__journal_start+0x193/0x6a0 fs/jbd2/transaction.c:488
 __ext4_journal_start_sb+0x358/0x660 fs/ext4/ext4_jbd2.c:112
 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline]
 ext4_dirty_inode+0xa1/0x130 fs/ext4/inode.c:5981
 __mark_inode_dirty+0x1f6/0xe60 fs/fs-writeback.c:2493
 generic_update_time+0xcf/0xf0 fs/inode.c:2043
 inode_update_time fs/inode.c:2056 [inline]
 __file_update_time fs/inode.c:2245 [inline]
 file_update_time+0x12e/0x160 fs/inode.c:2275
 ext4_page_mkwrite+0x368/0x1760 fs/ext4/inode.c:6102
 do_page_mkwrite+0x177/0x380 mm/memory.c:3162
 wp_page_shared mm/memory.c:3563 [inline]
 do_wp_page+0xcbf/0x4930 mm/memory.c:3713
 handle_pte_fault mm/memory.c:5767 [inline]
 __handle_mm_fault+0x1a93/0x2a10 mm/memory.c:5894

Memory state around the buggy address:
 ffff88802fe35c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88802fe35c80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
>ffff88802fe35d00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff88802fe35d80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff88802fe35e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/10 10:20 upstream d3d1556696c1 a156c552 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/10/08 01:41 upstream 87d6aab2389e 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/10/06 23:17 upstream 2a130b7e1fcd d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/10/04 18:25 upstream 0c559323bbaa d7906eff .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/10/04 12:50 upstream 3840cbe24cf0 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/10/04 05:17 upstream 3840cbe24cf0 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/09/29 05:26 upstream 3efc57369a0c ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/09/28 09:01 upstream e477dba5442c 440b26ec .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/09/28 06:32 upstream e477dba5442c 440b26ec .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/09/20 23:01 upstream 176000734ee2 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/09/18 07:00 upstream a430d95c5efa c673ca06 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/09/17 22:35 upstream a430d95c5efa c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/09/16 08:06 upstream a4ebad655b98 08d8a733 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/09/15 00:24 upstream 57719771a244 08d8a733 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/09/14 22:35 upstream 57719771a244 08d8a733 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/09/14 19:24 upstream 57719771a244 08d8a733 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
2024/09/14 16:15 upstream 57719771a244 08d8a733 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in shrinker_free
* Struck through repros no longer work on HEAD.