syzbot


kernel BUG in alloc_hugetlb_folio_reserve

Status: upstream: reported C repro on 2025/01/04 12:25
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+a504cb5bae4fe117ba94@syzkaller.appspotmail.com
First crash: 37d, last: 4d20h
Cause bisection: introduced by (bisect log) :
commit c6a3194c05e7e6fd0e8fbfb1720084ae2503c4ac
Author: Vivek Kasireddy <vivek.kasireddy@intel.com>
Date: Mon Jun 24 06:36:16 2024 +0000

  udmabuf: pin the pages using memfd_pin_folios() API

Crash: kernel BUG in free_huge_folio (log)
Repro: C syz .config
  
Discussions (3)
Title Replies (including bot) Last reply
[syzbot] [mm?] kernel BUG in alloc_hugetlb_folio_reserve 4 (10) 2025/02/03 19:25
[PATCH v2 1/2] mm/memfd: reserve hugetlb folios before allocation 5 (5) 2025/01/20 08:02
[PATCH] mm/memfd: reserve hugetlb folios before allocation 8 (8) 2025/01/10 15:22
Last patch testing requests (2)
Created Duration User Patch Repo Result
2025/02/03 18:52 31m vivek.kasireddy@intel.com https://gitlab.freedesktop.org/Vivek/drm-tip.git syzbot_fix_htlb_reserve_v2_rebase OK log
2025/02/02 04:52 41m vivek.kasireddy@intel.com https://gitlab.freedesktop.org/Vivek/drm-tip.git syzbot_fix_htlb_reserve error

Sample crash report:
------------[ cut here ]------------
kernel BUG at mm/hugetlb.c:2333!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 0 UID: 0 PID: 5832 Comm: syz-executor274 Not tainted 6.13.0-syzkaller-09760-g69e858e0b8b2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
RIP: 0010:alloc_hugetlb_folio_reserve+0xbc/0xc0 mm/hugetlb.c:2333
Code: 1f eb 05 e8 c6 e9 9f ff 48 c7 c7 40 56 61 8e e8 1a 9b d8 09 4c 89 f0 5b 41 5c 41 5e 41 5f 5d c3 cc cc cc cc e8 a5 e9 9f ff 90 <0f> 0b 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f
RSP: 0018:ffffc90003e3f7f8 EFLAGS: 00010093
RAX: ffffffff821f831b RBX: 0000000000000000 RCX: ffff888034813c00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 1ffffffff348b4d1 R08: ffffffff821f82d3 R09: 1ffffd40005a2005
R10: dffffc0000000000 R11: fffff940005a2006 R12: dffffc0000000000
R13: dffffc0000000000 R14: ffffea0002d10000 R15: ffffffff9a45a688
FS:  000055557d1c0380(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000563d6d164000 CR3: 000000007abaa000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 memfd_alloc_folio+0x1bd/0x370 mm/memfd.c:88
 memfd_pin_folios+0xf10/0x1570 mm/gup.c:3746
 udmabuf_pin_folios drivers/dma-buf/udmabuf.c:346 [inline]
 udmabuf_create+0x70e/0x10c0 drivers/dma-buf/udmabuf.c:443
 udmabuf_ioctl_create drivers/dma-buf/udmabuf.c:495 [inline]
 udmabuf_ioctl+0x301/0x4e0 drivers/dma-buf/udmabuf.c:526
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:906 [inline]
 __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcd524733a9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffddb5cce58 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffddb5cd028 RCX: 00007fcd524733a9
RDX: 0000000020000040 RSI: 0000000040187542 RDI: 0000000000000004
RBP: 00007fcd524e6610 R08: 0000000020000000 R09: 00007ffddb5cd028
R10: 0000000020000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffddb5cd018 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:alloc_hugetlb_folio_reserve+0xbc/0xc0 mm/hugetlb.c:2333
Code: 1f eb 05 e8 c6 e9 9f ff 48 c7 c7 40 56 61 8e e8 1a 9b d8 09 4c 89 f0 5b 41 5c 41 5e 41 5f 5d c3 cc cc cc cc e8 a5 e9 9f ff 90 <0f> 0b 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f
RSP: 0018:ffffc90003e3f7f8 EFLAGS: 00010093
RAX: ffffffff821f831b RBX: 0000000000000000 RCX: ffff888034813c00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 1ffffffff348b4d1 R08: ffffffff821f82d3 R09: 1ffffd40005a2005
R10: dffffc0000000000 R11: fffff940005a2006 R12: dffffc0000000000
R13: dffffc0000000000 R14: ffffea0002d10000 R15: ffffffff9a45a688
FS:  000055557d1c0380(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000563d6d164000 CR3: 000000007abaa000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/02/01 20:51 upstream 69e858e0b8b2 0dff8567 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce kernel BUG in alloc_hugetlb_folio_reserve
2025/02/01 20:19 upstream 69e858e0b8b2 0dff8567 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce kernel BUG in alloc_hugetlb_folio_reserve
2025/01/09 12:26 upstream eea6e4b4dfb8 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 kernel BUG in alloc_hugetlb_folio_reserve
2025/01/07 16:52 upstream fbfd64d25c7a f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 kernel BUG in alloc_hugetlb_folio_reserve
2025/01/04 06:24 upstream 63676eefb7a0 f3558dbf .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in alloc_hugetlb_folio_reserve
2025/01/01 07:27 upstream ccb98ccef0e5 d3ccff63 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in alloc_hugetlb_folio_reserve
2025/01/02 09:23 upstream 56e6a3499e14 d3ccff63 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 kernel BUG in alloc_hugetlb_folio_reserve
2024/12/31 16:20 upstream ccb98ccef0e5 d3ccff63 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 kernel BUG in alloc_hugetlb_folio_reserve
2024/12/31 12:15 upstream ccb98ccef0e5 d3ccff63 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 kernel BUG in alloc_hugetlb_folio_reserve
2024/12/31 12:15 upstream ccb98ccef0e5 d3ccff63 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 kernel BUG in alloc_hugetlb_folio_reserve
* Struck through repros no longer work on HEAD.