syzbot


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

Status: upstream: reported on 2026/03/31 09:07
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+001b9efd14d3e8fac896@syzkaller.appspotmail.com
First crash: 5d22h, last: 9h52m
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [mm?] KASAN: slab-use-after-free Read in madvise_walk_vmas 3 (4) 2026/03/31 11:54

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in madvise_walk_vmas+0x661/0xae0 mm/madvise.c:1733
Read of size 8 at addr ffff888033df6c88 by task syz.4.414/7018

CPU: 0 UID: 0 PID: 7018 Comm: syz.4.414 Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/18/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 print_address_description+0x55/0x1e0 mm/kasan/report.c:378
 print_report+0x58/0x70 mm/kasan/report.c:482
 kasan_report+0x117/0x150 mm/kasan/report.c:595
 madvise_walk_vmas+0x661/0xae0 mm/madvise.c:1733
 madvise_do_behavior+0x386/0x540 mm/madvise.c:1936
 do_madvise+0x1fa/0x2e0 mm/madvise.c:2029
 __do_sys_madvise mm/madvise.c:2038 [inline]
 __se_sys_madvise mm/madvise.c:2036 [inline]
 __x64_sys_madvise+0xa6/0xc0 mm/madvise.c:2036
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f2e0819c819
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:00007f2e08fe4028 EFLAGS: 00000246 ORIG_RAX: 000000000000001c
RAX: ffffffffffffffda RBX: 00007f2e08416090 RCX: 00007f2e0819c819
RDX: 0000000000000019 RSI: 0000000008000000 RDI: 0000200000000000
RBP: 00007f2e08232c91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f2e08416128 R14: 00007f2e08416090 R15: 00007ffdf4326698
 </TASK>

Allocated by task 5848:
 kasan_save_stack mm/kasan/common.c:57 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
 unpoison_slab_object mm/kasan/common.c:340 [inline]
 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:366
 kasan_slab_alloc include/linux/kasan.h:253 [inline]
 slab_post_alloc_hook mm/slub.c:4569 [inline]
 slab_alloc_node mm/slub.c:4898 [inline]
 kmem_cache_alloc_noprof+0x2bc/0x650 mm/slub.c:4905
 vm_area_dup+0x2b/0x680 mm/vma_init.c:123
 dup_mmap+0x8b1/0x1d90 mm/mmap.c:1786
 dup_mm kernel/fork.c:1533 [inline]
 copy_mm+0x13b/0x4a0 kernel/fork.c:1585
 copy_process+0x1efd/0x4430 kernel/fork.c:2260
 kernel_clone+0x26d/0x8e0 kernel/fork.c:2709
 __do_sys_clone kernel/fork.c:2850 [inline]
 __se_sys_clone kernel/fork.c:2834 [inline]
 __x64_sys_clone+0x1b6/0x230 kernel/fork.c:2834
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 13:
 kasan_save_stack mm/kasan/common.c:57 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584
 poison_slab_object mm/kasan/common.c:253 [inline]
 __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285
 kasan_slab_free include/linux/kasan.h:235 [inline]
 slab_free_hook mm/slub.c:2689 [inline]
 slab_free_after_rcu_debug+0x12a/0x220 mm/slub.c:6304
 rcu_do_batch kernel/rcu/tree.c:2617 [inline]
 rcu_core+0x7cd/0x1070 kernel/rcu/tree.c:2869
 handle_softirqs+0x22a/0x840 kernel/softirq.c:622
 do_softirq+0x76/0xd0 kernel/softirq.c:523
 __local_bh_enable_ip+0xf8/0x130 kernel/softirq.c:450
 local_bh_enable include/linux/bottom_half.h:33 [inline]
 __alloc_skb+0x1aa/0x7d0 net/core/skbuff.c:697
 alloc_skb include/linux/skbuff.h:1383 [inline]
 nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:819 [inline]
 nsim_dev_trap_report drivers/net/netdevsim/dev.c:876 [inline]
 nsim_dev_trap_report_work+0x29a/0xb80 drivers/net/netdevsim/dev.c:922
 process_one_work kernel/workqueue.c:3278 [inline]
 process_scheduled_works+0xb5d/0x1860 kernel/workqueue.c:3361
 worker_thread+0xa53/0xfc0 kernel/workqueue.c:3442
 kthread+0x388/0x470 kernel/kthread.c:436
 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Last potentially related work creation:
 kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57
 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556
 slab_free_hook mm/slub.c:2650 [inline]
 slab_free mm/slub.c:6242 [inline]
 kmem_cache_free+0x44f/0x650 mm/slub.c:6369
 remove_vma mm/vma.c:473 [inline]
 vms_complete_munmap_vmas+0x929/0xc60 mm/vma.c:1415
 do_vmi_align_munmap+0x3b7/0x4b0 mm/vma.c:1660
 do_vmi_munmap+0x252/0x2d0 mm/vma.c:1708
 do_munmap+0xf9/0x170 mm/mmap.c:1067
 mremap_to+0x353/0x880 mm/mremap.c:1450
 do_mremap mm/mremap.c:2001 [inline]
 __do_sys_mremap mm/mremap.c:2057 [inline]
 __se_sys_mremap+0xe6d/0x11d0 mm/mremap.c:2025
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff888033df6c80
 which belongs to the cache vm_area_struct of size 256
The buggy address is located 8 bytes inside of
 freed 256-byte region [ffff888033df6c80, ffff888033df6d80)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x33df6
memcg:ffff88802923ca01
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff88801c294b40 dead000000000100 dead000000000122
raw: 0000000000000000 00000008000c000c 00000000f5000000 ffff88802923ca01
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5210, tgid 5210 (udevd), ts 30135169828, free_ts 27667351358
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x231/0x280 mm/page_alloc.c:1858
 prep_new_page mm/page_alloc.c:1866 [inline]
 get_page_from_freelist+0x24ba/0x2540 mm/page_alloc.c:3946
 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5226
 alloc_slab_page mm/slub.c:3278 [inline]
 allocate_slab+0x77/0x660 mm/slub.c:3467
 new_slab mm/slub.c:3525 [inline]
 refill_objects+0x339/0x3d0 mm/slub.c:7247
 refill_sheaf mm/slub.c:2816 [inline]
 __pcs_replace_empty_main+0x321/0x720 mm/slub.c:4651
 alloc_from_pcs mm/slub.c:4749 [inline]
 slab_alloc_node mm/slub.c:4883 [inline]
 kmem_cache_alloc_noprof+0x37d/0x650 mm/slub.c:4905
 vm_area_dup+0x2b/0x680 mm/vma_init.c:123
 dup_mmap+0x8b1/0x1d90 mm/mmap.c:1786
 dup_mm kernel/fork.c:1533 [inline]
 copy_mm+0x13b/0x4a0 kernel/fork.c:1585
 copy_process+0x1efd/0x4430 kernel/fork.c:2260
 kernel_clone+0x26d/0x8e0 kernel/fork.c:2709
 __do_sys_clone kernel/fork.c:2850 [inline]
 __se_sys_clone kernel/fork.c:2834 [inline]
 __x64_sys_clone+0x1b6/0x230 kernel/fork.c:2834
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 1 tgid 1 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 __free_pages_prepare mm/page_alloc.c:1402 [inline]
 __free_frozen_pages+0xbc7/0xd30 mm/page_alloc.c:2943
 kasan_depopulate_vmalloc_pte+0x6d/0x90 mm/kasan/shadow.c:484
 apply_to_pte_range mm/memory.c:3324 [inline]
 apply_to_pmd_range mm/memory.c:3368 [inline]
 apply_to_pud_range mm/memory.c:3404 [inline]
 apply_to_p4d_range mm/memory.c:3440 [inline]
 __apply_to_page_range+0xbdc/0x1420 mm/memory.c:3476
 __kasan_release_vmalloc+0xa2/0xd0 mm/kasan/shadow.c:602
 kasan_release_vmalloc include/linux/kasan.h:593 [inline]
 kasan_release_vmalloc_node mm/vmalloc.c:2284 [inline]
 purge_vmap_node+0x220/0x960 mm/vmalloc.c:2306
 __purge_vmap_area_lazy+0x779/0xb40 mm/vmalloc.c:2396
 _vm_unmap_aliases+0x73d/0x7e0 mm/vmalloc.c:2990
 change_page_attr_set_clr+0x305/0xf70 arch/x86/mm/pat/set_memory.c:2095
 change_page_attr_set arch/x86/mm/pat/set_memory.c:2136 [inline]
 set_memory_nx+0xd6/0x110 arch/x86/mm/pat/set_memory.c:2312
 free_init_pages arch/x86/mm/init.c:933 [inline]
 free_kernel_image_pages+0x85/0x100 arch/x86/mm/init.c:952
 kernel_init+0x31/0x1d0 init/main.c:1600
 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Memory state around the buggy address:
 ffff888033df6b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888033df6c00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
>ffff888033df6c80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff888033df6d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888033df6d80: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
==================================================================

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/04/01 14:18 linux-next 36ece9697e89 0285fe54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in madvise_walk_vmas
2026/04/01 14:14 linux-next 36ece9697e89 0285fe54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in madvise_walk_vmas
2026/04/01 10:53 linux-next 36ece9697e89 fb8b2c26 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in madvise_walk_vmas
2026/04/01 10:53 linux-next 36ece9697e89 fb8b2c26 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in madvise_walk_vmas
2026/04/01 02:15 linux-next 36ece9697e89 fb8b2c26 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in madvise_walk_vmas
2026/03/31 13:42 linux-next cf7c3c02fdd0 aeea1c72 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in madvise_walk_vmas
2026/03/31 13:42 linux-next cf7c3c02fdd0 aeea1c72 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in madvise_walk_vmas
2026/03/27 02:02 linux-next e77a5a5cfe43 50cdcaa1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-use-after-free Read in madvise_walk_vmas
* Struck through repros no longer work on HEAD.