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 F0D4A381EA5; Thu, 2 Jul 2026 16:26:18 +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=1783009580; cv=none; b=M6rh6SSuhxEon/wpOHoOUD+W0GeywKKns/L91yR6bho7Q+imMRHaZoSTboVfHoFMsJtk+mAXMFbFEQA6Kkgqegt4CY68M+GqJ46y/I1gRJj6lgfYD6QeSMQzkkvFBjVcxY1ysryc/ZeUMQRVmG5YEs5iOcdofcBQC3TMfJ+AJ60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783009580; c=relaxed/simple; bh=fpmaXMrajiwsCQg8NZFzD0g431lWhudkbQI04vkuceE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jkqpcEvLNBFpCzl9+gyTzZp7DD+hwG2L+sHce1dZUcPvCuZGgG/7AiZuzEte43zjXWWQiB3UhWUPwmM4OYPr8JvbwHNFVDMGtECrixxE5wEXQGM09KgoTnKsYz0zupIVT0kS8K4zvN+54EgaqMLaSCnYgn6+TUrkS+1uPH4q60c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jyDLR96j; 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="jyDLR96j" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 623571F000E9; Thu, 2 Jul 2026 16:26:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1783009578; bh=Tv6jMgv9dRPvRzxd8vKhnkQqvt1SfILpTwql1jkvEjU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jyDLR96jDyBaNOeveG4OPkxkhCrer4FXncrCd1EXJDhKaYJNu9be5qGlk1wteWTha Ok19OM8jkraOEZ3iUbxPdJ5w1ju5/pLPtCv71Qle+2lGjaB0dM2C/MpbaKAblshARh cm6T82zuev7XU1XmO/747vbbqzax7BjCd9nO/M6Q= 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 5.15 01/95] fuse: limit FUSE_NOTIFY_RETRIEVE to uptodate folios Date: Thu, 2 Jul 2026 18:19:04 +0200 Message-ID: <20260702155109.230666525@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260702155109.196223802@linuxfoundation.org> References: <20260702155109.196223802@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 5.15-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 231b1c14b76778..e5a051a624e735 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1724,6 +1724,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