linux-stable/fs/cifs
Yao Liu 36a3219e61 cifs: Fix NULL pointer dereference of devname
[ Upstream commit 68e2672f8f ]

There is a NULL pointer dereference of devname in strspn()

The oops looks something like:

  CIFS: Attempting to mount (null)
  BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
  ...
  RIP: 0010:strspn+0x0/0x50
  ...
  Call Trace:
   ? cifs_parse_mount_options+0x222/0x1710 [cifs]
   ? cifs_get_volume_info+0x2f/0x80 [cifs]
   cifs_setup_volume_info+0x20/0x190 [cifs]
   cifs_get_volume_info+0x50/0x80 [cifs]
   cifs_smb3_do_mount+0x59/0x630 [cifs]
   ? ida_alloc_range+0x34b/0x3d0
   cifs_do_mount+0x11/0x20 [cifs]
   mount_fs+0x52/0x170
   vfs_kern_mount+0x6b/0x170
   do_mount+0x216/0xdc0
   ksys_mount+0x83/0xd0
   __x64_sys_mount+0x25/0x30
   do_syscall_64+0x65/0x220
   entry_SYSCALL_64_after_hwframe+0x49/0xbe

Fix this by adding a NULL check on devname in cifs_parse_devname()

Signed-off-by: Yao Liu <yotta.liu@ucloud.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-05 22:33:00 +02:00
..
asn1.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
cache.c cifs: use 64-bit timestamps for fscache 2018-08-07 14:15:41 -05:00
cifs_debug.c smb3: allow stats which track session and share reconnects to be reset 2018-11-13 11:08:48 -08:00
cifs_debug.h cifs: add server argument to the dump_detail method 2018-05-27 17:56:35 -05:00
cifs_dfs_ref.c cifs: use correct format characters 2019-04-05 22:32:59 +02:00
cifs_fs_sb.h smb3: fix redundant opens on root 2018-05-27 17:56:35 -05:00
cifs_ioctl.h Enable previous version support 2016-10-13 19:48:11 -05:00
cifs_spnego.c smb3: on kerberos mount if server doesn't specify auth type use krb5 2018-11-13 11:08:48 -08:00
cifs_spnego.h
cifs_unicode.c fs/cifs: don't translate SFM_SLASH (U+F026) to backslash 2018-09-02 23:21:42 -05:00
cifs_unicode.h [SMB3] Remove ifdef since SMB3 (and later) now STRONGLY preferred 2017-07-08 18:57:07 -05:00
cifs_uniupr.h
cifsacl.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
cifsacl.h cifs: For SMB2 security informaion query, check for minimum sized security descriptor instead of sizeof FileAllInformation class 2018-06-04 19:19:24 -05:00
cifsencrypt.c cifs: Make sure all data pages are signed correctly 2018-08-07 14:15:41 -05:00
cifsfs.c cifs: don't dereference smb_file_target before null check 2018-11-27 16:12:58 +01:00
cifsfs.h cifs: update internal module version number for cifs.ko to 2.12 2018-08-23 15:11:10 -05:00
cifsglob.h CIFS: Do not skip SMB2 message IDs on send failures 2019-03-23 20:09:56 +01:00
cifspdu.h CIFS: move DFS response parsing out of SMB1 code 2017-03-01 22:26:10 -06:00
cifsproto.h cifs: add compound_send_recv() 2018-08-07 14:23:20 -05:00
cifssmb.c CIFS: Fix credits calculations for reads with errors 2019-01-31 08:14:37 +01:00
connect.c cifs: Fix NULL pointer dereference of devname 2019-04-05 22:33:00 +02:00
dir.c cifs: Fix separator when building path from dentry 2018-12-13 09:16:20 +01:00
dns_resolve.c
dns_resolve.h
export.c
file.c CIFS: fix POSIX lock leak and invalid ptr deref 2019-04-05 22:32:55 +02:00
fscache.c cifs: use 64-bit timestamps for fscache 2018-08-07 14:15:41 -05:00
fscache.h cifs: use 64-bit timestamps for fscache 2018-08-07 14:15:41 -05:00
inode.c smb3: do not attempt cifs operation in smb3 query info error path 2018-11-13 11:08:48 -08:00
ioctl.c [SMB3] Remove ifdef since SMB3 (and later) now STRONGLY preferred 2017-07-08 18:57:07 -05:00
Kconfig cifs: In Kconfig CONFIG_CIFS_POSIX needs depends on legacy (insecure cifs) 2018-12-21 14:15:23 +01:00
link.c smb3: don't request leases in symlink creation and query 2018-08-07 14:15:57 -05:00
Makefile smb3: Add ftrace tracepoints for improved SMB3 debugging 2018-05-27 17:56:35 -05:00
misc.c cifs: read overflow in is_valid_oplock_break() 2018-09-12 17:13:34 -05:00
netmisc.c cifs: use timespec64 internally 2018-08-07 14:15:41 -05:00
nterr.c
nterr.h
ntlmssp.h cifs: dynamic allocation of ntlmssp blob 2016-06-23 23:45:07 -05:00
readdir.c cifs: check ntwrk_buf_start for NULL before dereferencing it 2019-02-12 19:47:17 +01:00
rfc1002pdu.h
sess.c cifs: check kmalloc before use 2018-08-23 15:10:49 -05:00
smb1ops.c cifs: use correct format characters 2019-04-05 22:32:59 +02:00
smb2file.c cifs: Limit memory used by lock request calls to a page 2019-02-20 10:25:43 +01:00
smb2glob.h cifs: remove struct smb2_hdr 2018-06-01 09:14:30 -05:00
smb2inode.c smb3: Do not send SMB3 SET_INFO if nothing changed 2018-08-07 14:30:59 -05:00
smb2maperror.c CIFS: Fix error mapping for SMB2_LOCK command which caused OFD lock problem 2019-01-09 17:38:48 +01:00
smb2misc.c CIFS: Do not reset lease state to NONE on lease break 2019-03-23 20:09:56 +01:00
smb2ops.c CIFS: Do not skip SMB2 message IDs on send failures 2019-03-23 20:09:56 +01:00
smb2pdu.c cifs: Accept validate negotiate if server return NT_STATUS_NOT_SUPPORTED 2019-04-05 22:32:59 +02:00
smb2pdu.h cifs: fix computation for MAX_SMB2_HDR_SIZE 2019-03-13 14:02:31 -07:00
smb2proto.h cifs: update smb2_queryfs() to use compounding 2018-08-09 21:19:56 -05:00
smb2status.h
smb2transport.c CIFS: Do not skip SMB2 message IDs on send failures 2019-03-23 20:09:56 +01:00
smbdirect.c Linux 4.18 2018-08-16 13:12:00 -06:00
smbdirect.h cifs: fix SMB1 breakage 2018-07-05 13:48:24 -05:00
smbencrypt.c CIFS: refactor crypto shash/sdesc allocation&free 2018-04-01 20:24:39 -05:00
smberr.h
smbfsctl.h [SMB3] Send durable handle v2 contexts when use of persistent handles required 2015-11-03 09:26:27 -06:00
trace.c smb3: Add ftrace tracepoints for improved SMB3 debugging 2018-05-27 17:56:35 -05:00
trace.h smb3: add tracepoint for slow responses 2018-08-07 14:28:01 -05:00
transport.c CIFS: Do not skip SMB2 message IDs on send failures 2019-03-23 20:09:56 +01:00
winucase.c
xattr.c smb3: create smb3 equivalent alias for cifs pseudo-xattrs 2018-08-10 18:46:58 -05:00