Thread (4 messages) flat view 4 messages, 3 authors, 24d ago

Re: [PATCH] RDMA/core: Fix use-after-free in ib_get_eth_speed()

From: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Date: 2026-08-21 08:19:44
Also in: linux-rdma

On Fri, Aug 21, 2026 at 12:37 PM Eric Dumazet [off-list ref] wrote:
In ib_get_eth_speed(), dev_put(netdev) is called before inspecting
rc and dereferencing netdev->name in pr_warn(). If dev_put() drops
the final reference to netdev, netdev->name accesses freed memory.

Move dev_put(netdev) after the warning block so netdev is kept
alive while its name is read.

Fixes: d41861942fc5 ("IB/core: Add generic function to extract IB speed from netdev")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

-- 
Regards,
Kalesh AP

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help