From patchwork Mon Aug 31 04:03:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khalid Elmously X-Patchwork-Id: 1354098 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BfxQn3WBmz9sTh; Mon, 31 Aug 2020 14:04:01 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1kCb2q-00059l-PA; Mon, 31 Aug 2020 04:03:48 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kCb2o-000593-Mu for kernel-team@lists.ubuntu.com; Mon, 31 Aug 2020 04:03:46 +0000 Received: from mail-qk1-f198.google.com ([209.85.222.198]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kCb2o-0006Ip-Cq for kernel-team@lists.ubuntu.com; Mon, 31 Aug 2020 04:03:46 +0000 Received: by mail-qk1-f198.google.com with SMTP id u23so2562670qku.17 for ; Sun, 30 Aug 2020 21:03:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7AZcf09NnlYgnT6hsnPqLfh6uTrdCVw/3AUpt6JflKs=; b=Dkb0pV5v7klOLuYsh4yqNhB4DLc8+AHtVPbOFcTNgagoR/MGuttSDy/Ja20qRx63vf d11EUcGeRp35V+Vkx3WvfPNxzLBcf6OF3O6pkaOtnTdU3o9rN/S7FsN8+b1T+P+fnAE5 9yZtfr16Q7sU6bVuJZJ2GKE35uAP2cLa+D8rsoDPmbVp/cof1/qwjlMF3RwAVvW1ACuJ ytQeIQ2UQyu828Z5iXOGNKu1XAgRBANa9XUt5PvSZrIva+McOZbNUqQlECulZ/aqDgXn o2BZYtmqYQqnGlESkByNgxw9m8xKxGZaa4o0Stab+z0V4kJJh5MftzDPH0kftMDd0QFN lUHg== X-Gm-Message-State: AOAM530ktgsejVF7TwWVvjzp37r9mQTaq6Jz8J0jFhOUhFmgyYp3EbdQ UUHm2AQn0bX1gd+UtCKHaB6Zv5hNdukFCFD3UQrmoikECEo7F6nZIWXeXTuueK81MD6RTlYutih j8AHDO/z3a6Whum6zUpk6i2ETbDEcWJZlvfZKMaNiOA== X-Received: by 2002:a05:620a:957:: with SMTP id w23mr9194760qkw.399.1598846625154; Sun, 30 Aug 2020 21:03:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKNKEgkToq/kl6asSavrbhRz0x5G0Y796jvZaIareIIi3yin3u6yOp1dNDJ0WCbn+7jyL64w== X-Received: by 2002:a05:620a:957:: with SMTP id w23mr9194740qkw.399.1598846624902; Sun, 30 Aug 2020 21:03:44 -0700 (PDT) Received: from kbuntu2.fuzzbuzz.org (dhcp-24-53-242-104.cable.user.start.ca. [24.53.242.104]) by smtp.gmail.com with ESMTPSA id d9sm7779648qkj.83.2020.08.30.21.03.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Aug 2020 21:03:44 -0700 (PDT) From: Khalid Elmously To: kernel-team@lists.ubuntu.com Subject: [PATCH 04/13] bpf, net: Fix build issue when net ns not configured Date: Mon, 31 Aug 2020 00:03:24 -0400 Message-Id: <20200831040333.6058-5-khalid.elmously@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200831040333.6058-1-khalid.elmously@canonical.com> References: <20200831040333.6058-1-khalid.elmously@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Daniel Borkmann BugLink: https://bugs.launchpad.net/bugs/1887740 [ upstream commit 5a95cbb80ef8d8f2db29ab10777cd4742e6fc8ec ] Fix a redefinition of 'net_gen_cookie' error that was overlooked when net ns is not configured. Fixes: f318903c0bf4 ("bpf: Add netns cookie and enable it for bpf cgroup hooks") Reported-by: kbuild test robot Signed-off-by: Daniel Borkmann Signed-off-by: Khalid Elmously --- include/net/net_namespace.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 2502ffcf0ddf..aa42db4aa410 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h @@ -225,6 +225,8 @@ extern struct list_head net_namespace_list; struct net *get_net_ns_by_pid(pid_t pid); struct net *get_net_ns_by_fd(int fd); +u64 net_gen_cookie(struct net *net); + #ifdef CONFIG_SYSCTL void ipx_register_sysctl(void); void ipx_unregister_sysctl(void); @@ -273,8 +275,6 @@ static inline int check_net(const struct net *net) void net_drop_ns(void *); -u64 net_gen_cookie(struct net *net); - #else static inline struct net *get_net(struct net *net) @@ -302,11 +302,6 @@ static inline int check_net(const struct net *net) return 1; } -static inline u64 net_gen_cookie(struct net *net) -{ - return 0; -} - #define net_drop_ns NULL #endif