From: Pali Rohár Date: Wed, 25 Dec 2024 14:54:22 +0000 (+0100) Subject: cifs: Fix endian types in struct rfc1002_session_packet X-Git-Tag: v6.14-rc1~127^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e2ee328291585b7224ac8cc025625841ccfbf03;p=thirdparty%2Fkernel%2Flinux.git cifs: Fix endian types in struct rfc1002_session_packet All fields in struct rfc1002_session_packet are in big endian. This is because all NetBIOS packet headers are in big endian as opposite of SMB structures which are in little endian. Therefore use __be16 and __be32 types instead of __u16 and __u32 in struct rfc1002_session_packet. Reported-by: kernel test robot Signed-off-by: Pali Rohár Signed-off-by: Steve French --- diff --git a/fs/smb/client/rfc1002pdu.h b/fs/smb/client/rfc1002pdu.h index ae1d025da294a..ac82c2f3a4a28 100644 --- a/fs/smb/client/rfc1002pdu.h +++ b/fs/smb/client/rfc1002pdu.h @@ -24,7 +24,7 @@ struct rfc1002_session_packet { __u8 type; __u8 flags; - __u16 length; + __be16 length; union { struct { __u8 called_len; @@ -35,8 +35,8 @@ struct rfc1002_session_packet { __u8 scope2; /* null */ } __attribute__((packed)) session_req; struct { - __u32 retarget_ip_addr; - __u16 port; + __be32 retarget_ip_addr; + __be16 port; } __attribute__((packed)) retarget_resp; __u8 neg_ses_resp_error_code; /* POSITIVE_SESSION_RESPONSE packet does not include trailer.