lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <947756ad-f9aa-479f-b463-4c97ff23a936@linux.ibm.com>
Date: Mon, 15 Sep 2025 12:24:16 +0530
From: Mahanta Jambigi <mjambigi@...ux.ibm.com>
To: Leon Romanovsky <leon@...nel.org>
Cc: Kriish Sharma <kriish.sharma2006@...il.com>, alibuda@...ux.alibaba.com,
        dust.li@...ux.alibaba.com, sidraya@...ux.ibm.com, wenjia@...ux.ibm.com,
        tonylu@...ux.alibaba.com, guwen@...ux.alibaba.com, davem@...emloft.net,
        edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
        horms@...nel.org, linux-rdma@...r.kernel.org,
        linux-s390@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, skhan@...uxfoundation.org,
        linux-kernel-mentees@...ts.linuxfoundation.org
Subject: Re: [PATCH] net/smc: replace strncpy with strscpy for ib_name

On 12/09/25 2:37 pm, Leon Romanovsky wrote:
> On Fri, Sep 12, 2025 at 01:18:52PM +0530, Mahanta Jambigi wrote:
>> On 10/09/25 3:31 pm, Leon Romanovsky wrote:
>>>> --- a/net/smc/smc_pnet.c
>>>> +++ b/net/smc/smc_pnet.c
>>>> @@ -450,7 +450,7 @@ static int smc_pnet_add_ib(struct smc_pnettable *pnettable, char *ib_name,
>>>>  		return -ENOMEM;
>>>>  	new_pe->type = SMC_PNET_IB;
>>>>  	memcpy(new_pe->pnet_name, pnet_name, SMC_MAX_PNETID_LEN);
>>>> -	strncpy(new_pe->ib_name, ib_name, IB_DEVICE_NAME_MAX);
>>>> +	strscpy(new_pe->ib_name, ib_name);
>>>
>>> It is worth to mention that caching ib_name is wrong as IB/core provides
>>> IB device rename functionality.
>>
>> In our case we hit this code path where we pass *PCI_ID*
>> as the *ib_name* using *smc_pnet* tool(smc_pnet -a <pnet_name> -D
>> <PCI_ID>). I believe PCI_ID will not change, so caching it here is fine.
> 
> If I remember, you are reporting that cached ib_name through netlink much later.
> 
> The caching itself is not an issue, but incorrect reported name can be seen as
> a wrong thing to do.

In what case we can see this incorrect reported name, could you please
elaborate.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ