From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385645; b=XLAwdmqLKwQlaso2HYhdsR3Xzy12/2CILaUbWA86b9usLUAe6juzsSGKnp5EAzMjA8Bb 4Jd9H3S4MspQbKiTvNYG6htr7qW9aDqmptPctFWeQmXROnpcCqOFrNmghqJJrS+R8xZl4 WBx51oiRGvOjFgBrn/B9b3iIdB5poxpcVBLuByagJogsXkYRn6nnK2vMDO73vZCxM9m/c HoPGtETpAZN8JV8f+0EvmA/JtxB0vp0XB4D1M+me5viLoxiHXT1sg4KkFbnznl+OoQn1a nOf3Ba7qvaVSiO+TqzHpoNsmXcBMS8rY/WPn177jKq0aOB5Al38uCyqQ+czUMW8Aepg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385645; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=CkMss4Kv4gpkiaIH3KVXe+5VAxw+pzXVNhcA935aj48=; b=VMkGYyYjh8fmCkteEwJpb5+oeBZ6Kf404A92PMLlAMEimnZrXD2iveIilKROj+7QRxEi PWxfkxt6SKpaavHxgBakIpsIZpJrihXqhGPujEkMLIqhD42hGTVHu0IywdUls6T3sYmp2 I3mFn6up3UqaQwhjsu9xaJrh+9Ek8bfyvFWft4PTThSF2JKgS8B8aMQVUp0EIZ+89UNwU kyruIdy8s2mxqMrsXqb6X3sFnCL9R9Pd7Pts2oxazpAHa3wWgXvqoKD5Kb4zRJNAdKn3Y Ffzv8HP7CAF/5gnfitAd5rgNgGhuMCCQwgfYHRkbB89X2F3jBv77PlKsHKtYnlRq0LQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=z5y+vROg; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8EEB606A322; Fri, 4 Dec 2026 12:00:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=z5y+vROg Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D0E91F000CE; Fri, 4 Dec 2026 12:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385645; bh=CkMss4Kv4gpkiaIH3KVXe+5VAxw+pzXVNhcA935aj48=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=z5y+vROg8wjqjYBBnlR+RVf5/7g/kPM+f/QLrjtH5qbAa30p/Df5U5IMSG/EZUF7Z 4ddBkKlVmfXGF2cU6ghqNjMyQ6Exq5rj/IS+YISGYQeIKL3L1dgYgNbcwXv5BhYRom irEIKeG69L1yYB4eLntkAEY4UUeeRYyFj/erHEu8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Giuseppe Scrivano , Amir Goldstein Subject: [PATCH 6.6 0592/1167] ovl: return EIO if the lowerdata is missing Date: Fri, 4 Dec 2026 19:00:19 +0900 Message-ID: <20261204100717.474082616@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Giuseppe Scrivano commit 0d5e729c515f4ae4eacc179dbcf350d9b499a161 upstream. The data of a metacopy file that redirects to a data-only layer is looked up when the file is opened, and the error of the lookup is returned as is. If the data file is missing, open() fails with ENOENT even though the file is there and stat() works. This can be an integrity problem when using composefs: a data file that is changed or has the wrong fs-verity digest is reported with EIO, but a missing one is not reported, the file just looks like it does not exist, e.g. a configuration file that overrides the defaults. Return EIO as it is already done in ovl_lookup() when no lower data is found for a metacopy file. ENOMEM is not changed. Fixes: 42dd69ae1af4 ("ovl: implement lazy lookup of lowerdata in data-only layers") Cc: stable@vger.kernel.org Signed-off-by: Giuseppe Scrivano Signed-off-by: Amir Goldstein Signed-off-by: Greg Kroah-Hartman --- fs/overlayfs/namei.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -991,6 +991,14 @@ out: out_err: pr_warn_ratelimited("lazy lowerdata lookup failed (%pd2, err=%i)\n", dentry, err); + /* + * The data of a metacopy file is missing or is not a regular file in + * the data-only layers: the layers are corrupted. Do not return the + * error of the lookup (e.g. ENOENT) to the caller, it would make the + * file look like it does not exist. + */ + if (err != -ENOMEM) + err = -EIO; goto out; }