From: Ronnie Sahlberg <lsahlber@redhat.com>
Date: Mon, 14 Dec 2020 16:40:23 +1000
Subject: [PATCH] cifs: do not allow changing posix_paths during remount
Git-commit: 531f03bc6d0509f2e7a5852e3f1819166e0f364c
Patch-mainline: v5.11-rc1
References: bsc#1192606
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
---
fs/cifs/fs_context.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/cifs/fs_context.c b/fs/cifs/fs_context.c
index c3c6d0cd291b..58da674c0365 100644
--- a/fs/cifs/fs_context.c
+++ b/fs/cifs/fs_context.c
@@ -627,6 +627,10 @@ static void smb3_fs_context_free(struct fs_context *fc)
static int smb3_verify_reconfigure_ctx(struct smb3_fs_context *new_ctx,
struct smb3_fs_context *old_ctx)
{
+ if (new_ctx->posix_paths != old_ctx->posix_paths) {
+ cifs_dbg(VFS, "can not change posixpaths during remount\n");
+ return -EINVAL;
+ }
if (new_ctx->sectype != old_ctx->sectype) {
cifs_dbg(VFS, "can not change sec during remount\n");
return -EINVAL;
--
2.33.1