* [PATCH net] sfc: handle rhashtable walk errors in mport lookup
@ 2026-10-02 19:47 Sang-Hoon Choi
2026-10-07 14:44 ` Simon Horman
2026-10-07 23:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Sang-Hoon Choi @ 2026-10-02 19:47 UTC (permalink / raw)
To: Edward Cree; +Cc: netdev, linux-net-drivers, Alejandro Lucero, Changyul Lee
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 &&
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net] sfc: handle rhashtable walk errors in mport lookup
2026-10-02 19:47 [PATCH net] sfc: handle rhashtable walk errors in mport lookup Sang-Hoon Choi
@ 2026-10-07 14:44 ` Simon Horman
2026-10-07 23:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2026-10-07 14:44 UTC (permalink / raw)
To: Sang-Hoon Choi
Cc: Edward Cree, netdev, linux-net-drivers, Alejandro Lucero,
Changyul Lee
On Fri, Oct 02, 2026 at 07:47:40PM +0000, Sang-Hoon Choi wrote:
> 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.
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net] sfc: handle rhashtable walk errors in mport lookup
2026-10-02 19:47 [PATCH net] sfc: handle rhashtable walk errors in mport lookup Sang-Hoon Choi
2026-10-07 14:44 ` Simon Horman
@ 2026-10-07 23:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-10-07 23:50 UTC (permalink / raw)
To: Sang-Hoon Choi
Cc: ecree.xilinx, netdev, linux-net-drivers, alejandro.lucero-palau,
lcy8047
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 02 Oct 2026 19:47:40 +0000 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [net] sfc: handle rhashtable walk errors in mport lookup
https://git.kernel.org/netdev/net-next/c/2a1359aa651f
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-07 23:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-02 19:47 [PATCH net] sfc: handle rhashtable walk errors in mport lookup Sang-Hoon Choi
2026-10-07 14:44 ` Simon Horman
2026-10-07 23:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox