Netdev List
 help / color / mirror / Atom feed
* [PATCH net] macsec: ignore inactive receive secure channels
@ 2026-10-08  8:26 Sung Byeongchan
  2026-10-08 13:26 ` Sabrina Dubroca
  0 siblings, 1 reply; 2+ messages in thread
From: Sung Byeongchan @ 2026-10-08  8:26 UTC (permalink / raw)
  To: Sabrina Dubroca; +Cc: netdev

The receive path looks up an RXSC by SCI without checking its active flag.
An active child RXSA can therefore authenticate and deliver frames after
userspace has administratively disabled the RXSC.

Restrict the receive-only RCU lookup to active RXSCs. Keep the RTNL lookup
used for configuration unchanged so userspace can reactivate or remove an
inactive channel.

All three baseline runs delivered a valid protected frame while an
independent state dump reported the RXSC off. All three fixed runs rejected
the frame. RXSC reactivation and RXSA off/on controls retained their
expected behavior.

The demonstrated impact is a revocation and integrity-policy bypass. No
memory corruption or RCE/LPE primitive was observed.

This change was prepared with assistance from OpenAI Codex. I reviewed the
source change, test results, and this commit message.

Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
Assisted-by: OpenAI Codex
Signed-off-by: Sung Byeongchan <tjdqudcks0424@naver.com>
---
 drivers/net/macsec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 78a19b1346321..02157c97e0004 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -989,7 +989,7 @@ static struct macsec_rx_sc *find_rx_sc(struct macsec_secy *secy, sci_t sci)
 	struct macsec_rx_sc *rx_sc;
 
 	for_each_rxsc(secy, rx_sc) {
-		if (rx_sc->sci == sci)
+		if (rx_sc->sci == sci && READ_ONCE(rx_sc->active))
 			return rx_sc;
 	}
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-08 13:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-08  8:26 [PATCH net] macsec: ignore inactive receive secure channels Sung Byeongchan
2026-10-08 13:26 ` Sabrina Dubroca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox