From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C5CC3144312; Thu, 13 Jun 2024 12:05:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718280311; cv=none; b=WUhGsc3QdLiJ/gknJ5i6s0G8OdwRuHUp4lvOWlm2B13bgQ9o34WN3FjwNnSs0AaL0+7UehUokMXtINWQoWczhLjzKGhtkXlY2ZlVlKgzCRDujQgQYC8jxgLLJQPKArGZGw02WxEsDPzaQBXE2YdkblLn7FkF2RYXkjDIe+tFpBo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718280311; c=relaxed/simple; bh=4ZEVny77icUi1UV/Efc68pqtDXWSOOdJUn3wrsnFGfk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VJ7YlWtuS3sHvan2/vf7C87Gne+TuP6x+m4MOqVFAdAq5F9qia7F2uU2lhPzL9XsAfJUsItSZ9XuuzfVImVRYxVC5Pxgd+XRG5UTLNPf4YoW/iHrh1P2Y4A3e5jeFO9S3KGjgCQyhrESZ4effFoAlmalk3nUl5oqpBKoZ2W1CKM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=asWEufGe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="asWEufGe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2024EC2BBFC; Thu, 13 Jun 2024 12:05:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718280311; bh=4ZEVny77icUi1UV/Efc68pqtDXWSOOdJUn3wrsnFGfk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=asWEufGetob3vXmeKTdeSRtUDcKfkGtUo/KTRwHCvgvSQ9zXX6yxqm3fgK2a1aEY4 fGdN6rJethp9BpDL+rGs4DCpyAuqsSftetj1GAuAUsGtSjLoNVG210mphbPOhRZJ5F XUJ0tl07rNtRy72xPvsHsX+8TO6HhnQXzHRrqt90= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jan Henrik Sylvester , Markus Suvanto , Marc Dionne , David Howells , Jeffrey Altman , linux-afs@lists.infradead.org, Christian Brauner Subject: [PATCH 6.6 003/137] afs: Dont cross .backup mountpoint from backup volume Date: Thu, 13 Jun 2024 13:33:03 +0200 Message-ID: <20240613113223.416442580@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240613113223.281378087@linuxfoundation.org> References: <20240613113223.281378087@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marc Dionne commit 29be9100aca2915fab54b5693309bc42956542e5 upstream. Don't cross a mountpoint that explicitly specifies a backup volume (target is .backup) when starting from a backup volume. It it not uncommon to mount a volume's backup directly in the volume itself. This can cause tools that are not paying attention to get into a loop mounting the volume onto itself as they attempt to traverse the tree, leading to a variety of problems. This doesn't prevent the general case of loops in a sequence of mountpoints, but addresses a common special case in the same way as other afs clients. Reported-by: Jan Henrik Sylvester Link: http://lists.infradead.org/pipermail/linux-afs/2024-May/008454.html Reported-by: Markus Suvanto Link: http://lists.infradead.org/pipermail/linux-afs/2024-February/008074.html Signed-off-by: Marc Dionne Signed-off-by: David Howells Link: https://lore.kernel.org/r/768760.1716567475@warthog.procyon.org.uk Reviewed-by: Jeffrey Altman cc: linux-afs@lists.infradead.org Signed-off-by: Christian Brauner Signed-off-by: Greg Kroah-Hartman --- fs/afs/mntpt.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/fs/afs/mntpt.c +++ b/fs/afs/mntpt.c @@ -140,6 +140,11 @@ static int afs_mntpt_set_params(struct f put_page(page); if (ret < 0) return ret; + + /* Don't cross a backup volume mountpoint from a backup volume */ + if (src_as->volume && src_as->volume->type == AFSVL_BACKVOL && + ctx->type == AFSVL_BACKVOL) + return -ENODEV; } return 0;