[SMB3] Fix mkdir when idsfromsid configured on mount
diff mbox series

Message ID CAH2r5ms-cXJzTqbTuE8_095aUssB8RvaqBTkfY2gHROjg7GsAQ@mail.gmail.com
State New
Headers show
Series
  • [SMB3] Fix mkdir when idsfromsid configured on mount
Related show

Commit Message

Steve French Aug. 13, 2020, 5:44 p.m. UTC
mkdir uses a compounded create operation which was not setting
    the security descriptor on create of a directory. Fix so
    mkdir now sets the mode and owner info properly when idsfromsid
    and modefromsid are configured on the mount.

Comments

Paulo Alcantara Aug. 13, 2020, 5:55 p.m. UTC | #1
Steve French <smfrench@gmail.com> writes:

> From c8e2d959ddac89ee44f170b2f2549e749581ec55 Mon Sep 17 00:00:00 2001
> From: Steve French <stfrench@microsoft.com>
> Date: Thu, 13 Aug 2020 12:38:08 -0500
> Subject: [PATCH] SMB3: Fix mkdir when idsfromsid configured on mount
>
> mkdir uses a compounded create operation which was not setting
> the security descriptor on create of a directory. Fix so
> mkdir now sets the mode and owner info properly when idsfromsid
> and modefromsid are configured on the mount.
>
> Signed-off-by: Steve French <stfrench@microsoft.com>
> CC: Stable <stable@vger.kernel.org> # v5.8
> ---
>  fs/cifs/smb2inode.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
> index b9db73687eaa..eba01d0908dd 100644
> --- a/fs/cifs/smb2inode.c
> +++ b/fs/cifs/smb2inode.c
> @@ -115,6 +115,7 @@ smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
>  	vars->oparms.fid = &fid;
>  	vars->oparms.reconnect = false;
>  	vars->oparms.mode = mode;
> +	vars->oparms.cifs_sb = cifs_sb;
>  
>  	rqst[num_rqst].rq_iov = &vars->open_iov[0];
>  	rqst[num_rqst].rq_nvec = SMB2_CREATE_IOV_SIZE;

Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Pavel Shilovsky Aug. 13, 2020, 11:10 p.m. UTC | #2
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
--
Best regards,
Pavel Shilovsky

чт, 13 авг. 2020 г. в 10:56, Paulo Alcantara <pc@cjr.nz>:
>
> Steve French <smfrench@gmail.com> writes:
>
> > From c8e2d959ddac89ee44f170b2f2549e749581ec55 Mon Sep 17 00:00:00 2001
> > From: Steve French <stfrench@microsoft.com>
> > Date: Thu, 13 Aug 2020 12:38:08 -0500
> > Subject: [PATCH] SMB3: Fix mkdir when idsfromsid configured on mount
> >
> > mkdir uses a compounded create operation which was not setting
> > the security descriptor on create of a directory. Fix so
> > mkdir now sets the mode and owner info properly when idsfromsid
> > and modefromsid are configured on the mount.
> >
> > Signed-off-by: Steve French <stfrench@microsoft.com>
> > CC: Stable <stable@vger.kernel.org> # v5.8
> > ---
> >  fs/cifs/smb2inode.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
> > index b9db73687eaa..eba01d0908dd 100644
> > --- a/fs/cifs/smb2inode.c
> > +++ b/fs/cifs/smb2inode.c
> > @@ -115,6 +115,7 @@ smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
> >       vars->oparms.fid = &fid;
> >       vars->oparms.reconnect = false;
> >       vars->oparms.mode = mode;
> > +     vars->oparms.cifs_sb = cifs_sb;
> >
> >       rqst[num_rqst].rq_iov = &vars->open_iov[0];
> >       rqst[num_rqst].rq_nvec = SMB2_CREATE_IOV_SIZE;
>
> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>

Patch
diff mbox series

From c8e2d959ddac89ee44f170b2f2549e749581ec55 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Thu, 13 Aug 2020 12:38:08 -0500
Subject: [PATCH] SMB3: Fix mkdir when idsfromsid configured on mount

mkdir uses a compounded create operation which was not setting
the security descriptor on create of a directory. Fix so
mkdir now sets the mode and owner info properly when idsfromsid
and modefromsid are configured on the mount.

Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org> # v5.8
---
 fs/cifs/smb2inode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
index b9db73687eaa..eba01d0908dd 100644
--- a/fs/cifs/smb2inode.c
+++ b/fs/cifs/smb2inode.c
@@ -115,6 +115,7 @@  smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
 	vars->oparms.fid = &fid;
 	vars->oparms.reconnect = false;
 	vars->oparms.mode = mode;
+	vars->oparms.cifs_sb = cifs_sb;
 
 	rqst[num_rqst].rq_iov = &vars->open_iov[0];
 	rqst[num_rqst].rq_nvec = SMB2_CREATE_IOV_SIZE;
-- 
2.25.1