From 2fdbc03f9295f61f8fa9afc1ea67af56de8fc28c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 12 Jun 2024 14:46:09 +0200 Subject: [PATCH] 6.9-stable patches added patches: afs-don-t-cross-.backup-mountpoint-from-backup-volume.patch --- ...backup-mountpoint-from-backup-volume.patch | 50 +++++++++++++++++++ queue-6.9/series | 1 + 2 files changed, 51 insertions(+) create mode 100644 queue-6.9/afs-don-t-cross-.backup-mountpoint-from-backup-volume.patch diff --git a/queue-6.9/afs-don-t-cross-.backup-mountpoint-from-backup-volume.patch b/queue-6.9/afs-don-t-cross-.backup-mountpoint-from-backup-volume.patch new file mode 100644 index 00000000000..4a07b1e47dc --- /dev/null +++ b/queue-6.9/afs-don-t-cross-.backup-mountpoint-from-backup-volume.patch @@ -0,0 +1,50 @@ +From 29be9100aca2915fab54b5693309bc42956542e5 Mon Sep 17 00:00:00 2001 +From: Marc Dionne +Date: Fri, 24 May 2024 17:17:55 +0100 +Subject: afs: Don't cross .backup mountpoint from backup volume + +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; diff --git a/queue-6.9/series b/queue-6.9/series index 7d8dfc3b2d8..6decdb0db79 100644 --- a/queue-6.9/series +++ b/queue-6.9/series @@ -1,3 +1,4 @@ e1000e-move-force-smbus-near-the-end-of-enable_ulp-function.patch drm-amdkfd-handle-duplicate-bos-in-reserve_bo_and_cond_vms.patch drm-i915-hwmon-get-rid-of-devm.patch +afs-don-t-cross-.backup-mountpoint-from-backup-volume.patch -- 2.47.3