KSPP / linux

Linux kernel source tree (Kernel Self Protection Project)
https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project
Other
80 stars 5 forks source link

Replace one-element array with flexible-array member in fs/smb/server/smb_common.h #317

Closed GustavoARSilva closed 5 months ago

GustavoARSilva commented 1 year ago
diff -u -p a/fs/smb/server/smb_common.h b/fs/smb/server/smb_common.h
--- a/fs/smb/server/smb_common.h
+++ b/fs/smb/server/smb_common.h
@@ -200,7 +200,7 @@ struct smb_hdr {
 struct smb_negotiate_req {
        struct smb_hdr hdr;     /* wct = 0 */
        __le16 ByteCount;
-       unsigned char DialectsArray[1];
+       unsigned char DialectsArray[];
 } __packed;
GustavoARSilva commented 1 year ago

Patch: https://lore.kernel.org/linux-hardening/ZJNnynWOoTp6uTwF@work/

kees commented 5 months ago

Fixed in commit 11d5e2061e973.