Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1994940yba; Sat, 27 Apr 2019 11:41:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjPDHX++UIcIWDEwQtKDbPRSCokoyD9huctIPUZXbbYjw1MlZiD0EAqq3g/xc944arqo74 X-Received: by 2002:a17:902:a613:: with SMTP id u19mr1648805plq.148.1556390464421; Sat, 27 Apr 2019 11:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556390464; cv=none; d=google.com; s=arc-20160816; b=Elf4/09HnWy/d176NI5umj9gHPpYv+wBjKP+h6CoKqAGeDyUoEur1tMYmP27+5cCPA 9kUTsStssHBea0RTk2iJP6AlfWCeD1jqlpk0tGadPlU0BD22yrIMOSPYd8DGnOfuFX4D aCRKxO2CXyRwRLDEHtaTSbhuvOKCnAGjEQRJA5gAdP1CB7mG0JDUIiG+g+y+kYxBv0os ASBHaaDebx7DgptR0+wNq0lKGACmWH1XqaijfpTFkXtgwCI3zwUk8PP556+FhsYCY14u 6IDA/tBTlHy9U+J/A+ekPTrGjaGbqT157E1n6iN8mSgVSWOTsqiXXcWeccTqX12ibEXa Y6qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=nEhuJO1Ynor4weZ/NdgsrjcDQwLHIYNiPIAmRLX4GUE=; b=PQ5QhBOTjnIxaY1S9XDlvJw6YEBEk6wPYaYVKggfPvCExs1xgfSU0AUSJ0kuZ/4nvI Lgmge5wSdGWti8JGna/hU34iNGKYWFl2YphSOV+MrGA5yW5blJKq4iUzITtOEe8IFR/b wJKK+tJ2k/YKvc6mH8Qg9NRqR9LMMZcJPE+9YtTEmIzlHU3LBFWC0FPUaDS0DevReKWF 7OZEi6Vh2i9zeiiA0th1qt4vOOl/dfpbEEMGEFp3j5CHUdiq7/fO5mOw8/MPRsK/dcuA Va2bNkCAfMOyym10kc5qaphvDijbYHagYPL8PbgtemgzoYHueb93nDUyxhlpbsroT6G5 +Pug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=ZwQgviwG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16si14521798pgi.496.2019.04.27.11.40.49; Sat, 27 Apr 2019 11:41:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=ZwQgviwG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726396AbfD0Sjs (ORCPT + 99 others); Sat, 27 Apr 2019 14:39:48 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:41856 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726372AbfD0Sjp (ORCPT ); Sat, 27 Apr 2019 14:39:45 -0400 Received: by mail-pg1-f195.google.com with SMTP id f6so3149492pgs.8 for ; Sat, 27 Apr 2019 11:39:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=nEhuJO1Ynor4weZ/NdgsrjcDQwLHIYNiPIAmRLX4GUE=; b=ZwQgviwGd+jrVmG8JFn7bjaIAV2TsrvxU4gwqb0RDG2b2a6/tuGS1bjSPD5zFcQiMZ OmpdIgRQkfd1VLQyOhHZ2sy7TIKkdUPmLR3gYx0vHzrPUF+3LdpG+0aUq9NHLigzxuLt w9kpljzekW+UpvNnGxUjjZ2Bx9bD32Ndbifx8VInBOuMS2iEobHHMQQB1VrB954vWtp/ Nrbgy+r1/XJ21U/lWl3YVsMz6ktPb/ZCQWFwdDqE83Lw5y4t5RaboQA97rx1/hGYeULm 0flpaFH/sFdnlp0awKpTr8eaMC9B/zZoDGubX6yyGIu3JxLfg5bVwVWhTSIakRG3jRCC zEAw== 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:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=nEhuJO1Ynor4weZ/NdgsrjcDQwLHIYNiPIAmRLX4GUE=; b=Vm1S+GUtnMMbix4kqWatVZa/6qllpdnnsd9zIV4AzB0ihRHHehRpJud2GURqW9HEP9 EkKexUcET0dZI13eaIH8sPca0n+fQvqCIfMACgwLLxVgR6ee8BObjsARwJYKGmEb1Lbe N3cptWiDoNLCMcYqm+XxHsIXRBe10sBZcnT2PJcmFYZNF4NYB90DzPN/vsdGqpDPnwXm Syv5qjIkTn5VcNEi7tr4z49qL62EOzSRx9zEkQupsiuvwv4kAKowvQcmJSbwFsaLOWvq jN5ipoufAPoC24XEwsp1MaEifmy/bAyWGdXp/nH/oxbIj8pkk4CHiIlMWLc5xsm0egw7 f/MQ== X-Gm-Message-State: APjAAAXNfmWr3O1uzPFbz4BUae/UC9DM5+RPvK61ybtEQSAd/nFlNAkY 9pX8q/z09PzaXLque5bXNwS5fA== X-Received: by 2002:a62:6807:: with SMTP id d7mr52800695pfc.75.1556390384509; Sat, 27 Apr 2019 11:39:44 -0700 (PDT) Received: from cakuba.netronome.com ([2601:646:8e00:4a0b::2]) by smtp.gmail.com with ESMTPSA id r11sm36708305pga.87.2019.04.27.11.39.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Apr 2019 11:39:44 -0700 (PDT) Date: Sat, 27 Apr 2019 11:39:40 -0700 From: Jakub Kicinski To: Alban Crequy Cc: Alban Crequy , John Fastabend , Alexei Starovoitov , Daniel Borkmann , bpf , netdev , LKML , Iago =?UTF-8?B?TMOzcGV6?= Galeiras Subject: Re: [PATCH bpf-next v3 1/4] bpf: sock ops: add netns ino and dev in bpf context Message-ID: <20190427113940.223fd4d1@cakuba.netronome.com> In-Reply-To: References: <20190426154848.23490-1-alban@kinvolk.io> <20190426140323.4edf1127@cakuba.netronome.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 27 Apr 2019 12:48:25 +0200, Alban Crequy wrote: > On Fri, Apr 26, 2019 at 11:03 PM Jakub Kicinski > wrote: > > > > On Fri, 26 Apr 2019 17:48:45 +0200, Alban Crequy wrote: > > > In the unlikely case where network namespaces are not compiled in > > > (CONFIG_NET_NS=n), the verifier will not allow access to ->netns_*. > > > > Naive question - why return an error? init_net should always be there, > > no? > > True for netns_dev. However, without CONFIG_NET_NS, we cannot access netns_ino: > > (struct sock_common).possible_net_t.(struct net *): > > typedef struct { > #ifdef CONFIG_NET_NS > struct net *net; > #endif > } possible_net_t; > > And I don't think it would make much sense to allow access to > netns_dev but not netns_ino. Right, if CONFIG_NET_NS=n we could just take the pointer to init_net directly, and not worry about the field. IMHO it'd be preferable to changing the UAPI based on kernel config, but I don't feel super strongly.