linux-stable/fs/cifs
Paulo Alcantara ee0fb9baa7 smb: client: fix parsing of SMB3.1.1 POSIX create context
[ Upstream commit 76025cc228 ]

The data offset for the SMB3.1.1 POSIX create context will always be
8-byte aligned so having the check 'noff + nlen >= doff' in
smb2_parse_contexts() is wrong as it will lead to -EINVAL because noff
+ nlen == doff.

Fix the sanity check to correctly handle aligned create context data.

Fixes: af1689a9b7 ("smb: client: fix potential OOBs in smb2_parse_contexts()")
Signed-off-by: Paulo Alcantara <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
[Guru:smb2_parse_contexts()  is present in file smb2ops.c,
smb2ops.c file location is changed, modified patch accordingly.]
Signed-off-by: Guruswamy Basavaiah <guruswamy.basavaiah@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-03-01 13:21:42 +01:00
..
asn1.c cifs: decoding negTokenInit with generic ASN1 decoder 2021-06-20 21:28:17 -05:00
cache.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifs_debug.c cifs: print session id while listing open files 2023-03-30 12:47:55 +02:00
cifs_debug.h cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
cifs_dfs_ref.c cifs: use fs_context for automounts 2023-08-03 10:22:29 +02:00
cifs_fs_sb.h cifs: support nested dfs links over reconnect 2022-12-02 17:40:59 +01:00
cifs_ioctl.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifs_spnego.c cifs: spnego: add ';' in HOST_KEY_LEN 2023-11-28 16:56:25 +00:00
cifs_spnego.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifs_spnego_negtokeninit.asn1 cifs: decoding negTokenInit with generic ASN1 decoder 2021-06-20 21:28:17 -05:00
cifs_swn.c cifs: remove support for NTLM and weaker authentication algorithms 2021-08-25 15:47:06 -05:00
cifs_swn.h cifs: simplify SWN code with dummy funcs instead of ifdefs 2021-04-25 16:28:22 -05:00
cifs_unicode.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifs_unicode.h
cifs_uniupr.h
cifsacl.c cifs: modefromsids must add an ACE for authenticated users 2022-03-08 19:12:30 +01:00
cifsacl.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifsencrypt.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifsfs.c cifs: Fix non-availability of dedup breaking generic/304 2023-12-13 18:36:50 +01:00
cifsfs.h cifs: fix DFS traversal oops without CONFIG_CIFS_DFS_UPCALL 2023-04-05 11:24:59 +02:00
cifsglob.h SMB3: drop reference to cfile before sending oplock break 2023-05-24 17:36:54 +01:00
cifspdu.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
cifsproto.h cifs: fix oops during encryption 2023-01-12 11:58:41 +01:00
cifsroot.c
cifssmb.c cifs: prevent infinite recursion in CIFSGetDFSRefer() 2023-04-05 11:24:58 +02:00
connect.c smb3: fix problem remounting a share after shutdown 2023-05-17 11:50:23 +02:00
dfs_cache.c cifs: fix return of uninitialized rc in dfs_cache_update_tgthint() 2023-02-06 07:59:00 +01:00
dfs_cache.h cifs: support share failover when remounting 2021-07-22 11:43:23 -05:00
dir.c cifs: Fix xid leak in cifs_create() 2022-10-29 10:12:56 +02:00
dns_resolve.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
dns_resolve.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
export.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
file.c cifs: Release folio lock on fscache read hit. 2023-08-26 14:23:36 +02:00
fs_context.c cifs: mapchars mount option ignored 2023-05-30 13:55:32 +01:00
fs_context.h cifs: sanitize paths in cifs_update_super_prepath. 2023-04-13 16:48:24 +02:00
fscache.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
fscache.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
inode.c smb3: correct places where ENOTSUPP is used instead of preferred EOPNOTSUPP 2023-10-06 13:18:17 +02:00
ioctl.c cifs: Fix wrong return value checking when GETFLAGS 2022-11-26 09:24:41 +01:00
Kconfig cifs: create a MD4 module and switch cifs.ko to use it 2021-08-25 15:48:00 -05:00
link.c cifs: Fix uninitialized memory read for smb311 posix symlink create 2023-01-18 11:48:49 +01:00
Makefile cifs: decoding negTokenInit with generic ASN1 decoder 2021-06-20 21:28:17 -05:00
misc.c smb: client: fix OOB in smbCalcSize() 2024-01-05 15:13:38 +01:00
netlink.c cifs: Constify static struct genl_ops 2021-06-20 21:28:16 -05:00
netlink.h cifs: Register generic netlink family 2020-12-14 09:16:22 -06:00
netmisc.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
nterr.c
nterr.h
ntlmssp.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
readdir.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
rfc1002pdu.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
sess.c cifs: Fix xid leak in cifs_ses_add_channel() 2022-10-29 10:12:56 +02:00
smb1ops.c SMB3: drop reference to cfile before sending oplock break 2023-05-24 17:36:54 +01:00
smb2file.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
smb2glob.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
smb2inode.c cifs: Fix smb2_set_path_size() 2023-03-22 13:31:33 +01:00
smb2maperror.c cifs: cifs_md4 convert to SPDX identifier 2021-08-25 15:51:52 -05:00
smb2misc.c smb3: Replace smb2pdu 1-element arrays with flex-arrays 2024-02-23 08:55:15 +01:00
smb2ops.c smb: client: fix potential OOBs in smb2_parse_contexts() 2024-03-01 13:21:42 +01:00
smb2pdu.c smb: client: fix parsing of SMB3.1.1 POSIX create context 2024-03-01 13:21:42 +01:00
smb2pdu.h smb3: Replace smb2pdu 1-element arrays with flex-arrays 2024-02-23 08:55:15 +01:00
smb2proto.h smb: client: fix potential OOBs in smb2_parse_contexts() 2024-03-01 13:21:42 +01:00
smb2status.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
smb2transport.c cifs: fix check of rc in function generate_smb3signingkey 2023-11-28 16:56:25 +00:00
smbdirect.c cifs: Fix warning and UAF when destroy the MR list 2023-03-10 09:39:32 +01:00
smbdirect.h
smbencrypt.c cifs: rename cifs_common to smbfs_common 2021-09-08 23:59:26 -05:00
smberr.h cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
trace.c
trace.h cifs: fix string declarations and assignments in tracepoints 2021-05-27 14:04:32 -05:00
transport.c cifs: Move the in_send statistic to __smb_send_rqst() 2023-03-22 13:31:22 +01:00
unc.c cifs: don't cargo-cult strndup() 2021-04-25 16:28:23 -05:00
winucase.c cifs: remove pathname for file from SPDX header 2021-09-13 14:51:10 -05:00
xattr.c smb3: fix caching of ctime on setxattr 2023-12-08 08:48:04 +01:00