linux-stable/fs/cifs
Harshit Mogalapalli 1316c28569 cifs: potential buffer overflow in handling symlinks
[ Upstream commit 64c4a37ac0 ]

Smatch printed a warning:
	arch/x86/crypto/poly1305_glue.c:198 poly1305_update_arch() error:
	__memcpy() 'dctx->buf' too small (16 vs u32max)

It's caused because Smatch marks 'link_len' as untrusted since it comes
from sscanf(). Add a check to ensure that 'link_len' is not larger than
the size of the 'link_str' buffer.

Fixes: c69c1b6eae ("cifs: implement CIFSParseMFSymlink()")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-20 09:08:31 +02:00
..
asn1.c cifs: remove bogus debug code 2020-10-29 09:07:00 +01:00
cache.c
cifs_debug.c
cifs_debug.h
cifs_dfs_ref.c cifs: use correct format characters 2019-04-05 22:31:28 +02:00
cifs_fs_sb.h
cifs_ioctl.h
cifs_spnego.c
cifs_spnego.h
cifs_unicode.c CIFS: Fix a potencially linear read overflow 2021-09-22 11:45:22 +02:00
cifs_unicode.h
cifs_uniupr.h
cifsacl.c cifs: Fix mode output in debugging statements 2020-03-11 18:02:46 +01:00
cifsacl.h
cifsencrypt.c
cifsfs.c cifs: fix double free race when mount fails in cifs_get_root() 2022-03-08 19:01:55 +01:00
cifsfs.h
cifsglob.h CIFS: Properly process SMB3 lease breaks 2020-10-01 13:12:30 +02:00
cifspdu.h
cifsproto.h cifs: Fix cifsInodeInfo lock_sem deadlock when reconnect occurs 2019-11-10 11:25:19 +01:00
cifssmb.c CIFS: Fix credits calculations for reads with errors 2019-01-31 08:13:44 +01:00
connect.c cifs: fix incorrect check for null pointer in header_assemble 2021-10-06 15:05:04 +02:00
dir.c cifs: report error instead of invalid when revalidating a dentry fails 2021-02-10 09:12:09 +01:00
dns_resolve.c
dns_resolve.h
export.c
file.c cifs: revalidate mapping when we open files for SMB1 POSIX 2021-04-10 13:20:11 +02:00
fscache.c
fscache.h
inode.c Revert "cifs: Fix the target file was deleted when rename failed." 2020-07-29 07:42:56 +02:00
ioctl.c
Kconfig cifs: allow disabling insecure dialects in the config 2019-01-26 09:37:07 +01:00
link.c cifs: potential buffer overflow in handling symlinks 2022-04-20 09:08:31 +02:00
Makefile
misc.c CIFS: Properly process SMB3 lease breaks 2020-10-01 13:12:30 +02:00
netmisc.c fs: cifs: mute -Wunused-const-variable message 2019-11-06 12:43:10 +01:00
nterr.c
nterr.h
ntlmssp.h
readdir.c cifs: check ntwrk_buf_start for NULL before dereferencing it 2019-02-12 19:46:08 +01:00
rfc1002pdu.h
sess.c cifs: fix wrong release in sess_alloc_buffer() failed path 2021-09-22 11:45:31 +02:00
smb1ops.c CIFS: Properly process SMB3 lease breaks 2020-10-01 13:12:30 +02:00
smb2file.c cifs: Adjust indentation in smb2_open_file 2020-01-17 19:45:45 +01:00
smb2glob.h
smb2inode.c
smb2maperror.c SMB3: retry on STATUS_INSUFFICIENT_RESOURCES instead of failing write 2019-06-25 11:36:54 +08:00
smb2misc.c cifs: Silently ignore unknown oplock break handle 2021-04-10 13:20:11 +02:00
smb2ops.c cifs: fix memory leak in smb2_copychunk_range 2021-05-26 11:46:58 +02:00
smb2pdu.c SMB3: incorrect file id in requests compounded with open 2021-06-03 08:36:22 +02:00
smb2pdu.h smb3: Fix out-of-bounds bug in SMB2_negotiate() 2021-02-10 09:12:09 +01:00
smb2proto.h
smb2status.h
smb2transport.c
smbencrypt.c
smberr.h
smbfsctl.h
transport.c CIFS: Do not hide EINTR after sending network packets 2019-01-16 22:07:10 +01:00
winucase.c
xattr.c CIFS: fix max ea value size 2019-10-05 12:48:12 +02:00