smb3: fix default permissions on new files when mounting with modefromsid
authorSteve French <stfrench@microsoft.com>
Fri, 17 Jan 2020 01:55:33 +0000 (19:55 -0600)
committerSteve French <stfrench@microsoft.com>
Mon, 27 Jan 2020 01:24:17 +0000 (19:24 -0600)
commit643fbceef48e5b22bf8e0905f903e908b5d2ba69
tree54a07ac880d8fd9800ddf0e9440c01856f712434
parent438471b67963b8267e94beab383b6d6fc41b3481
smb3: fix default permissions on new files when mounting with modefromsid

When mounting with "modefromsid" mount parm most servers will require
that some default permissions are given to users in the ACL on newly
created files, files created with the new 'sd context' - when passing in
an sd context on create, permissions are not inherited from the parent
directory, so in addition to the ACE with the special SID which contains
the mode, we also must pass in an ACE allowing users to access the file
(GENERIC_ALL for authenticated users seemed like a reasonable default,
although later we could allow a mount option or config switch to make
it GENERIC_ALL for EVERYONE special sid).

CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-By: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
fs/cifs/cifsacl.c
fs/cifs/cifsproto.h
fs/cifs/smb2pdu.c