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: Wed, 13 Dec 2023 15:36:54 +0100
From: Sabrina Dubroca <sd@...asysnail.net>
To: Rahul Rameshbabu <rrameshbabu@...dia.com>
Cc: netdev@...r.kernel.org, Leon Romanovsky <leon@...nel.org>,
	Saeed Mahameed <saeed@...nel.org>, Gal Pressman <gal@...dia.com>,
	Tariq Toukan <tariqt@...dia.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH RFC net-next v1 2/3] macsec: Detect if Rx skb is
 macsec-related for offloading devices that update md_dst

2023-11-27, 11:10:19 -0800, Rahul Rameshbabu wrote:
> On Thu, 23 Nov, 2023 15:38:04 +0100 Sabrina Dubroca <sd@...asysnail.net> wrote:
> > If the device provided md_dst, either we find the corresponding rx_sc,
> > then we receive on this macsec device only, or we don't and try the
> > other macsec devices.
> >
> > Something like this (completely untested):
> >
> > 	if (macsec_is_offloaded(macsec) && netif_running(ndev)) {
> > 		struct macsec_rx_sc *rx_sc = NULL;
> > 		bool exact = false;
> >
> > 		if (macsec->offload_md_dst && !is_macsec_md_dst)
> > 			continue;
> >
> > 		if (is_macsec_md_dst) {
> > 			DEBUG_NET_WARN_ON_ONCE(!macsec->offload_md_dst);
> > 			rx_sc = find_rx_sc(&macsec->secy, md_dst->u.macsec_info.sci);
> > 			if (!rx_sc)
> > 				continue;
> > 			exact = true;
> > 		}
> >
> > 		if (exact ||
> > 		    ether_addr_equal_64bits(hdr->h_dest, ndev->dev_addr)) {
> > 			/* exact match, divert skb to this port */
> > 	[keep the existing code after this]
> >
> >
> > Am I missing something?
> 
> I just have one question with regards to this (will be testing this out
> too). For the exact match case, if the receiving traffic was macsec
> encrypted multicast, would the pkt_type be PACKET_HOST or
> PACKET_BROADCAST/PACKET_MULTICAST? My intuition is screaming to me that
> '[keep the existing code after this]' is not 100% true because we would
> want to update the skb pkt_type to PACKET_BROADCAST/PACKET_MULTICAST
> even if we are able to identify the incoming multicast frame was macsec
> encrypted and specifically intended for this device. Does that sound
> right?

Yes, I guess. SW decrypt path calls eth_type_trans, but that does a
lot more than we need here.

-- 
Sabrina


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ