[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250901134019.GB15473@horms.kernel.org>
Date: Mon, 1 Sep 2025 14:40:19 +0100
From: Simon Horman <horms@...nel.org>
To: Sabrina Dubroca <sd@...asysnail.net>
Cc: netdev@...r.kernel.org, Era Mayflower <mayflowerera@...il.com>,
Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH net] macsec: read MACSEC_SA_ATTR_PN with nla_get_uint
On Fri, Aug 29, 2025 at 08:55:40PM +0200, Sabrina Dubroca wrote:
> The code currently reads both U32 attributes and U64 attributes as
> U64, so when a U32 attribute is provided by userspace (ie, when not
> using XPN), on big endian systems, we'll load that value into the
> upper 32bits of the next_pn field instead of the lower 32bits. This
> means that the value that userspace provided is ignored (we only care
> about the lower 32bits for non-XPN), and we'll start using PNs from 0.
>
> Switch to nla_get_uint, which will read the value correctly on all
> arches, whether it's 32b or 64b.
>
> Fixes: 48ef50fa866a ("macsec: Netlink support of XPN cipher suites (IEEE 802.1AEbw)")
> Signed-off-by: Sabrina Dubroca <sd@...asysnail.net>
> ---
> I'm submitting it for net since it fixes the behavior on BE, but I'm
> ok if this goes to net-next instead. The patch doesn't conflict with
> my policy rework.
FWIIW, I lean towards net. This is because If I understand things
correctly, it does seem to fix a bug in some scenarios.
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists