From nobody Wed Feb 11 01:25:57 2026 Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) (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 3764D3C1F for ; Mon, 9 Feb 2026 02:02:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.70 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770602579; cv=none; b=LMbKJp9Q7mBeaiTfLwoqKHI3F9CREkB/5f+R4sn5wJx5ES45bDYgmspoQErHnYnkFKapzhtg8DILIcUpWr/RkBwd8cM6tazAACdMVMJm/JtFhy/nhHxmG396KaAX1IQj0d+5n+tEMsKazc5TMczs+ASalTnujsM+J6gfw1lPGr8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770602579; c=relaxed/simple; bh=iD3AkOT4PIn+LDtTQ57vxEHSZTdipWY+rnoGveZZXJs=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=WbqHTribY4XUCKkqPDVrn+9WmErumWq9fDPhRF0LwyVK3F/0dfoXC43g5218Lv8G6ILU55diQSnvTiGqN0T4IGAuz9bY7p2NnRDOj08SaC8dhmVUPd99clxLiaIy807dzxVv21w4BM8SN+whahpiPehDL/y0ZE+VdmyVHdUz52k= 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.210.70 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-ot1-f70.google.com with SMTP id 46e09a7af769-7d193e69588so17631813a34.1 for ; Sun, 08 Feb 2026 18:02:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770602578; x=1771207378; 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=22CpSfeDWGjAehW34rDMGBEJ1DBYMf+u7/8aNpMxvGs=; b=fR1KDOli5OgwQ5CM0z0QzQKpPPXJHbzkZ7vjfJbxFA2t7rX6PPVkfkcCKFFSLMYxFo xzZJW9Guwmo9QWqkwu5Q+sjUD3A06vIEd2GYL6R3xD1xL8hNhsBa8TCzVD4A8xvTkN6N ZAE4ZHrC1rNlMjFxlunI5izzA5kZRYJLd/A3WT+I6bWChdKtCC3oj5YdGw54muevNkkx tLvdBFZ/r04srMEP3oJW5lesdPwu+FJMcgBXO/ifLy82uaW+GlKw8U+hVJUSZIU7eZvn +itxJds9WSVjURejcVKqkv772cE1BEOawzKz1y5mOl61O1OkhGEs6Mbs+PwUVBP359dX bJWQ== X-Gm-Message-State: AOJu0YyYHtDGUa0smbZca48hvm38y+8Pg8Cxd+04rI+cg7lKMxr03+HF ZdyGGntaaPCw1z3mOupayuhWpffkOfEpcBr2gtB4EgEliQlmB3Do+Cz3PizUcqfUh49zCJrtAew 856UQecQ5qZwFs+KpaSGSFQqlXoHL6ZU1xblWCgQT86CM+GTKqVVw6ib3vCQ= 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:4dc8:b0:65f:10ea:4772 with SMTP id 006d021491bc7-66d0a286913mr4425584eaf.19.1770602578221; Sun, 08 Feb 2026 18:02:58 -0800 (PST) Date: Sun, 08 Feb 2026 18:02:58 -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: <69894052.050a0220.1ad825.000b.GAE@google.com> Subject: Forwarded: [PATCH] mm: thp: Deny THP for guest_memfd and secretmem in file_thp_enabled() 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] mm: thp: Deny THP for guest_memfd and secretmem in file_th= p_enabled() Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master file_thp_enabled() incorrectly returns true for guest_memfd and secretmem inodes because they appear as regular read-only files when CONFIG_READ_ONLY_THP_FOR_FS is enabled. This allows khugepaged and MADV_COLLAPSE to create large folios in the page cache, but their fault handlers do not support large folios. Add explicit checks for GUEST_MEMFD_MAGIC and SECRETMEM_MAGIC to reject these filesystems early in file_thp_enabled(). Reported-by: syzbot+33a04338019ac7e43a44@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D33a04338019ac7e43a44 Signed-off-by: Deepanshu Kartikey --- mm/huge_memory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 40cf59301c21..4f57c78b57dd 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -93,6 +93,9 @@ static inline bool file_thp_enabled(struct vm_area_struct= *vma) return false; =20 inode =3D file_inode(vma->vm_file); + if (inode->i_sb->s_magic =3D=3D GUEST_MEMFD_MAGIC || + inode->i_sb->s_magic =3D=3D SECRETMEM_MAGIC) + return false; =20 return !inode_is_open_for_write(inode) && S_ISREG(inode->i_mode); } --=20 2.43.0