An Out-Of-Bounds Read vulnerability in smbCalcSize in fs/smb/client/netmisc.c in the Linux Kernel. This flaw could allow a local attacker to crash the system or leak internal kernel information. Refer; http://bugzilla.kernel.org/show_bug.cgi?id=218218 [1] Retrieve WordCount and add offset*2 to the data part of smb [2] Retrieve a 16-byte value from the calculated pointer ```c unsigned int smbCalcSize(void *buf) { struct smb_hdr *ptr = buf; return (sizeof(struct smb_hdr) + (2 * ptr->WordCount) + 2 /* size of the bcc field */ + get_bcc(ptr)); } ... static inline __u16 get_bcc(struct smb_hdr *hdr) { __le16 *bc_ptr = (__le16 *)BCC(hdr); return get_unaligned_le16(bc_ptr);//[2] } ... static inline void * BCC(struct smb_hdr *smb) { return (void *)smb + sizeof(*smb) + 2 * smb->WordCount; //[1] } ``` [2] cifs_demultiplex_thread → standard_receive3 → cifs_handle_standard → checkSMB → smbCalcSize ```c int checkSMB(char *buf, unsigned int total_read, struct TCP_Server_Info *server) { struct smb_hdr *smb = (struct smb_hdr *)buf; __u32 rfclen = be32_to_cpu(smb->smb_buf_length); __u32 clc_len; /* calculated length */ cifs_dbg(FYI, "checkSMB Length: 0x%x, smb_buf_length: 0x%x\n", total_read, rfclen); /* is this frame too small to even get to a BCC? */ if (total_read < 2 + sizeof(struct smb_hdr)) { ... } /* otherwise, there is enough to get to the BCC */ if (check_smb_hdr(smb)) return -EIO; clc_len = smbCalcSize(smb);
Created kernel tracking bugs for this issue: Affects: fedora-all [bug 2253612]
This was fixed for Fedora with the 6.6.9 stable kernel updates.
This issue has been addressed in the following products: Red Hat Enterprise Linux 9.2 Extended Update Support Via RHSA-2024:0725 http://access.redhat.com/errata/RHSA-2024:0725
This issue has been addressed in the following products: Red Hat Enterprise Linux 9.2 Extended Update Support Via RHSA-2024:0723 http://access.redhat.com/errata/RHSA-2024:0723
This issue has been addressed in the following products: Red Hat Enterprise Linux 8 Via RHSA-2024:0881 http://access.redhat.com/errata/RHSA-2024:0881
This issue has been addressed in the following products: Red Hat Enterprise Linux 8 Via RHSA-2024:0897 http://access.redhat.com/errata/RHSA-2024:0897
This issue has been addressed in the following products: Red Hat Enterprise Linux 8.6 Extended Update Support Via RHSA-2024:1188 http://access.redhat.com/errata/RHSA-2024:1188
This issue has been addressed in the following products: Red Hat Enterprise Linux 9 Via RHSA-2024:1248 http://access.redhat.com/errata/RHSA-2024:1248
This issue has been addressed in the following products: Red Hat Enterprise Linux 8.8 Extended Update Support Via RHSA-2024:1404 http://access.redhat.com/errata/RHSA-2024:1404