kernel_samsung_a53x/fs/cifs
Paulo Alcantara 9011b2c0fe smb: client: fix OOB in smbCalcSize()
[ Upstream commit b35858b3786ddbb56e1c35138ba25d6adf8d0bef ]

Validate @smb->WordCount to avoid reading off the end of @smb and thus
causing the following KASAN splat:

  BUG: KASAN: slab-out-of-bounds in smbCalcSize+0x32/0x40 [cifs]
  Read of size 2 at addr ffff88801c024ec5 by task cifsd/1328

  CPU: 1 PID: 1328 Comm: cifsd Not tainted 6.7.0-rc5 #9
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
  rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014
  Call Trace:
   <TASK>
   dump_stack_lvl+0x4a/0x80
   print_report+0xcf/0x650
   ? srso_alias_return_thunk+0x5/0xfbef5
   ? srso_alias_return_thunk+0x5/0xfbef5
   ? __phys_addr+0x46/0x90
   kasan_report+0xd8/0x110
   ? smbCalcSize+0x32/0x40 [cifs]
   ? smbCalcSize+0x32/0x40 [cifs]
   kasan_check_range+0x105/0x1b0
   smbCalcSize+0x32/0x40 [cifs]
   checkSMB+0x162/0x370 [cifs]
   ? __pfx_checkSMB+0x10/0x10 [cifs]
   cifs_handle_standard+0xbc/0x2f0 [cifs]
   ? srso_alias_return_thunk+0x5/0xfbef5
   cifs_demultiplex_thread+0xed1/0x1360 [cifs]
   ? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs]
   ? srso_alias_return_thunk+0x5/0xfbef5
   ? lockdep_hardirqs_on_prepare+0x136/0x210
   ? __pfx_lock_release+0x10/0x10
   ? srso_alias_return_thunk+0x5/0xfbef5
   ? mark_held_locks+0x1a/0x90
   ? lockdep_hardirqs_on_prepare+0x136/0x210
   ? srso_alias_return_thunk+0x5/0xfbef5
   ? srso_alias_return_thunk+0x5/0xfbef5
   ? __kthread_parkme+0xce/0xf0
   ? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs]
   kthread+0x18d/0x1d0
   ? kthread+0xdb/0x1d0
   ? __pfx_kthread+0x10/0x10
   ret_from_fork+0x34/0x60
   ? __pfx_kthread+0x10/0x10
   ret_from_fork_asm+0x1b/0x30
   </TASK>

This fixes CVE-2023-6606.

Reported-by: j51569436@gmail.com
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218218
Cc: stable@vger.kernel.org
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 12:12:02 +01:00
..
asn1.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cache.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifs_debug.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifs_debug.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifs_dfs_ref.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifs_fs_sb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifs_ioctl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifs_spnego.c cifs: spnego: add ';' in HOST_KEY_LEN 2024-11-18 11:43:20 +01:00
cifs_spnego.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifs_unicode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifs_unicode.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifs_uniupr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifsacl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifsacl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifsencrypt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifsfs.c cifs: Fix non-availability of dedup breaking generic/304 2024-11-18 12:11:47 +01:00
cifsfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifsglob.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifspdu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifsproto.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifsroot.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cifssmb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
connect.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dfs_cache.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dfs_cache.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dns_resolve.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dns_resolve.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
export.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
file.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fs_context.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fs_context.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fscache.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fscache.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
inode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ioctl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
link.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
misc.c smb: client: fix OOB in smbCalcSize() 2024-11-18 12:12:02 +01:00
netmisc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nterr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nterr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ntlmssp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
readdir.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rfc1002pdu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sess.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smb1ops.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smb2file.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smb2glob.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smb2inode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smb2maperror.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smb2misc.c smb: client: fix NULL deref in asn1_ber_decoder() 2024-11-18 12:12:00 +01:00
smb2ops.c smb: client: fix OOB in smb2_query_reparse_point() 2024-11-18 12:11:58 +01:00
smb2pdu.c smb: client: fix OOB in SMB2_query_info_init() 2024-11-18 12:12:02 +01:00
smb2pdu.h ksmbd: fix wrong name of SMB2_CREATE_ALLOCATION_SIZE 2024-11-18 12:11:58 +01:00
smb2proto.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smb2status.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smb2transport.c cifs: fix check of rc in function generate_smb3signingkey 2024-11-18 11:43:20 +01:00
smbdirect.c smbdirect: missing rc checks while waiting for rdma events 2024-11-18 10:58:32 +01:00
smbdirect.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smbencrypt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smberr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smbfsctl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
transport.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
winucase.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xattr.c smb3: fix caching of ctime on setxattr 2024-11-18 12:11:13 +01:00