diff options
author | Shyam Prasad N <sprasad@microsoft.com> | 2020-08-17 13:23:12 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-12-14 04:12:07 +0300 |
commit | 0f22053e811ca5dd5d51b919741e02396ea600f3 (patch) | |
tree | 4054ee8c552fb4439740deb3561ed79fe54e85b6 /fs/cifs/cifspdu.h | |
parent | bc7c4129d4cdc56d1b5477c1714246f27df914dd (diff) | |
download | linux-0f22053e811ca5dd5d51b919741e02396ea600f3.tar.xz |
cifs: Fix unix perm bits to cifsacl conversion for "other" bits.
With the "cifsacl" mount option, the mode bits set on the file/dir
is converted to corresponding ACEs in DACL. However, only the
ALLOWED ACEs were being set for "owner" and "group" SIDs. Since
owner is a subset of group, and group is a subset of
everyone/world SID, in order to properly emulate unix perm groups,
we need to add DENIED ACEs. If we don't do that, "owner" and "group"
SIDs could get more access rights than they should. Which is what
was happening. This fixes it.
We try to keep the "preferred" order of ACEs, i.e. DENYs followed
by ALLOWs. However, for a small subset of cases we cannot
maintain the preferred order. In that case, we'll end up with the
DENY ACE for group after the ALLOW for the owner.
If owner SID == group SID, use the more restrictive
among the two perm bits and convert them to ACEs.
Also, for reverse mapping, i.e. to convert ACL to unix perm bits,
for the "others" bits, we needed to add the masked bits of the
owner and group masks to others mask.
Updated version of patch fixes a problem noted by the kernel
test robot.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cifspdu.h')
0 files changed, 0 insertions, 0 deletions