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=1796385627; b=346C3WSBBJFDo+DO7MsFGjL4jEgr4ciTBSHtjMnozome2zSc/0jtDJ5hQSQZy72jgjQA ARQDMNuw5esiv7/CEp1FihqVhyvwH+AlzXpOtyMYRqkLvGmgyh9CYm2EZ0p7thjYm/XF5 7OKAkuhEwV0izgjHfjbkEVg6c+Egx6iyX/kiQPsmZfKYvfvN/Q8A8q1ZUTdwDabGB9MCA Rat07ykGHiz7bRV9b+ahprYZ/Ta7obQovztKWXkD2fXr4chnE5xYIXLfDkzlFXC7oZBKT p9zm5ePDcaIdjxFXWZa1uFXWhYfaDAaOdxIncSr4wvVGKOlq3EqxA74thlCh1xQ4SyA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385627; 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=VEF/ytSyw/K8lVO6M+mg8HydcWHjP252/crWmrmp3FE=; b=zhah5l3cDWEiWOLHSYWbvD7Hag3VcouRAH2b9vddsZmOnzjeOipsaePWnQieqY1ZOD3U YdlFM8WUrGXzMLRcMZnHhKt+K2hwQGvu/XTxIBTvWFtoeeuGfjK+mBFWcXIcwbncp8PD3 v560+/w/ODrQayPeUv0rNhvWYgRwE4cLaoCLWioWUH/G6d6m059NqcpxL6Fi96dfr+Iju Y1DzO/yNr3czx2qf7Znb+r4E3j+087TrKDodm4pOMxzNl8kQyYhcyDmsywaxFesTP4H+t 4qjHktjKdOEkLm8tzPik1GZJ412KHQYZu+QzuvOkRwYzAaqEJy+twBJBOIWAQlpa8Qw== 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=YVjdimgS; 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 3D474606A32C; Fri, 4 Dec 2026 12:00:27 +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=YVjdimgS Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF7291F00897; Fri, 4 Dec 2026 12:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385627; bh=VEF/ytSyw/K8lVO6M+mg8HydcWHjP252/crWmrmp3FE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YVjdimgSqPINT/SQYAavPDWDqdSOxMwQBwvy+gFGQKI74o9lhbcqEGUBYg/kCXf74 BLt3B+LlG8iqHbrmR/WqD18qss36K5QKKXz+xI53AOWhJPDRVXrldaIlYUTS1y4heC IW8QSJjtMFgpsobYuDgHQ8SwDQS4t8CsaBzzthnQ= 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 0589/1167] ovl: do not always clear absolute_redirect Date: Fri, 4 Dec 2026 19:00:16 +0900 Message-ID: <20261204100717.395825186@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: patches@lists.linux.dev 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 477449a7a5fd1b2fe973fe2978b0c921115a65f3 upstream. ovl_check_redirect() clears d->absolute_redirect before it checks that the path element has a redirect xattr. An element without one, such as an intermediate directory in a lower layer, then clears the flag set by the absolute redirect of a metacopy file found in a higher layer. The lookup of the data in the data-only layers is not deferred any more and the lookup fails with -EIO: # l2/f: metacopy, redirect "/dir/file"; l1/dir/ exists, no "file" mount -t overlay none -o metacopy=on,redirect_dir=on,\ lowerdir+=l2,lowerdir+=l1,datadir+=data m cat m/f # Input/output error Set d->absolute_redirect only when a redirect xattr was read. Fixes: 5436ab0a864e ("ovl: implement lookup in data-only layers") Closes: https://sashiko.dev/#/bug/linux-2cc24e0b-fbdc-4cf1-aded-cfd19c2918ee 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 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -37,13 +37,12 @@ static int ovl_check_redirect(const stru char *buf; struct ovl_fs *ofs = OVL_FS(d->sb); - d->absolute_redirect = false; buf = ovl_get_redirect_xattr(ofs, path, prelen + strlen(post)); if (IS_ERR_OR_NULL(buf)) return PTR_ERR(buf); - if (buf[0] == '/') { - d->absolute_redirect = true; + d->absolute_redirect = buf[0] == '/'; + if (d->absolute_redirect) { /* * One of the ancestor path elements in an absolute path * lookup in ovl_lookup_layer() could have been opaque and