All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Jihong Min <hurryman2212@gmail.com>
Cc: Christian Marangi <ansuelsmth@gmail.com>,
	Antoine Tenart <atenart@kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S . Miller" <davem@davemloft.net>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, netdev@vger.kernel.org
Subject: Re: [PATCH 2/3] crypto: inside-secure: add EIP93 ESP packet backend
Date: Wed, 27 May 2026 11:08:24 +0100	[thread overview]
Message-ID: <20260527100824.GJ2256768@horms.kernel.org> (raw)
In-Reply-To: <20260523121522.3023992-3-hurryman2212@gmail.com>

On Sat, May 23, 2026 at 09:15:21PM +0900, Jihong Min wrote:
> Expose an EIP93 packet-mode IPsec backend for netdev drivers that need
> ESP encapsulation and decapsulation offload without advertising EIP93
> itself as a netdev.
> 
> Add provider selection, capability reporting, SA lifecycle management,
> IPsec request completion, and provider fault notification around the
> existing EIP93 descriptor path.
> 
> Assisted-by: Codex:gpt-5.5
> Signed-off-by: Jihong Min <hurryman2212@gmail.com>

...

> diff --git a/drivers/crypto/inside-secure/eip93/eip93-ipsec.c b/drivers/crypto/inside-secure/eip93/eip93-ipsec.c

...

> +static void eip93_ipsec_abort_requests(struct eip93_ipsec *ipsec, int err)
> +{
> +	struct eip93_ipsec_sa *sa;
> +
> +	while (true) {
> +		bool found = false;
> +
> +		spin_lock_bh(&ipsec->lock);
> +		list_for_each_entry(sa, &ipsec->sa_list, node) {
> +			spin_lock(&sa->lock);
> +			if (sa->aborting) {
> +				spin_unlock(&sa->lock);
> +				continue;
> +			}
> +
> +			sa->aborting = true;
> +			found = refcount_inc_not_zero(&sa->refcnt);
> +			spin_unlock(&sa->lock);
> +			if (found)
> +				break;
> +		}
> +		spin_unlock_bh(&ipsec->lock);
> +		if (!found)
> +			return;
> +
> +		eip93_ipsec_abort_sa(sa, err);
> +		eip93_ipsec_sa_put(sa);

sa is the iterator for the list_for_each_entry loop.
However, here it is used outside of that context.

	"If list_for_each_entry, etc complete a traversal of the list, the
	iterator variable ends up pointing to an address at an offset from
	the list head, and not a meaningful structure.  Thus this value
	should not be used after the end of the iterator.

	https://www.spinics.net/lists/linux-kernel-janitors/msg11994.html

Flagged by Coccinelle.

> +	}
> +}

...

  reply	other threads:[~2026-05-27 10:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-23 12:15 [PATCH 0/3] Add packet-mode ESP offload for Airoha/EIP93 Jihong Min
2026-05-23 12:15 ` [PATCH 1/3] xfrm: extend ESP offload infrastructure for packet engines Jihong Min
2026-06-11 11:56   ` Leon Romanovsky
2026-06-11 12:23     ` Jihong Min
2026-05-23 12:15 ` [PATCH 2/3] crypto: inside-secure: add EIP93 ESP packet backend Jihong Min
2026-05-27 10:08   ` Simon Horman [this message]
2026-06-11 12:17     ` Jihong Min
2026-05-23 12:15 ` [PATCH 3/3] net: airoha: add EIP93-backed ESP XFRM offload Jihong Min
2026-05-23 12:24 ` [PATCH 0/3] Add packet-mode ESP offload for Airoha/EIP93 Jihong Min

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=20260527100824.GJ2256768@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=atenart@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=hurryman2212@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lorenzo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --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 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.