lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 28 Aug 2023 12:46:31 +0000
From:   "Greenman, Gregory" <gregory.greenman@...el.com>
To:     "kvalo@...nel.org" <kvalo@...nel.org>,
        "arnd@...nel.org" <arnd@...nel.org>,
        "shahar.s.matityahu@...el.com" <shahar.s.matityahu@...el.com>,
        "Coelho, Luciano" <luciano.coelho@...el.com>
CC:     "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
        "Berg, Johannes" <johannes.berg@...el.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "arnd@...db.de" <arnd@...db.de>,
        "Sisodiya, Mukesh" <mukesh.sisodiya@...el.com>
Subject: Re: [PATCH] iwlwifi: dbg_ini: fix structure packing

On Fri, 2023-06-16 at 11:03 +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> The iwl_fw_ini_error_dump_range structure has conflicting alignment
> requirements for the inner union and the outer struct:
> 
> In file included from drivers/net/wireless/intel/iwlwifi/fw/dbg.c:9:
> drivers/net/wireless/intel/iwlwifi/fw/error-dump.h:312:2: error: field  within 'struct iwl_fw_ini_error_dump_range' is less aligned than 'union iwl_fw_ini_error_dump_range::(anonymous at
> drivers/net/wireless/intel/iwlwifi/fw/error-dump.h:312:2)' and is usually due to 'struct iwl_fw_ini_error_dump_range' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access]
>         union {
> 
> As the original intention was apparently to make the entire structure
> unaligned, mark the innermost members the same way so the union
> becomes packed as well.
> 
> Fixes: 973193554cae6 ("iwlwifi: dbg_ini: dump headers cleanup")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>  drivers/net/wireless/intel/iwlwifi/fw/error-dump.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/fw/error-dump.h b/drivers/net/wireless/intel/iwlwifi/fw/error-dump.h
> index f5e08988dc7bf..06d6f7f664308 100644
> --- a/drivers/net/wireless/intel/iwlwifi/fw/error-dump.h
> +++ b/drivers/net/wireless/intel/iwlwifi/fw/error-dump.h
> @@ -310,9 +310,9 @@ struct iwl_fw_ini_fifo_hdr {
>  struct iwl_fw_ini_error_dump_range {
>         __le32 range_data_size;
>         union {
> -               __le32 internal_base_addr;
> -               __le64 dram_base_addr;
> -               __le32 page_num;
> +               __le32 internal_base_addr __packed;
> +               __le64 dram_base_addr __packed;
> +               __le32 page_num __packed;
>                 struct iwl_fw_ini_fifo_hdr fifo_hdr;
>                 struct iwl_cmd_header fw_pkt_hdr;
>         };

Acked-by: Gregory Greenman <gregory.greenman@...el.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ