* [PATCH] afs: Don't cross .backup mountpoint from backup volume
@ 2024-05-24 16:17 David Howells
2024-05-30 17:25 ` Jeffrey E Altman
2024-05-30 17:28 ` Jeffrey E Altman
0 siblings, 2 replies; 3+ messages in thread
From: David Howells @ 2024-05-24 16:17 UTC (permalink / raw)
To: Christian Brauner
Cc: dhowells, Jan Henrik Sylvester, Markus Suvanto, Marc Dionne,
Jeffrey Altman, linux-afs, linux-fsdevel, linux-kernel
Hi Christian,
Can you pick this up, please?
Thanks,
David
---
From: Marc Dionne <marc.dionne@auristor.com>
afs: Don't cross .backup mountpoint from backup volume
Don't cross a mountpoint that explicitly specifies a backup volume
(target is <vol>.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 <jan.henrik.sylvester@uni-hamburg.de>
Link: http://lists.infradead.org/pipermail/linux-afs/2024-May/008454.html
Reported-by: Markus Suvanto <markus.suvanto@gmail.com>
Link: http://lists.infradead.org/pipermail/linux-afs/2024-February/008074.html
Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
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 == AFSVL_BACKVOL &&
+ ctx->type == AFSVL_BACKVOL)
+ return -ENODEV;
}
return 0;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] afs: Don't cross .backup mountpoint from backup volume
2024-05-24 16:17 [PATCH] afs: Don't cross .backup mountpoint from backup volume David Howells
@ 2024-05-30 17:25 ` Jeffrey E Altman
2024-05-30 17:28 ` Jeffrey E Altman
1 sibling, 0 replies; 3+ messages in thread
From: Jeffrey E Altman @ 2024-05-30 17:25 UTC (permalink / raw)
To: Christian Brauner
Cc: Jan Henrik Sylvester, Markus Suvanto, Marc Dionne, linux-afs,
linux-fsdevel, linux-kernel, linux-stable, David Howells
[-- Attachment #1.1: Type: text/plain, Size: 2032 bytes --]
On 5/24/2024 12:17 PM, David Howells wrote:
> Hi Christian,
>
> Can you pick this up, please?
>
> Thanks,
> David
> ---
> From: Marc Dionne<marc.dionne@auristor.com>
>
> afs: Don't cross .backup mountpoint from backup volume
>
> Don't cross a mountpoint that explicitly specifies a backup volume
> (target is <vol>.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<jan.henrik.sylvester@uni-hamburg.de>
> Link:http://lists.infradead.org/pipermail/linux-afs/2024-May/008454.html
> Reported-by: Markus Suvanto<markus.suvanto@gmail.com>
> Link:http://lists.infradead.org/pipermail/linux-afs/2024-February/008074.html
> Signed-off-by: Marc Dionne<marc.dionne@auristor.com>
> Signed-off-by: David Howells<dhowells@redhat.com>
> Reviewed-by: Jeffrey Altman<jaltman@auristor.com>
> 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 == AFSVL_BACKVOL &&
> + ctx->type == AFSVL_BACKVOL)
> + return -ENODEV;
> }
>
> return 0;
Please add
cc: stable@vger.kernel.org
when it is applied to vfs-fixes.
Thank you.
Jeffrey Altman
[-- Attachment #1.2: Type: text/html, Size: 3501 bytes --]
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4039 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] afs: Don't cross .backup mountpoint from backup volume
2024-05-24 16:17 [PATCH] afs: Don't cross .backup mountpoint from backup volume David Howells
2024-05-30 17:25 ` Jeffrey E Altman
@ 2024-05-30 17:28 ` Jeffrey E Altman
1 sibling, 0 replies; 3+ messages in thread
From: Jeffrey E Altman @ 2024-05-30 17:28 UTC (permalink / raw)
To: Christian Brauner
Cc: Jan Henrik Sylvester, Markus Suvanto, Marc Dionne, linux-afs,
linux-fsdevel, linux-kernel, linux-stable, David Howells
On 5/24/2024 12:17 PM, David Howells wrote:
> Hi Christian,
>
> Can you pick this up, please?
>
> Thanks,
> David
> ---
> From: Marc Dionne<marc.dionne@auristor.com>
>
> afs: Don't cross .backup mountpoint from backup volume
>
> Don't cross a mountpoint that explicitly specifies a backup volume
> (target is <vol>.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<jan.henrik.sylvester@uni-hamburg.de>
> Link:http://lists.infradead.org/pipermail/linux-afs/2024-May/008454.html
> Reported-by: Markus Suvanto<markus.suvanto@gmail.com>
> Link:http://lists.infradead.org/pipermail/linux-afs/2024-February/008074.html
> Signed-off-by: Marc Dionne<marc.dionne@auristor.com>
> Signed-off-by: David Howells<dhowells@redhat.com>
> Reviewed-by: Jeffrey Altman<jaltman@auristor.com>
> 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 == AFSVL_BACKVOL &&
> + ctx->type == AFSVL_BACKVOL)
> + return -ENODEV;
> }
>
> return 0;
Please add
cc: stable@vger.kernel.org
when it is applied to vfs-fixes.
Thank you.
Jeffrey Altman
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-30 17:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-24 16:17 [PATCH] afs: Don't cross .backup mountpoint from backup volume David Howells
2024-05-30 17:25 ` Jeffrey E Altman
2024-05-30 17:28 ` Jeffrey E Altman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox