smb3: fix setting SecurityFlags when encryption is required
authorSteve French <stfrench@microsoft.com>
Thu, 1 Aug 2024 02:38:50 +0000 (21:38 -0500)
committerSteve French <stfrench@microsoft.com>
Thu, 8 Aug 2024 16:14:53 +0000 (11:14 -0500)
commit1b5487aefb1ce7a6b1f15a33297d1231306b4122
treedeb651cc85484975fe4f72ad69b4c8644b296f32
parentde9c2c66ad8e787abec7c9d7eff4f8c3cdd28aed
smb3: fix setting SecurityFlags when encryption is required

Setting encryption as required in security flags was broken.
For example (to require all mounts to be encrypted by setting):

  "echo 0x400c5 > /proc/fs/cifs/SecurityFlags"

Would return "Invalid argument" and log "Unsupported security flags"
This patch fixes that (e.g. allowing overriding the default for
SecurityFlags  0x00c5, including 0x40000 to require seal, ie
SMB3.1.1 encryption) so now that works and forces encryption
on subsequent mounts.

Acked-by: Bharath SM <bharathsm@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Documentation/admin-guide/cifs/usage.rst
fs/smb/client/cifs_debug.c
fs/smb/client/cifsglob.h
fs/smb/client/smb2pdu.c