linux/fs/smb/client
Paulo Alcantara 49024ec879 smb: client: fix parsing of source mount option
Handle trailing and leading separators when parsing UNC and prefix
paths in smb3_parse_devname().  Then, store the sanitised paths in
smb3_fs_context::source.

This fixes the following cases

$ mount //srv/share// /mnt/1 -o ...
$ cat /mnt/1/d0/f0
cat: /mnt/1/d0/f0: Invalid argument

The -EINVAL was returned because the client sent SMB2_CREATE "\\d0\f0"
rather than SMB2_CREATE "\d0\f0".

$ mount //srv//share /mnt/1 -o ...
mount: Invalid argument

The -EINVAL was returned correctly although the client only realised
it after sending a couple of bad requests rather than bailing out
earlier when parsing mount options.

Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
2023-06-28 11:48:56 -05:00
..
asn1.c
cached_dir.c
cached_dir.h
cifs_debug.c cifs: print client_guid in DebugData 2023-06-28 11:47:50 -05:00
cifs_debug.h
cifs_dfs_ref.c smb: client: fix parsing of source mount option 2023-06-28 11:48:56 -05:00
cifs_fs_sb.h
cifs_ioctl.h
cifs_spnego_negtokeninit.asn1
cifs_spnego.c
cifs_spnego.h
cifs_swn.c
cifs_swn.h
cifs_unicode.c
cifs_unicode.h
cifs_uniupr.h
cifsacl.c
cifsacl.h
cifsencrypt.c
cifsfs.c smb: client: fix warning in cifs_smb3_do_mount() 2023-06-20 23:02:52 -05:00
cifsfs.h
cifsglob.h cifs: fix sockaddr comparison in iface_cmp 2023-06-11 20:52:49 -05:00
cifspdu.h
cifsproto.h smb: client: fix parsing of source mount option 2023-06-28 11:48:56 -05:00
cifsroot.c
cifssmb.c smb: client: fix warning in CIFSFindNext() 2023-06-20 23:03:03 -05:00
connect.c smb: client: fix warning in generic_ip_connect() 2023-06-20 23:03:03 -05:00
dfs_cache.c
dfs_cache.h
dfs.c smb: client: fix parsing of source mount option 2023-06-28 11:48:56 -05:00
dfs.h
dir.c
dns_resolve.c
dns_resolve.h
export.c
file.c SMB3: Do not send lease break acknowledgment if all file handles have been closed 2023-06-19 18:16:26 -05:00
fs_context.c smb: client: fix parsing of source mount option 2023-06-28 11:48:56 -05:00
fs_context.h
fscache.c
fscache.h
inode.c cifs: print more detail when invalidate_inode_mapping fails 2023-06-20 23:03:03 -05:00
ioctl.c cifs: address unused variable warning 2023-05-27 03:33:23 -05:00
Kconfig
link.c
Makefile
misc.c smb: client: fix parsing of source mount option 2023-06-28 11:48:56 -05:00
netlink.c
netlink.h
netmisc.c
nterr.c
nterr.h
ntlmssp.h
readdir.c
rfc1002pdu.h
sess.c
smb1ops.c
smb2file.c
smb2glob.h
smb2inode.c smb: client: fix broken file attrs with nodfs mounts 2023-06-28 11:47:53 -05:00
smb2maperror.c
smb2misc.c
smb2ops.c cifs: do all necessary checks for credits within or before locking 2023-06-28 11:46:58 -05:00
smb2pdu.c cifs: fix session state check in reconnect to avoid use-after-free issue 2023-06-28 11:47:43 -05:00
smb2pdu.h
smb2proto.h
smb2status.h
smb2transport.c cifs: fix session state check in smb2_find_smb_ses 2023-06-28 11:47:46 -05:00
smbdirect.c
smbdirect.h
smbencrypt.c
smberr.h
trace.c
trace.h
transport.c cifs: do all necessary checks for credits within or before locking 2023-06-28 11:46:58 -05:00
unc.c
winucase.c
xattr.c