From: Jakub Kicinski <kuba@kernel.org>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2 06/13] macsec: use NLA_UINT for MACSEC_SA_ATTR_PN
Date: Thu, 28 Aug 2025 07:31:19 -0700 [thread overview]
Message-ID: <20250828073119.62cb3545@kernel.org> (raw)
In-Reply-To: <aLBm5t5nZtILh8YN@krikkit>
On Thu, 28 Aug 2025 16:25:42 +0200 Sabrina Dubroca wrote:
> 2025-08-27, 18:55:40 -0700, Jakub Kicinski wrote:
> > On Wed, 27 Aug 2025 18:54:15 -0700 Jakub Kicinski wrote:
> > > On Tue, 26 Aug 2025 15:16:24 +0200 Sabrina Dubroca wrote:
> > > I think this is a slight functional change on big endian.
> > > I suppose we don't care..
> >
> > we don't care == the change is not intentional, so in the unlikely case
> > BE users exist aligning with LE is better in the first place.
>
> I don't think this is changing the behavior. The previous check was
> copying whatever bytes were in the attribute into a u64 (incorrectly
> on BE) and setting the rest to 0, and then checking that this u64 is
> != 0. The new check is reading the value correctly and also checking
> that it's != 0.
>
> Converting the nla_get_u64(MACSEC_SA_ATTR_PN) in
> macsec_{add,upd}_{rx,tx}sa to get_uint would change the behavior on
> BE, but the current code hasn't worked correctly since XPN was
> introduced? We use 1<<32 instead of 1 as our PN, which doesn't make
> sense when using 32bit PNs. So I think we'll want to change all the
> nla_get_u64(MACSEC_SA_ATTR_PN) into
> nla_get_uint(MACSEC_SA_ATTR_PN). WDYT?
Heh, TBH I misconstrued the patch, I thought you already did
switch to get_uint. I think switching makes sense, I don't think
anyone is expecting the difference in behavior between LE and BE.
next prev parent reply other threads:[~2025-08-28 14:31 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-26 13:16 [PATCH net-next v2 00/13] macsec: replace custom netlink attribute checks with policy-level checks Sabrina Dubroca
2025-08-26 13:16 ` [PATCH net-next v2 01/13] macsec: replace custom checks on MACSEC_SA_ATTR_AN with NLA_POLICY_MAX Sabrina Dubroca
2025-08-27 16:53 ` Simon Horman
2025-08-26 13:16 ` [PATCH net-next v2 02/13] macsec: replace custom checks on MACSEC_*_ATTR_ACTIVE " Sabrina Dubroca
2025-08-27 16:53 ` Simon Horman
2025-08-26 13:16 ` [PATCH net-next v2 03/13] macsec: replace custom checks on MACSEC_SA_ATTR_SALT with NLA_POLICY_EXACT_LEN Sabrina Dubroca
2025-08-27 16:54 ` Simon Horman
2025-08-26 13:16 ` [PATCH net-next v2 04/13] macsec: replace custom checks on MACSEC_SA_ATTR_KEYID " Sabrina Dubroca
2025-08-27 16:54 ` Simon Horman
2025-08-26 13:16 ` [PATCH net-next v2 05/13] macsec: use NLA_POLICY_MAX_LEN for MACSEC_SA_ATTR_KEY Sabrina Dubroca
2025-08-27 16:54 ` Simon Horman
2025-08-26 13:16 ` [PATCH net-next v2 06/13] macsec: use NLA_UINT for MACSEC_SA_ATTR_PN Sabrina Dubroca
2025-08-27 16:54 ` Simon Horman
2025-08-28 1:54 ` Jakub Kicinski
2025-08-28 1:55 ` Jakub Kicinski
2025-08-28 14:25 ` Sabrina Dubroca
2025-08-28 14:31 ` Jakub Kicinski [this message]
2025-08-26 13:16 ` [PATCH net-next v2 07/13] macsec: remove validate_add_rxsc Sabrina Dubroca
2025-08-27 16:55 ` Simon Horman
2025-08-26 13:16 ` [PATCH net-next v2 08/13] macsec: add NLA_POLICY_MAX for MACSEC_OFFLOAD_ATTR_TYPE and IFLA_MACSEC_OFFLOAD Sabrina Dubroca
2025-08-27 16:55 ` Simon Horman
2025-08-28 1:51 ` Jakub Kicinski
2025-08-28 12:15 ` Sabrina Dubroca
2025-08-26 13:16 ` [PATCH net-next v2 09/13] macsec: replace custom checks on IFLA_MACSEC_ICV_LEN with NLA_POLICY_RANGE Sabrina Dubroca
2025-08-27 16:55 ` Simon Horman
2025-08-26 13:16 ` [PATCH net-next v2 10/13] macsec: use NLA_POLICY_VALIDATE_FN to validate IFLA_MACSEC_CIPHER_SUITE Sabrina Dubroca
2025-08-27 16:56 ` Simon Horman
2025-08-26 13:16 ` [PATCH net-next v2 11/13] macsec: validate IFLA_MACSEC_VALIDATION with NLA_POLICY_MAX Sabrina Dubroca
2025-08-27 16:56 ` Simon Horman
2025-08-26 13:16 ` [PATCH net-next v2 12/13] macsec: replace custom checks for IFLA_MACSEC_* flags " Sabrina Dubroca
2025-08-27 16:57 ` Simon Horman
2025-08-26 13:16 ` [PATCH net-next v2 13/13] macsec: replace custom check on IFLA_MACSEC_ENCODING_SA " Sabrina Dubroca
2025-08-27 16:57 ` Simon Horman
2025-08-28 2:00 ` [PATCH net-next v2 00/13] macsec: replace custom netlink attribute checks with policy-level checks patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250828073119.62cb3545@kernel.org \
--to=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sd@queasysnail.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.