]> git.baikalelectronics.ru Git - kernel.git/commit
smb3: do not allow insecure cifs mounts when using smb3
authorSteve French <stfrench@microsoft.com>
Wed, 6 Jun 2018 22:59:29 +0000 (17:59 -0500)
committerSteve French <stfrench@microsoft.com>
Thu, 7 Jun 2018 13:36:39 +0000 (08:36 -0500)
commitc7c137b931b6894531003b5de888ad012dc37ba6
tree358e89116a84a27ee19436eee4ab07e847ea7e9c
parent8ddecf5fd728d3c6373394fa647d28e7c27f93a7
smb3: do not allow insecure cifs mounts when using smb3

if mounting as smb3 do not allow cifs (vers=1.0) or insecure vers=2.0
mounts.

For example:
root@smf-Thinkpad-P51:~/cifs-2.6# mount -t smb3 //127.0.0.1/scratch /mnt -o username=testuser,password=Testpass1
root@smf-Thinkpad-P51:~/cifs-2.6# umount /mnt
root@smf-Thinkpad-P51:~/cifs-2.6# mount -t smb3 //127.0.0.1/scratch /mnt -o username=testuser,password=Testpass1,vers=1.0
mount: /mnt: wrong fs type, bad option, bad superblock on //127.0.0.1/scratch ...
root@smf-Thinkpad-P51:~/cifs-2.6# dmesg | grep smb3
[ 4302.200122] CIFS VFS: vers=1.0 (cifs) not permitted when mounting with smb3
root@smf-Thinkpad-P51:~/cifs-2.6# mount -t smb3 //127.0.0.1/scratch /mnt -o username=testuser,password=Testpass1,vers=3.11

Signed-off-by: Steve French <stfrench@microsoft.com>
Acked-by: Pavel Shilovsky <pshilov@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Sachin Prabhu <sprabhu@redhat.com>
fs/cifs/cifsfs.c
fs/cifs/cifsproto.h
fs/cifs/connect.c