]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ixgbe: fix ixgbe_orom_civd_info struct layout
authorJedrzej Jagielski <jedrzej.jagielski@intel.com>
Thu, 31 Jul 2025 12:45:33 +0000 (14:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Sep 2025 14:55:37 +0000 (16:55 +0200)
[ Upstream commit ed913b343dcf9f623e7436fa1a153c89b22d109b ]

The current layout of struct ixgbe_orom_civd_info causes incorrect data
storage due to compiler-inserted padding. This results in issues when
writing OROM data into the structure.

Add the __packed attribute to ensure the structure layout matches the
expected binary format without padding.

Fixes: 70db0788a262 ("ixgbe: read the OROM version information")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
drivers/net/ethernet/intel/ixgbe/ixgbe_type_e610.h

index 71ea25de1bac7af36399833250d7e6a6a9a2919d..754c176fd4a7a105dea48ff759d13c26ac4d8378 100644 (file)
@@ -3123,7 +3123,7 @@ static int ixgbe_get_orom_ver_info(struct ixgbe_hw *hw,
        if (err)
                return err;
 
-       combo_ver = le32_to_cpu(civd.combo_ver);
+       combo_ver = get_unaligned_le32(&civd.combo_ver);
 
        orom->major = (u8)FIELD_GET(IXGBE_OROM_VER_MASK, combo_ver);
        orom->patch = (u8)FIELD_GET(IXGBE_OROM_VER_PATCH_MASK, combo_ver);
index 09df67f03cf470315a3057f061231cdf1cdabaa0..38a41d81de0fa4211369a837fd48598a80577470 100644 (file)
@@ -1150,7 +1150,7 @@ struct ixgbe_orom_civd_info {
        __le32 combo_ver;       /* Combo Image Version number */
        u8 combo_name_len;      /* Length of the unicode combo image version string, max of 32 */
        __le16 combo_name[32];  /* Unicode string representing the Combo Image version */
-};
+} __packed;
 
 /* Function specific capabilities */
 struct ixgbe_hw_func_caps {