WARNING: refcount bug in remove_inode_hugepages

Status: moderation: reported on 2026/10/19 23:28
Subsystems: mm fs
Labels: prio:high
[Documentation on labels]
Reported-by: syzbot+74088d3cd2953a2428fa@syzkaller.appspotmail.com
First crash: 4d12h, last: 4d12h
▶ ▼ ✨ AI Jobs (1)
ID Workflow Result Correct Bug Created Started Finished Revision
34f28ebb assessment-security DenialOfService: ✅ Exploitable: ✅ FilesystemTrigger: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ✅ UserNamespace: ✅ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ WARNING: refcount bug in remove_inode_hugepages 2026/10/17 01:35 2026/10/17 01:35 2026/10/17 02:18 432c0077

Sample crash report:
------------[ cut here ]------------
refcount_t: addition on 0; use-after-free.
WARNING: lib/refcount.c:25 at refcount_warn_saturate+0x9f/0x110 lib/refcount.c:25, CPU#0: syz.9.2312/14401
Modules linked in:
CPU: 0 UID: 0 PID: 14401 Comm: syz.9.2312 Tainted: G             L      syzkaller #0 PREEMPT_{RT,(full)} 
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026
RIP: 0010:refcount_warn_saturate+0x9f/0x110 lib/refcount.c:25
Code: eb 66 85 db 74 3e 83 fb 01 75 4c e8 5b ae f7 fc 48 8d 3d 24 9b ed 0b 67 48 0f b9 3a eb 4a e8 48 ae f7 fc 48 8d 3d 21 9b ed 0b <67> 48 0f b9 3a eb 37 e8 35 ae f7 fc 48 8d 3d 1e 9b ed 0b 67 48 0f
RSP: 0018:ffffc9001448f928 EFLAGS: 00010287
RAX: ffffffff84cf2b08 RBX: 0000000000000002 RCX: 0000000000080000
RDX: ffffc90021f14000 RSI: 00000000000006dc RDI: ffffffff90bcc630
RBP: ffffc9001448fbe8 R08: ffff88805d22ddc0 R09: 0000000000000005
R10: 0000000000000100 R11: 0000000000000004 R12: ffffea0001f58000
R13: dffffc0000000000 R14: ffff888060cd6801 R15: ffff88801bfae128
FS:  00007f1644f766c0(0000) GS:ffff8881249bb000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff7546e068 CR3: 00000000515a4000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 __refcount_add include/linux/refcount.h:-1 [inline]
 __refcount_inc include/linux/refcount.h:366 [inline]
 refcount_inc include/linux/refcount.h:383 [inline]
 kref_get include/linux/kref.h:45 [inline]
 hugetlb_unmap_file_folio fs/hugetlbfs/inode.c:413 [inline]
 remove_inode_single_folio fs/hugetlbfs/inode.c:512 [inline]
 remove_inode_hugepages+0xbe0/0x10f0 fs/hugetlbfs/inode.c:577
 hugetlb_vmtruncate fs/hugetlbfs/inode.c:621 [inline]
 hugetlbfs_setattr+0x4f0/0x6d0 fs/hugetlbfs/inode.c:856
 notify_change+0xbb8/0xec0 fs/attr.c:556
 do_truncate+0x1c2/0x250 fs/open.c:68
 do_ftruncate+0x4e0/0x590 fs/open.c:194
 ksys_ftruncate fs/open.c:206 [inline]
 __do_sys_ftruncate fs/open.c:211 [inline]
 __se_sys_ftruncate fs/open.c:209 [inline]
 __x64_sys_ftruncate+0x8f/0xe0 fs/open.c:209
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1646d1e559
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:00007f1644f76028 EFLAGS: 00000246 ORIG_RAX: 000000000000004d
RAX: ffffffffffffffda RBX: 00007f1646fa5fa0 RCX: 00007f1646d1e559
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000008
RBP: 00007f1646db58b0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f1646fa6038 R14: 00007f1646fa5fa0 R15: 00007fff5a5cefe8
 </TASK>
----------------
Code disassembly (best guess):
   0:	eb 66                	jmp    0x68
   2:	85 db                	test   %ebx,%ebx
   4:	74 3e                	je     0x44
   6:	83 fb 01             	cmp    $0x1,%ebx
   9:	75 4c                	jne    0x57
   b:	e8 5b ae f7 fc       	call   0xfcf7ae6b
  10:	48 8d 3d 24 9b ed 0b 	lea    0xbed9b24(%rip),%rdi        # 0xbed9b3b
  17:	67 48 0f b9 3a       	ud1    (%edx),%rdi
  1c:	eb 4a                	jmp    0x68
  1e:	e8 48 ae f7 fc       	call   0xfcf7ae6b
  23:	48 8d 3d 21 9b ed 0b 	lea    0xbed9b21(%rip),%rdi        # 0xbed9b4b
* 2a:	67 48 0f b9 3a       	ud1    (%edx),%rdi <-- trapping instruction
  2f:	eb 37                	jmp    0x68
  31:	e8 35 ae f7 fc       	call   0xfcf7ae6b
  36:	48 8d 3d 1e 9b ed 0b 	lea    0xbed9b1e(%rip),%rdi        # 0xbed9b5b
  3d:	67                   	addr32
  3e:	48                   	rex.W
  3f:	0f                   	.byte 0xf

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/10/15 23:15 upstream 0fcb05b72344 3f2522c6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in remove_inode_hugepages
* Struck through repros no longer work on HEAD.