afs: Don't cross .backup mountpoint from backup volume
Subsystems (3)
David Howells
maintainerPATCH 1/1 afs: Don't cross .backup mountpoint from backup volume
Hi Christian,
Can you pick this up, please?
Thanks,
David
---
From: Marc Dionne <[email protected]>
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.
--- fs/afs/mntpt.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/afs/mntpt.c +5 -0
@@ -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 ;
Quoted 41 lines · David Howells
Hi Christian,
Can you pick this up, please?
Thanks,
David
---
From: Marc Dionne<[email protected]>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<[email protected]>Reported-by Markus Suvanto<[email protected]>Signed-off-by Marc Dionne<[email protected]>Signed-off-by David Howells<[email protected]>Reviewed-by Jeffrey Altman<[email protected]>--- fs/afs/mntpt.c | 5 +++++ 1 file changed, 5 insertions(+)fs/afs/mntpt.c +0
-0@@ -140,6 +140,11 @@ static int afs_mntpt_set_params(struct fs_context *fc, struct dentry *mntpt)put_page (page);
fs/afs/mntpt.c static int afs_mntpt_set_params(struct fs_context *fc, struct dentry *mntpt) · line 150
Quoted 10 lines
fs/afs/mntpt.c +5
-0if (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
when it is applied to vfs-fixes.
Thank you.
Jeffrey Altman
Quoted 41 lines · David Howells
Hi Christian,
Can you pick this up, please?
Thanks,
David
---
From: Marc Dionne<[email protected]>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<[email protected]>Reported-by Markus Suvanto<[email protected]>Signed-off-by Marc Dionne<[email protected]>Signed-off-by David Howells<[email protected]>Reviewed-by Jeffrey Altman<[email protected]>--- fs/afs/mntpt.c | 5 +++++ 1 file changed, 5 insertions(+)fs/afs/mntpt.c +0
-0@@ -140,6 +140,11 @@ static int afs_mntpt_set_params(struct fs_context *fc, struct dentry *mntpt)put_page (page);
fs/afs/mntpt.c static int afs_mntpt_set_params(struct fs_context *fc, struct dentry *mntpt) · line 150
Quoted 10 lines
fs/afs/mntpt.c +5
-0if (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
when it is applied to vfs-fixes.
Thank you.
Jeffrey Altman