mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hong In-su <his1415@pribit.com>
To: steffen.klassert@secunet.com, herbert@gondor.apana.org.au
Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, sd@queasysnail.net,
	andrew+netdev@lunn.ch, csh0052@gmail.com,
	oss-drivers@corigine.com, linux-crypto@vger.kernel.org,
	netdev@vger.kernel.org, ipsec@lists.linux.dev,
	linux-kernel@vger.kernel.org, his1415@pribit.com
Subject: [PATCH ipsec-next v4 1/4] nfp: reject unsupported IPsec encryption algorithms
Date: Mon, 30 Nov 2026 06:27:19 +0000	[thread overview]
Message-ID: <20261130062722.7504-2-his1415@pribit.com> (raw)
In-Reply-To: <20261130062722.7504-1-his1415@pribit.com>

The NFP IPsec offload driver uses SADB_EALG_NONE to identify
ChaCha20-Poly1305 by its algorithm name. Other algorithms without
a SADB algorithm ID fall through to the NULL cipher case.

Reject unrecognized encryption algorithms when an AEAD or encryption
algorithm is present, while preserving the existing handling of AH
and ChaCha20-Poly1305.

Return -EOPNOTSUPP to allow fallback to software crypto.

Compile-tested only.

Signed-off-by: Hong In-su <his1415@pribit.com>
---
 drivers/net/ethernet/netronome/nfp/crypto/ipsec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/netronome/nfp/crypto/ipsec.c b/drivers/net/ethernet/netronome/nfp/crypto/ipsec.c
index 960d7513aa8d..5d861e5c4665 100644
--- a/drivers/net/ethernet/netronome/nfp/crypto/ipsec.c
+++ b/drivers/net/ethernet/netronome/nfp/crypto/ipsec.c
@@ -405,6 +405,11 @@ static int nfp_net_xfrm_add_state(struct net_device *dev,
 			cfg->ctrl_word.cipher = NFP_IPSEC_CIPHER_CHACHA20;
 			break;
 		}
+		if (x->aead || x->ealg) {
+			NL_SET_ERR_MSG_MOD(extack,
+					   "Unsupported encryption algorithm for offload");
+			return -EOPNOTSUPP;
+		}
 		fallthrough;
 	case SADB_EALG_NULL:
 		cfg->ctrl_word.cimode = NFP_IPSEC_CIMODE_CBC;
-- 
2.43.0




  reply	other threads:[~2026-11-30  6:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  6:27 [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and GCM support Hong In-su
2026-11-30  6:27 ` Hong In-su [this message]
2026-11-30  6:27 ` [PATCH ipsec-next v4 2/4] crypto: testmgr - add ARIA RFC3686 and RFC4106 test vectors Hong In-su
2026-11-30  6:27 ` [PATCH ipsec-next v4 3/4] xfrm: add ARIA CBC and CTR support Hong In-su
2026-11-30  6:27 ` [PATCH ipsec-next v4 4/4] xfrm: add ARIA GCM support Hong In-su
2026-11-30  7:46 ` [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and " Antony Antony
2026-11-30  8:18   ` Hong In-su

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=20261130062722.7504-2-his1415@pribit.com \
    --to=his1415@pribit.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=csh0052@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=ipsec@lists.linux.dev \
    --cc=kuba@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@corigine.com \
    --cc=pabeni@redhat.com \
    --cc=sd@queasysnail.net \
    --cc=steffen.klassert@secunet.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

all inboxes | Powered by JetHome®