From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E2FB381E92; Thu, 2 Jul 2026 16:36:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783010194; cv=none; b=Dbye2E+MhhMXK7WpsjWxDNCUzIqUsqzrZs8Wj9n+YQ/l1rmQ37aLrpGAdZh0yyqDxrS1yGds/ZtsNQXdDWqvR/euBmbNdp3Ze9u7AwpFFORIt9dmm/SnehJHTsIrm3fotHGaksZNRGwtAgZcEPGXIKOY4LTBmboUg7gotRZgOjk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783010194; c=relaxed/simple; bh=+9ixt2SdzpQk9RUSKt9X5cdsw1+qFJcxdte3YthQPGI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kZjJc6Qrf4XduCvRXp4sUfv4UidhMD5JP6JMn0DUNf/AlLIOvCvNmW2RE6ptQUPdIbPPlZtF8TBRrGQTP9WmJGrSdDM/aM2RRspVv5r2NuZJIx0c0ypIVwG3qNvObZxQncEczarDckx9dOa7xtRdTjYrHjDP4Nkvuv5j3OKed5k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=C+OVihcC; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="C+OVihcC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D584C1F00A3A; Thu, 2 Jul 2026 16:36:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1783010193; bh=P48gxzQQ9eA8IpBH7ME/n7dEZnceLlTBnqZKpgnqlTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=C+OVihcCoPc7ZAtayjO5qm97fyl8tqyIHcJJqq2u3uwfJOZME35ILYXYJ6A/WtbyB Q25Sh8xcL021DnfSMxbpHqaG3dhSWgPZZepecLtxYccT14w+RYRa4xUO3fuh+xb4ua TZ4NULo0byIJ7segJG4c8sVjVvP0tMBUozEhtpCM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable@kernel.org, Jann Horn , Miklos Szeredi , "Christian Brauner (Amutable)" , Sasha Levin Subject: [PATCH 6.12 004/204] fuse: limit FUSE_NOTIFY_RETRIEVE to uptodate folios Date: Thu, 2 Jul 2026 18:17:41 +0200 Message-ID: <20260702155118.761149243@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260702155118.667618796@linuxfoundation.org> References: <20260702155118.667618796@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jann Horn [ Upstream commit 4e3d1b2c48ca6c55f1e9ca7f8dccc76f120f276c ] FUSE_NOTIFY_RETRIEVE must be limited to uptodate folios; !uptodate folios can contain uninitialized data. Since FUSE_NOTIFY_RETRIEVE is intended to only return data that is already in the page cache and not wait for data from the FUSE daemon, treat !uptodate folios as if they weren't present. This only has security impact on systems that don't enable automatic zero-initialization of all page allocations via CONFIG_INIT_ON_ALLOC_DEFAULT_ON or init_on_alloc=1. Cc: stable@kernel.org Fixes: 2d45ba381a74 ("fuse: add retrieve request") Signed-off-by: Jann Horn Link: https://patch.msgid.link/20260519-fuse-retrieve-uptodate-v1-1-a7a1912a37f9@google.com Acked-by: Miklos Szeredi Signed-off-by: Christian Brauner (Amutable) [adjusted for stable: page instead of folio] Signed-off-by: Jann Horn Signed-off-by: Sasha Levin --- fs/fuse/dev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 8f4a2ff56cc3be..6381a4626bc5a6 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1769,6 +1769,10 @@ static int fuse_retrieve(struct fuse_mount *fm, struct inode *inode, page = find_get_page(mapping, index); if (!page) break; + if (!PageUptodate(page)) { + put_page(page); + break; + } this_num = min_t(unsigned, num, PAGE_SIZE - offset); ap->pages[ap->num_pages] = page; -- 2.53.0