From: Sabrina Dubroca <sd@queasysnail.net>
To: alexjlzheng@gmail.com
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
hannes@stressinduktion.org, albinwyang@tencent.com,
shenyangyang4@huawei.com, kuniyu@google.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Jinliang Zheng <alexjlzheng@tencent.com>
Subject: Re: [PATCH net v3 v3 2/3] macsec: use rcu_work to defer RX SA crypto cleanup out of softirq
Date: Mon, 11 May 2026 15:50:22 +0200 [thread overview]
Message-ID: <agHenphzMNk3HEc8@krikkit> (raw)
In-Reply-To: <20260509033353.1814289-3-alexjlzheng@tencent.com>
2026-05-09, 11:33:46 +0800, alexjlzheng@gmail.com wrote:
> From: Jinliang Zheng <alexjlzheng@tencent.com>
>
> crypto_free_aead() can internally invoke vunmap() (e.g. via
> dma_free_attrs() in hardware crypto drivers such as hisi_sec2).
> vunmap() must not be called from softirq context, but free_rxsa()
> is an RCU callback that runs in softirq, leading to a kernel crash:
>
> vunmap+0x4c/0x70
> __iommu_dma_free+0xd0/0x138
> dma_free_attrs+0xf4/0x100
> sec_aead_exit+0x64/0xb8 [hisi_sec2]
> crypto_destroy_tfm+0x98/0x110
> free_rxsa+0x28/0x50 [macsec]
> rcu_do_batch+0x184/0x460
> rcu_core+0xf4/0x1f8
> handle_softirqs+0x118/0x330
>
> Use rcu_work to defer the cleanup to a workqueue. rcu_work dispatches
> the worker asynchronously after the RCU grace period, so no thread
> blocks waiting, and concurrent releases of multiple SAs naturally
> share the same grace period.
>
> Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
> Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
> ---
> drivers/net/macsec.c | 8 +++++---
> include/net/macsec.h | 4 +++-
> 2 files changed, 8 insertions(+), 4 deletions(-)
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
--
Sabrina
next prev parent reply other threads:[~2026-05-11 13:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-09 3:33 [PATCH net v3 0/3] macsec: use rcu_work to fix crypto cleanup in softirq context alexjlzheng
2026-05-09 3:33 ` [PATCH net v3 v3 1/3] macsec: introduce dedicated workqueue for SA crypto cleanup alexjlzheng
2026-05-11 13:32 ` Sabrina Dubroca
2026-05-11 14:00 ` [PATCH net " Jinliang Zheng
2026-05-11 14:37 ` Sabrina Dubroca
2026-05-11 14:49 ` Jinliang Zheng
2026-05-09 3:33 ` [PATCH net v3 v3 2/3] macsec: use rcu_work to defer RX SA crypto cleanup out of softirq alexjlzheng
2026-05-11 13:50 ` Sabrina Dubroca [this message]
2026-05-09 3:33 ` [PATCH net v3 v3 3/3] macsec: use rcu_work to defer TX " alexjlzheng
2026-05-11 13:50 ` Sabrina Dubroca
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=agHenphzMNk3HEc8@krikkit \
--to=sd@queasysnail.net \
--cc=albinwyang@tencent.com \
--cc=alexjlzheng@gmail.com \
--cc=alexjlzheng@tencent.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hannes@stressinduktion.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shenyangyang4@huawei.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.