Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp660197lqb; Fri, 24 May 2024 09:18:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWqTHbDl17Eomy6dBQUOwW9m0TrjdYY4CkBAZYUWTD/8rOlcC8NLFXSdovfiDlfpb6ey/3WsIeZYHe1MCSpewezTv9EizkxHfinWRhsvA== X-Google-Smtp-Source: AGHT+IEGXuTzpV5V5w6TlPEDKL+7ZfUYgp52YUjCY347FXyGwcldVB2Fsqzj6F36APCx5ZlA5tY8 X-Received: by 2002:a05:622a:450:b0:43b:d8d:30f with SMTP id d75a77b69052e-43fb0e548b5mr32208951cf.2.1716567493490; Fri, 24 May 2024 09:18:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716567493; cv=pass; d=google.com; s=arc-20160816; b=PEmfMIyp9dLEmQa68BxuWrBCkm5EJOebT0T9K8oXkRJPcCpa7W7t37NQkw7fO6YSS0 qMh2EqCRpRv+s+OTgAEPycsOGLWAvw25YW5eOiCIySyDuNYFTdlLpPRzffC/+Etq/Kzu plojqDwkW3k+IvkJ/1N34GSNxOuoc5osAX2fB/xIWc6SFoaCPn1688r8n/v8A3LdEqUg wP4mtF7nDQHx2SVtmdd1FIf1sM5vh1cqgMDLMsvonx8UeGa2WquX7CaPB4EfxKvawv6Z xGn5ahO2B37HFFha2/wo9iRSnoAzKJCFnq6OpL8Mrwy/lFEkH5uHTaYnGIrusIVhyElE ZXZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-transfer-encoding:content-id:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:cc:to :from:organization:dkim-signature; bh=vHjClk8E6ZL5CAwbbjUXeTWTpXpzXKPzMEFy1g+hdPs=; fh=IFvn801GszErDkl1HTI9KxGscWnph53N/STq+aXF4sw=; b=EaxuD5mVMcC5ubWfxuT2nO1q6HdrPdgm0DQTmUkRbNUBn7BhrERejEUqUebeBpp5+v uQbehmI/uI+/A3LnmIAct+nwOlrHaE5X//ER0DSlWBhjilJpuuwXaxlNzBwq5Wxs2Mvz eGuagZjaiuNxKH75RcilrQxM4U7PZwjWl4DOjLdGOKs7LYhhfVsxZbdbz2QgnIHZOUzI pYzh5FAT4kxPZYelhLofZJrOZPrESmRPFmdvN+Pm37/GTISocYgAyxkIrwBe+7VP6TY1 6gQ388M9mtmu/BkYeHP0hNp6v1Qc5FfbMSKbucsQPNCAlkNw3+BlWuLEfGvHeak9ELkq akIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="B1P/oKeC"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-188922-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188922-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43fb18eaae7si24985281cf.765.2024.05.24.09.18.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 09:18:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188922-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="B1P/oKeC"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-188922-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188922-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3A9531C20BC2 for ; Fri, 24 May 2024 16:18:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CD5112EBD5; Fri, 24 May 2024 16:18:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="B1P/oKeC" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 A4A1C12E1CA for ; Fri, 24 May 2024 16:18:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716567486; cv=none; b=ovoL2LwD5xSEmtp+3uhgGdmfOuZbzduThwfhJkpEkwkueRX3ykUjaB8BWnm2EyyrPqVC9rU8WuKicdOqjyPSi6jscZjuRWdfHip/gyM653/9U+/vDRH5BrpIj4mq9shd0UK7CtN+GzFSL6wo/YZ0MmekAOkiEItIsqulfmhlc1Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716567486; c=relaxed/simple; bh=omAssB6I02yj+x+pz+EEXEalHt+q5NCe67eht1huW5c=; h=From:To:cc:Subject:MIME-Version:Content-Type:Date:Message-ID; b=bMz4NTH31VVf/e2SeGhmey6FKoAtA0TCta1MmbBtrvsfuSdCHRHBMaTk39fhps8kRgYdL6aUfKI+Ko/nd+TPhXWVAuVqxKq7DlimQ5s3OMOFtbWPub5DvITPcnqbaSmtTP/7HsEMImJxHq1ifkQJXd57s78X+Don4XqMEYrvbRg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=B1P/oKeC; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716567483; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vHjClk8E6ZL5CAwbbjUXeTWTpXpzXKPzMEFy1g+hdPs=; b=B1P/oKeCE3ZUiTX85+M6cqNtd5BWp65xF5d10saHWsAuMtg+Z6CBTw8kQO2cFrPXhLLVw1 TUaqLq/b4UyZnk1t0PxBfMKR+jUzeU6eyw+PZD4VmiH3P79IViD3nNoZVTHvRqrUBFzeqB jLobxrONmgfPCQ+uJh40mxY6fx3Bg/A= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-163-Y4ybQU0dP5WtwdLUCHbt2Q-1; Fri, 24 May 2024 12:17:58 -0400 X-MC-Unique: Y4ybQU0dP5WtwdLUCHbt2Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 73C5C101A52C; Fri, 24 May 2024 16:17:57 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D22F2026D68; Fri, 24 May 2024 16:17:56 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: Christian Brauner cc: dhowells@redhat.com, Jan Henrik Sylvester , Markus Suvanto , Marc Dionne , Jeffrey Altman , linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] afs: Don't cross .backup mountpoint from backup volume Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <768759.1716567475.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Fri, 24 May 2024 17:17:55 +0100 Message-ID: <768760.1716567475@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Hi Christian, Can you pick this up, please? Thanks, David --- From: Marc Dionne afs: Don't cross .backup mountpoint from backup volume 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 Reviewed-by: Jeffrey Altman cc: linux-afs@lists.infradead.org --- fs/afs/mntpt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c index 97f50e9fd9eb..297487ee8323 100644 --- a/fs/afs/mntpt.c +++ b/fs/afs/mntpt.c @@ -140,6 +140,11 @@ static int afs_mntpt_set_params(struct fs_context *fc= , struct dentry *mntpt) 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 =3D=3D AFSVL_BACKVOL && + ctx->type =3D=3D AFSVL_BACKVOL) + return -ENODEV; } = return 0;