From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C272C3F2CD for ; Fri, 28 Feb 2020 16:49:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D80DF24697 for ; Fri, 28 Feb 2020 16:49:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="T0253mjw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726892AbgB1Qty (ORCPT ); Fri, 28 Feb 2020 11:49:54 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:34444 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbgB1Qty (ORCPT ); Fri, 28 Feb 2020 11:49:54 -0500 Received: by mail-qk1-f194.google.com with SMTP id 11so3603274qkd.1 for ; Fri, 28 Feb 2020 08:49:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hgWgrZvCEmu6uRu0ctlC2UMyMXZuVubNemvY+msKWUs=; b=T0253mjwOlZLR6gL/ZmNlcSwlPXiIpvXHAT/pU9Wem5isQGcGMYN0TVWxpDnDgzKwo Sn8KgAnX3Dqr2DHvQq7giIwC7f3lhi+kcRoL/8LehEI/rffUn3WrBJZ7PUzr+K0fk+LF 3sgy2ohuaE4/5OXLE3ypBhTI791f8U2Yxi2cNcpkYjLJ+jMGpbnsZAXbtuyL9H8KRcfT BfxnGK6fVn/MukkAjQWVbvxmHBPv6KoT4qc0ZfOHIgCmyE6ku5nUPwwVwsgSAkbnx1be mvULDO+PA8uoEmjtRBlYiJAhSW4J27kO1AW0UWMQe7a4B/5qoElH2N2hDnuEjD1gutqO 8rYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hgWgrZvCEmu6uRu0ctlC2UMyMXZuVubNemvY+msKWUs=; b=QVNdw+iNv4hVPgANndJzP7VidErS0lNhkl3tyF/03ZISuZ+MDzcXn2uU9GEI2Gs6VT aWk0BbJG2M+LYOtMBOTBIfBw7fQlvUY0DsxIOjvO1ggtdnTHfFx5N7QypV3mAiaYLcdZ GwruYBnYr0mXtgI7JJygy8NOTVbcfPLTp5bR5zrEut+523FIGyH4TnC3eKM88AhEyXE8 Ye6qroCI01MjDY6v5iuWQS6WX5irxcoMCUrSjfdoMKFj08DFBMs2EboILINwCZ7ER3XX S3m2xs9a2fq1u7OPyYvVr2UKAPTZzPOWQFclOoFyFJIDPSDwL9PCVqAvaArQaP0OjjES iSeQ== X-Gm-Message-State: APjAAAUl6rU7lcAOw7YkyAjTxXIqumLuYndeCZB8WoOhZoSmPna9qeBY rBkzAzbfWT8HTYjFTVjIy+mrUw== X-Google-Smtp-Source: APXvYqzGZgnxMtHXNFEV+xiae1mjPrVibLyz3T4sadssLs+sePG/fQ6rtalBuu5BNt6s/9y1NMGKOg== X-Received: by 2002:a37:6e42:: with SMTP id j63mr5250429qkc.400.1582908593217; Fri, 28 Feb 2020 08:49:53 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id l184sm5323474qkc.107.2020.02.28.08.49.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Feb 2020 08:49:52 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1j7ipk-0003JN-Bl; Fri, 28 Feb 2020 12:49:52 -0400 Date: Fri, 28 Feb 2020 12:49:52 -0400 From: Jason Gunthorpe To: Bernard Metzler Cc: syzbot , chuck.lever@oracle.com, dledford@redhat.com, leon@kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, parav@mellanox.com, syzkaller-bugs@googlegroups.com, willy@infradead.org Subject: Re: Re: Re: possible deadlock in cma_netdev_callback Message-ID: <20200228164952.GV31668@ziepe.ca> References: <20200228133500.GN31668@ziepe.ca> <20200227164622.GJ31668@ziepe.ca> <20200227155335.GI31668@ziepe.ca> <20200226204238.GC31668@ziepe.ca> <000000000000153fac059f740693@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 28, 2020 at 04:42:02PM +0000, Bernard Metzler wrote: > Well, right, marking a socket via setsockopt SO_BINDTODEVICE > does not work - I get -EPERM. Maybe works only from user land > since the ifname gets copied in from there. > > What I tested as working is nailing the scope of wildcard > listen via: > s->sk->sk_bound_dev_if = netdev->ifindex; That sounds potentially right > I am not sure what is the right way of limiting the scope > of a socket to one interface in kernel mode. Is above line > the way to go, or do I miss an interface to do such things? > Anybody could help? I didn't find an alternative, but not a lot of places touching this outside the implementators of a socket type. Jason