From: Sang-Hoon Choi <csh0052@gmail.com>
To: Edward Cree <ecree.xilinx@gmail.com>
Cc: netdev@vger.kernel.org, linux-net-drivers@amd.com,
Alejandro Lucero <alejandro.lucero-palau@amd.com>,
Changyul Lee <lcy8047@gmail.com>
Subject: [PATCH net] sfc: handle rhashtable walk errors in mport lookup
Date: Fri, 02 Oct 2026 19:47:40 +0000 [thread overview]
Message-ID: <20261003.final089.e0910b3ffb849fe4@gmail.com> (raw)
rhashtable_walk_next() can return ERR_PTR(-EAGAIN) when the table is
resized. efx_mae_lookup_mport() currently dereferences that value as an
mport descriptor.
Skip error values and continue the walk, as the other rhashtable walkers
in this driver already do.
Fixes: 5227adff37af ("sfc: add mport lookup based on driver's mport data")
Reported-by: Changyul Lee <lcy8047@gmail.com>
Assisted-by: LLM
Signed-off-by: Sang-Hoon Choi <csh0052@gmail.com>
---
Compile-tested the affected object with x86_64 allmodconfig
and W=1 (GCC 13.3.0). Base: mainline 3b7cab693ba2bab63774bf5b988e8a61b2ef0f32.
No hardware testing or runtime failure reproduction was performed.
drivers/net/ethernet/sfc/mae.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/sfc/mae.c b/drivers/net/ethernet/sfc/mae.c
index 7a8606efd492..b6de61062a86 100644
--- a/drivers/net/ethernet/sfc/mae.c
+++ b/drivers/net/ethernet/sfc/mae.c
@@ -1030,6 +1030,8 @@ int efx_mae_lookup_mport(struct efx_nic *efx, u32 vf_idx, u32 *id)
rhashtable_walk_enter(&mae->mports_ht, &walk);
rhashtable_walk_start(&walk);
while ((m = rhashtable_walk_next(&walk)) != NULL) {
+ if (IS_ERR(m))
+ continue;
if (m->mport_type == MAE_MPORT_DESC_MPORT_TYPE_VNIC &&
m->interface_idx == nic_data->local_mae_intf &&
m->pf_idx == 0 &&
next reply other threads:[~2026-10-02 19:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 19:47 Sang-Hoon Choi [this message]
2026-10-07 14:44 ` [PATCH net] sfc: handle rhashtable walk errors in mport lookup Simon Horman
2026-10-07 23:50 ` patchwork-bot+netdevbpf
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=20261003.final089.e0910b3ffb849fe4@gmail.com \
--to=csh0052@gmail.com \
--cc=alejandro.lucero-palau@amd.com \
--cc=ecree.xilinx@gmail.com \
--cc=lcy8047@gmail.com \
--cc=linux-net-drivers@amd.com \
--cc=netdev@vger.kernel.org \
/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