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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251017170610.4f5c3f22@kernel.org>
Date: Fri, 17 Oct 2025 17:06:10 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Dong Yibo <dong100@...se.com>
Cc: davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
 horms@...nel.org, corbet@....net, andrew+netdev@...n.ch,
 danishanwar@...com, vadim.fedorenko@...ux.dev, netdev@...r.kernel.org,
 linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v14 4/5] net: rnpgbe: Add basic mbx_fw support

On Tue, 14 Oct 2025 15:27:10 +0800 Dong Yibo wrote:
> +/* FW stores extended information in 'ext_info' as a 32-bit
> + * little-endian value. To make these flags easily accessible in the
> + * kernel (via named 'bitfields' instead of raw bitmask operations),
> + * we use the union's 'e_host' struct, which provides named bits
> + * (e.g., 'wol_en', 'smbus_en')
> + */
> +static inline void mucse_hw_info_update_host_endian(struct mucse_hw_info *info)
> +{
> +	u32 host_val = le32_to_cpu(info->ext_info);
> +
> +	memcpy(&info->e_host, &host_val, sizeof(info->e_host));

This is not going to be enough. C bitfields are also affected by endian.
The best practice in the kernel is to define the fields as #defines
and user FIELD_GET() or direct & / | operations with the constants.
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ