netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Radu Pirea (OSS)" <radu-nicolae.pirea@oss.nxp.com>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, andrew@lunn.ch, hkallweit1@gmail.com,
	linux@armlinux.org.uk, richardcochran@gmail.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	sebastian.tobuschat@oss.nxp.com
Subject: Re: [PATCH net-next v8 5/7] net: phy: nxp-c45-tja11xx: add MACsec support
Date: Wed, 8 Nov 2023 15:50:02 +0200	[thread overview]
Message-ID: <1424ab1c-8e4e-47da-bacd-5b30b6d10c60@oss.nxp.com> (raw)
In-Reply-To: <ZTuE99jyr9gW3O1S@hog>

On 27.10.2023 12:37, Sabrina Dubroca wrote:
>> +static int nxp_c45_mdo_add_secy(struct macsec_context *ctx)
>> +{
> [...]
>> +	phy_secy = kzalloc(sizeof(*phy_secy), GFP_KERNEL);
>> +	if (!phy_secy)
>> +		return -ENOMEM;
>> +
>> +	INIT_LIST_HEAD(&phy_secy->sa_list);
>> +	phy_secy->secy = ctx->secy;
>> +	phy_secy->secy_id = idx;
>> +
>> +	/* If the point to point mode should be enabled, we should have only
>> +	 * one SecY enabled, respectively the new one.
>> +	 */
>> +	can_rx_sc0_impl = list_count_nodes(&priv->macsec->secy_list) == 0;
>> +	if (!nxp_c45_secy_valid(phy_secy, can_rx_sc0_impl)) {
>> +		kfree_sensitive(phy_secy);
> 
> kfree is enough here, no keying information has been stored in
> phy_secy.

Agreed. No key is stored in the driver. Changed kfree_sensitive calls to 
kfree calls.

> 
>> +		return -EINVAL;
>> +	}
>> +
>> +	nxp_c45_select_secy(phydev, phy_secy->secy_id);
>> +	nxp_c45_set_sci(phydev, MACSEC_TXSC_SCI_1H, ctx->secy->sci);
>> +	nxp_c45_tx_sc_set_flt(phydev, phy_secy);
>> +	nxp_c45_tx_sc_update(phydev, phy_secy);
>> +	if (phy_interrupt_is_valid(phydev))
>> +		nxp_c45_secy_irq_en(phydev, phy_secy, true);
> 
> Can macsec be used reliably in case we skip enabling the IRQ?
> 

IMO yes. macsec_pn_wrapped will not be called anymore if the TX PN 
overflows and no frame will go out via controlled port reusing the PNs, 
but this should not be an issue. The MKA should not wait until 
macsec_pn_wrapped is called and should change the keys before the PN 
overflow happens.

-- 
Radu P.

  reply	other threads:[~2023-11-08 13:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23  9:43 [PATCH net-next v8 0/7] Add MACsec support for TJA11XX C45 PHYs Radu Pirea (NXP OSS)
2023-10-23  9:43 ` [PATCH net-next v8 1/7] net: macsec: move sci_to_cpu to macsec header Radu Pirea (NXP OSS)
2023-10-23  9:43 ` [PATCH net-next v8 2/7] net: macsec: documentation for macsec_context and macsec_ops Radu Pirea (NXP OSS)
2023-10-23  9:43 ` [PATCH net-next v8 3/7] net: macsec: revert the MAC address if mdo_upd_secy fails Radu Pirea (NXP OSS)
2023-10-23  9:43 ` [PATCH net-next v8 4/7] net: macsec: introduce mdo_insert_tx_tag Radu Pirea (NXP OSS)
2023-10-25 22:40   ` Jakub Kicinski
2023-10-23  9:43 ` [PATCH net-next v8 5/7] net: phy: nxp-c45-tja11xx: add MACsec support Radu Pirea (NXP OSS)
2023-10-26 23:02   ` kernel test robot
2023-10-27  9:37   ` Sabrina Dubroca
2023-11-08 13:50     ` Radu Pirea (OSS) [this message]
2023-11-04 11:35   ` Simon Horman
2023-11-08 10:45     ` Radu Pirea (OSS)
2023-10-23  9:43 ` [PATCH net-next v8 6/7] net: phy: nxp-c45-tja11xx: add MACsec statistics Radu Pirea (NXP OSS)
2023-10-23  9:43 ` [PATCH net-next v8 7/7] net: phy: nxp-c45-tja11xx: implement mdo_insert_tx_tag Radu Pirea (NXP OSS)
2023-10-25 16:21 ` [PATCH net-next v8 0/7] Add MACsec support for TJA11XX C45 PHYs Radu Pirea (OSS)
2023-10-25 22:18   ` Jakub Kicinski
2023-10-25 22:40     ` Jakub Kicinski
2023-10-25 22:46       ` Jakub Kicinski

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=1424ab1c-8e4e-47da-bacd-5b30b6d10c60@oss.nxp.com \
    --to=radu-nicolae.pirea@oss.nxp.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sd@queasysnail.net \
    --cc=sebastian.tobuschat@oss.nxp.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).