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: <50227b1f-7b45-436a-918f-00ddc470e0fa@linux.dev>
Date: Sat, 9 Dec 2023 19:32:01 +0800
From: Zhu Yanjun <yanjun.zhu@...ux.dev>
To: David Ahern <dsahern@...nel.org>, Bob Pearson <rpearsonhpe@...il.com>,
 jgg@...dia.com, linux-rdma@...r.kernel.org, netdev@...r.kernel.org,
 rain.1986.08.12@...il.com
Subject: Re: [PATCH for-next v6 3/7] RDMA/rxe: Register IP mcast address

在 2023/12/8 23:50, David Ahern 写道:
> On 12/7/23 12:29 PM, Bob Pearson wrote:
>> diff --git a/drivers/infiniband/sw/rxe/rxe_mcast.c b/drivers/infiniband/sw/rxe/rxe_mcast.c
>> index 86cc2e18a7fd..5236761892dd 100644
>> --- a/drivers/infiniband/sw/rxe/rxe_mcast.c
>> +++ b/drivers/infiniband/sw/rxe/rxe_mcast.c
>> @@ -19,38 +19,116 @@
>>    * mcast packets in the rxe receive path.
>>    */
>>   
>> +#include <linux/igmp.h>
>> +
>>   #include "rxe.h"
>>   
>> -/**
>> - * rxe_mcast_add - add multicast address to rxe device
>> - * @rxe: rxe device object
>> - * @mgid: multicast address as a gid
>> - *
>> - * Returns 0 on success else an error
>> - */
>> -static int rxe_mcast_add(struct rxe_dev *rxe, union ib_gid *mgid)
>> +static int rxe_mcast_add6(struct rxe_dev *rxe, union ib_gid *mgid)
>>   {
>> +	struct in6_addr *addr6 = (struct in6_addr *)mgid;
>> +	struct sock *sk = recv_sockets.sk6->sk;
>>   	unsigned char ll_addr[ETH_ALEN];
>> +	int err;
>> +
>> +	lock_sock(sk);
>> +	rtnl_lock();
> 
> reverse the order. rtnl is always taken first, then socket lock.
> 
> Actually, I think it would be better to avoid burying this logic in the
> rxe driver. Can you try using the setsockopt API? I think it is now
> usable within the kernel again after the refactoring for io_uring.

Thanks, David,
Your helps are appreciated.

Zhu Yanjun

> 
> 
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ