From nobody Sat Feb 7 13:41:47 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 23AD53EBF07 for ; Sun, 1 Feb 2026 04:57:31 +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=1769921853; cv=none; b=iwFz5WrxoR5P6qlXaZYFin9isSWwrhzRMyC4bdxHNBqleA8mdtoplV/GPTGxpxHHsu8kVXHedoCMsRc3h1BtY89GG5GLXziBcJqtM8g+lTHJWeSkSvjmeOyQB+ZDPvhl/Tuvt3Ux1iHHFew3rJMZPiB9/ExIpRIHwj725f3Hx1I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769921853; c=relaxed/simple; bh=rAs9ignRg5bOZVYN4YHvTjlxW86PgCe25PYps2Zwgpg=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=g8d4GkJdupZLiM16MCNTeWG102qQF0mLIjP8vxCBlgr5pZVzcKqWUn8Da6QIXG4UzXr9FxrTxdUeHzqaUS6PMC8ZG/d0hEa/7z0Nh4zr0WEc2sV6utdWnl92wHoTE0G6fgYaPIlj3K0kQWRA1QgvqqHMn1C5ki7eRK/o/jHAqf8= 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-66314e79f6cso8188808eaf.2 for ; Sat, 31 Jan 2026 20:57:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769921851; x=1770526651; 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=i+yJNqkZPlj2MXkPAaZsfvlmjZMhiekW9L/o/QL1A+k=; b=cYiloj2ouHx1YZtMxPULm9NlHrYY4vG9sMv/EWjIIEi12l7v8KWvGm9MSWTZLUHhn+ Ku/eTUBOE3YryxPJ4EN+aFRD+/kE2LMHiA5JI3Yr9Z0Zi+Ofbnmlv4ZxIxEcj7gJVbha NSzYMYyh+FHzr0soXcxAGCiakMb83H1vLhxJiSqDHUF+3LpRDgmMm4RKi4Cj4txNEVF3 iUhFMpS4SuSRTyq22UVfjSdZQUloKWPXvteonZEEo+Vboub2EV+O7txcgeHAUxD8TK39 gXSyx2xLjejA3H7Qs5hHDDPY1qnwFGa4UW21nX3PV8wSycaQx33Wp4eDJICVrqyV1s9E +LAQ== X-Gm-Message-State: AOJu0YyIo4K8/j/oFYqkGH8of+LroBJyB6H/rH3rddXZa92XZwFpC7GE J6uysz+Bcfhlqoq7cyJq91eeW7fzj89uweKUusL3LAvZ0AWUyWMquGH7/uXAgcbhPblWsD++gfu maGROM0msX6EMZQawjIXM3BdTcG2b51Ebp4KoWYmEY0x3O6xO3j+IJjkeGzs= 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:22a7:b0:663:39:1742 with SMTP id 006d021491bc7-6630f35fd60mr3606370eaf.52.1769921851023; Sat, 31 Jan 2026 20:57:31 -0800 (PST) Date: Sat, 31 Jan 2026 20:57:31 -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: <697edd3b.050a0220.16b13.0097.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, 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. 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c index fdaea3422c30..4dc154b4b370 100644 --- a/virt/kvm/guest_memfd.c +++ b/virt/kvm/guest_memfd.c @@ -596,6 +596,7 @@ static int __kvm_gmem_create(struct kvm *kvm, loff_t si= ze, 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); 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