From nobody Sat Feb 7 13:41:32 2026 Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13AE21F936 for ; Sun, 1 Feb 2026 05:48:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769924898; cv=none; b=T/42C10vksrPIiAqJabiz12CSz1fSRRyhdGQs9wLbWOf27POyHIDktNBzqfUzKPVM17M0HRUWgFJ6/YPZF+xbGwlWSf77QcB74HC+1UP86z7CikZ7QCc2PbG4F/N4DnjPSqqDtxZXEPoiw3njaSI3FQ4DHMCXaRwDuZIDn/1y3M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769924898; c=relaxed/simple; bh=zNxId+oRT5my+5GeKw6orMzAutAUpQF0PfWqGCohqS8=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=VpN7Eyd9J9LMMb2m+3yfv96wQAwZWL1tmRWiuwJERpW7O1d3d6LBdt8yVk6VkqGT72QZpNIGFbD/CJQ5uy9WWMqWG6Q8MBdqwvHDh+vdQCXh53OS+7wZwqFTkzHaiSqoMuWyKONQ3HZz0Vu6aF+8XwctEsqhwKH6Pkj7yoMOHTc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f71.google.com with SMTP id 006d021491bc7-6630b0a016aso10663989eaf.0 for ; Sat, 31 Jan 2026 21:48:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769924895; x=1770529695; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=O474SyZP+Y0sLqKFoOl8EXtWai+k7Ojd3rOyuL0nBlk=; b=WeNk5ChPhZjw310Ub/0Hyffsn3Rq1Jgf/tmIpCKFQfoC0yG/QdvYIzwNqV6+hVd1T9 wxiA2uJnrjyg5yDFgLl+sE7bUhI6Z0gkYsf95Yuw2hxv5hc3TDvnxy9CK1M8BEAtI0YM cOdFoj/OdtDAiuCPHZDHvlWpnkEbejlrVWmUltsxq/PmCmdMDxUXQ1ZJW5TzN8PcF/HL eNYK9mI8EyfQAvMpYFbUu+GMrpYmQtkKHdbpbf94eVAqiqE36DlUySXIZ3y4bQptk2BW I0GM6VExYrEnfVIQ1b+cC7bC5FXgmnEJe/TJlqQ/n//zeO1eOYnCo88cLRwdl0VJIq9c cmIA== X-Gm-Message-State: AOJu0YyZb2bz6kHSxA2MW//nnVBtSA+KUJy3WN+iucsj2QMsgCrPL+BY adeZm/wtbD9wDIyrmRZALRqxXrwbvUf2syTGHc3aRgoPq8W+5eNZ/m837s10NHdzUqh+QGzIdz/ TRqBZF8ZBXhQrRlZWCkfErw/linu2HqIiulIxiwAHlEGwuL7aUmQ27KcHl4s= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:3109:b0:663:888:6093 with SMTP id 006d021491bc7-6630f3956fcmr3834081eaf.70.1769924895586; Sat, 31 Jan 2026 21:48:15 -0800 (PST) Date: Sat, 31 Jan 2026 21:48:15 -0800 In-Reply-To: <697d115a.050a0220.1d61ec.0004.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <697ee91f.050a0220.1d0a41.0015.GAE@google.com> Subject: Forwarded: [PATCH] KVM: guest_memfd: Restrict to order-0 folios until large folio support is implemented From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] KVM: guest_memfd: Restrict to order-0 folios until large f= olio support is implemented Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master The kvm_gmem_fault_user_mapping() function currently triggers a warning when it receives large folios, as indicated by the WARN_ON_ONCE() at line 416. The code comment in kvm_gmem_get_folio() clearly states "TODO: Support huge pages", indicating that large folio support is not yet implemented. Without explicitly restricting the folio order, filemap_grab_folio() may opportunistically allocate large folios when memory is available, causing the warning to trigger and the page fault to fail with VM_FAULT_SIGBUS. Fix this by explicitly setting the mapping's folio order range to (0, 0) during inode initialization in __kvm_gmem_create(), ensuring only order-0 (single-page) folios are allocated until proper large folio support is added. Reproducer: mlock() on memory backed by guest_memfd with GUEST_MEMFD_FLAG_INIT_SHARED triggers the warning when large folios are allocated. Add debug logging to track folio order configuration and allocation for further investigation. Reported-by: syzbot+33a04338019ac7e43a44@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D33a04338019ac7e43a44 Signed-off-by: Deepanshu Kartikey --- virt/kvm/guest_memfd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c index fdaea3422c30..e513e0f735d0 100644 --- a/virt/kvm/guest_memfd.c +++ b/virt/kvm/guest_memfd.c @@ -412,7 +412,8 @@ static vm_fault_t kvm_gmem_fault_user_mapping(struct vm= _fault *vmf) =20 return vmf_error(PTR_ERR(folio)); } - + pr_info("KVM: fault got folio, large=3D%d order=3D%u\n", + folio_test_large(folio), folio_order(folio)); if (WARN_ON_ONCE(folio_test_large(folio))) { ret =3D VM_FAULT_SIGBUS; goto out_folio; @@ -596,6 +597,10 @@ static int __kvm_gmem_create(struct kvm *kvm, loff_t s= ize, u64 flags) inode->i_mode |=3D S_IFREG; inode->i_size =3D size; mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER); + mapping_set_folio_order_range(inode->i_mapping, 0, 0); + pr_info("KVM: guest_memfd created, folio_order min=3D%u max=3D%u\n", + mapping_min_folio_order(inode->i_mapping), + mapping_max_folio_order(inode->i_mapping)); mapping_set_inaccessible(inode->i_mapping); /* Unmovable mappings are supposed to be marked unevictable as well. */ WARN_ON_ONCE(!mapping_unevictable(inode->i_mapping)); --=20 2.43.0