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: <7e370f63-f256-45f3-89c9-7774877afaba@kernel.org>
Date: Fri, 8 Dec 2023 08:50:38 -0700
From: David Ahern <dsahern@...nel.org>
To: Bob Pearson <rpearsonhpe@...il.com>, jgg@...dia.com,
 yanjun.zhu@...ux.dev, 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

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.





Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ