Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2119118ybl; Thu, 19 Dec 2019 08:21:54 -0800 (PST) X-Google-Smtp-Source: APXvYqzrGdeiERvOjos1E870WIZ767qHXbpm9AB+ayxqjCSsp3Fj8BAMET4c94aJfoBxBd4v9byr X-Received: by 2002:a9d:402:: with SMTP id 2mr6460247otc.357.1576772514439; Thu, 19 Dec 2019 08:21:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576772514; cv=none; d=google.com; s=arc-20160816; b=kwoCiFHBwsxa7ZyEwjVLv/4nMLixXGbGt3X5qai7uY0sRvqIlvjD6vfaCR90NfqNDb +hl6fCrbxuisaEdkEo5OGKe5EZdioqXdnuhnASQclu/PWCpXBoOmtt21uuyczeG5mfEK b5Z4HQx+mpVtNM/9lLUvzAbbAFJv/Fe/Fy0f9MYkY04AmGbQT8mwkdMjlNbYgoP3SG2w 2qOmqjUOq3FHV8eluh8ZK1c7BjRVAx4NPXxvoNbC70wpi5I0mzEDvKn5NdSCAV2CT3Tr peDhqPBwnCVnF1kE9JetYpGCKzxriSHAz756FUlKR7qxrO9Sp5DvK+GINb+LJb1xh1LT 8Nqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=hsLjpvKzh0rpJSFw7RWeXW3efLdatW4x2VPwKxIlxxI=; b=p2Q6D8gljZzMrdPrKvC+pVXxeQsrMBGzLrAPcw0o+5vHIRa827RWYxfyjYqfBObWcV 9QJ3u8J5B8L8uoaL6IzcWuAEnSnyIIhrUUzVnu2IQtNMBKrkLmiVfjsmQyr/PTwArNla bKLwdWPpnmUSf4fllAnWNNw+0D+9f09wEXCMp4G0kkx7ynfJ6j297sgUwLjQjla+1pKA x7yLtwsXIKdJ9Jtz9Mec+0UvOry3/s1paGJpGb8G4pxWK1qF4j8EEueRggMBUtT9qe4x k+WjOh+QyZMhk22c9KE0s8tQmG8j85sawNVMxNAsZF4YtJBDG5k2FlGw4ngmHFzqsGgs YPaw== ARC-Authentication-Results: i=1; mx.google.com; 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 h128si3248362oif.258.2019.12.19.08.21.39; Thu, 19 Dec 2019 08:21:54 -0800 (PST) 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; 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 S1726933AbfLSQVA (ORCPT + 99 others); Thu, 19 Dec 2019 11:21:00 -0500 Received: from www62.your-server.de ([213.133.104.62]:56570 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726778AbfLSQU7 (ORCPT ); Thu, 19 Dec 2019 11:20:59 -0500 Received: from [2001:1620:665:0:5795:5b0a:e5d5:5944] (helo=localhost) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1ihyXk-0003mT-CK; Thu, 19 Dec 2019 17:20:52 +0100 Date: Thu, 19 Dec 2019 17:20:51 +0100 From: Daniel Borkmann To: Alexander Lobakin Cc: "David S. Miller" , Alexei Starovoitov , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , Eric Dumazet , Andrew Morton , Soheil Hassas Yeganeh , Aaron Tomlin , Matteo Croce , Cong Wang , Edward Cree , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH net] net: core: sysctl: fix compiler warning when only cBPF is present Message-ID: <20191219162051.GA11015@linux-9.fritz.box> References: <20191218091821.7080-1-alobakin@dlink.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191218091821.7080-1-alobakin@dlink.ru> User-Agent: Mutt/1.12.1 (2019-06-15) X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.101.4/25668/Thu Dec 19 10:55:58 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 18, 2019 at 12:18:21PM +0300, Alexander Lobakin wrote: > proc_dointvec_minmax_bpf_restricted() has been firstly introduced > in commit 2e4a30983b0f ("bpf: restrict access to core bpf sysctls") > under CONFIG_HAVE_EBPF_JIT. Then, this ifdef has been removed in > ede95a63b5e8 ("bpf: add bpf_jit_limit knob to restrict unpriv > allocations"), because a new sysctl, bpf_jit_limit, made use of it. > Finally, this parameter has become long instead of integer with > fdadd04931c2 ("bpf: fix bpf_jit_limit knob for PAGE_SIZE >= 64K") > and thus, a new proc_dolongvec_minmax_bpf_restricted() has been > added. > With this last change, we got back to that > proc_dointvec_minmax_bpf_restricted() is used only under > CONFIG_HAVE_EBPF_JIT, but the corresponding ifdef has not been > brought back. > > So, in configurations like CONFIG_BPF_JIT=y && CONFIG_HAVE_EBPF_JIT=n > since v4.20 we have: > > CC net/core/sysctl_net_core.o > net/core/sysctl_net_core.c:292:1: warning: ‘proc_dointvec_minmax_bpf_restricted’ defined but not used [-Wunused-function] > 292 | proc_dointvec_minmax_bpf_restricted(struct ctl_table *table, int write, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Suppress this by guarding it with CONFIG_HAVE_EBPF_JIT again. > > Fixes: fdadd04931c2 ("bpf: fix bpf_jit_limit knob for PAGE_SIZE >= 64K") > Signed-off-by: Alexander Lobakin Applied, thanks!