]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ksmbd: common: use struct_group_attr instead of struct_group for network_open_info
authorNamjae Jeon <linkinjeon@kernel.org>
Fri, 19 Apr 2024 14:46:34 +0000 (23:46 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Apr 2024 15:11:44 +0000 (17:11 +0200)
commit 0268a7cc7fdc47d90b6c18859de7718d5059f6f1 upstream.

4byte padding cause the connection issue with the applications of MacOS.
smb2_close response size increases by 4 bytes by padding, And the smb
client of MacOS check it and stop the connection. This patch use
struct_group_attr instead of struct_group for network_open_info to use
 __packed to avoid padding.

Fixes: 0015eb6e1238 ("smb: client, common: fix fortify warnings")
Cc: stable@vger.kernel.org
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/common/smb2pdu.h

index 63f969a8e44d7c237ce1ae57c3044b47d1497ecd..22c94dea52116f48be91bfac5a37576ba6a55a3e 100644 (file)
@@ -700,7 +700,7 @@ struct smb2_close_rsp {
        __le16 StructureSize; /* 60 */
        __le16 Flags;
        __le32 Reserved;
-       struct_group(network_open_info,
+       struct_group_attr(network_open_info, __packed,
                __le64 CreationTime;
                __le64 LastAccessTime;
                __le64 LastWriteTime;