Subject: Re: [PATCH net] net/smc: avoid NULL deref of conn->lnk in smc_msg_event tracepoint

From: Dust Li <[email-masked]>
Date: Sun, 17 May 2026 23:08:44 +0800

On 2026-05-17 11:45:13, Leon Romanovsky wrote:
>On Sun, May 10, 2026 at 03:26:40PM -0700, Xiang Mei wrote:
>> The smc_msg_event tracepoint class, shared by smc_tx_sendmsg and
>> smc_rx_recvmsg, unconditionally dereferences smc->conn.lnk:
>> 
>> 	__string(name, smc->conn.lnk->ibname)
>
>My comment is not directly related to this patch, but it was triggered
>while reviewing it. The ibname should not be cached, as users can rename
>it through rdmatool or udev.
>
>For example, this function is racy:
>   552 static int smc_nl_handle_smcr_dev(struct smc_ib_device *smcibdev,
>   553                                   struct sk_buff *skb,
>   554                                   struct netlink_callback *cb)
>   555 {
>   ...
>   582         snprintf(smc_ibname, sizeof(smc_ibname), "%s", smcibdev->ibdev->name);
>
>Thanks

Hi, Leon

OK, I'll submit a patch removing all the ibvdev->name in SMC.

Best regards,
Dust