syzbot


KCSAN: data-race in __unmap_hugepage_range / alloc_surplus_hugetlb_folio

Status: moderation: reported on 2025/08/14 16:21
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+417aeb05fd190f3a6da9@syzkaller.appspotmail.com
First crash: 1d18h, last: 1d18h

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __unmap_hugepage_range / alloc_surplus_hugetlb_folio

write to 0xffffffff88e73818 of 8 bytes by task 30243 on cpu 1:
 alloc_surplus_hugetlb_folio+0x26f/0x2d0 mm/hugetlb.c:2272
 gather_surplus_pages mm/hugetlb.c:2434 [inline]
 hugetlb_acct_memory+0x32f/0xa50 mm/hugetlb.c:5317
 hugetlb_reserve_pages+0x767/0xc00 mm/hugetlb.c:7328
 hugetlbfs_file_mmap+0x27e/0x340 fs/hugetlbfs/inode.c:153
 vfs_mmap include/linux/fs.h:2289 [inline]
 mmap_file mm/internal.h:167 [inline]
 __mmap_new_file_vma mm/vma.c:2413 [inline]
 __mmap_new_vma mm/vma.c:2476 [inline]
 __mmap_region mm/vma.c:2669 [inline]
 mmap_region+0xfad/0x1630 mm/vma.c:2739
 do_mmap+0x9b3/0xbe0 mm/mmap.c:558
 vm_mmap_pgoff+0x17a/0x2e0 mm/util.c:580
 ksys_mmap_pgoff+0x2d0/0x310 mm/mmap.c:604
 x64_sys_call+0x14a3/0x2ff0 arch/x86/include/generated/asm/syscalls_64.h:10
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffffffff88e73818 of 8 bytes by task 30241 on cpu 0:
 __unmap_hugepage_range+0xad6/0x1290 mm/hugetlb.c:5954
 unmap_single_vma mm/memory.c:1928 [inline]
 unmap_vmas+0x2f0/0x3a0 mm/memory.c:1976
 vms_clear_ptes+0x1f7/0x2d0 mm/vma.c:1228
 vms_complete_munmap_vmas+0x159/0x440 mm/vma.c:1277
 do_vmi_align_munmap+0x383/0x3d0 mm/vma.c:1536
 do_vmi_munmap+0x1db/0x220 mm/vma.c:1584
 shrink_vma mm/mremap.c:1335 [inline]
 mremap_at+0x110/0x630 mm/mremap.c:1566
 do_mremap mm/mremap.c:1925 [inline]
 __do_sys_mremap mm/mremap.c:1981 [inline]
 __se_sys_mremap+0x6c5/0xc60 mm/mremap.c:1949
 __x64_sys_mremap+0x67/0x80 mm/mremap.c:1949
 x64_sys_call+0x2a24/0x2ff0 arch/x86/include/generated/asm/syscalls_64.h:26
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0000000000000001 -> 0x0000000000000002

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 30241 Comm: syz.5.7987 Tainted: G        W           6.17.0-rc1-syzkaller-00038-g0cc53520e68b #0 PREEMPT(voluntary) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/14 16:21 upstream 0cc53520e68b 5d8c2ac2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __unmap_hugepage_range / alloc_surplus_hugetlb_folio
* Struck through repros no longer work on HEAD.