BPF Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH bpf-next] bpf: add bpf_jit_blinding_enabled for !CONFIG_BPF_JIT
@ 2019-11-23 20:37 Daniel Borkmann
  2019-11-23 21:04 ` Alexei Starovoitov
  2019-11-24 22:54 ` kbuild test robot
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Borkmann @ 2019-11-23 20:37 UTC (permalink / raw)
  To: ast; +Cc: jakub, andrii.nakryiko, netdev, bpf, Daniel Borkmann, Andrii Nakryiko

Add a definition of bpf_jit_blinding_enabled() when CONFIG_BPF_JIT is not set
in order to fix a recent build regression:

  [...]
  CC      kernel/bpf/verifier.o
  CC      kernel/bpf/inode.o
kernel/bpf/verifier.c: In function ‘fixup_bpf_calls’:
kernel/bpf/verifier.c:9132:25: error: implicit declaration of function ‘bpf_jit_blinding_enabled’; did you mean ‘bpf_jit_kallsyms_enabled’? [-Werror=implicit-function-declaration]
 9132 |  bool expect_blinding = bpf_jit_blinding_enabled(prog);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
      |                         bpf_jit_kallsyms_enabled
  CC      kernel/bpf/helpers.o
  CC      kernel/bpf/hashtab.o
  [...]

Fixes: bad63c9ea554 ("bpf: Constant map key tracking for prog array pokes")
Reported-by: Jakub Sitnicki <jakub@cloudflare.com>
Reported-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
 include/linux/filter.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/filter.h b/include/linux/filter.h
index 796b60d8cc6c..1b1e8b8f88da 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -1053,6 +1053,11 @@ static inline bool ebpf_jit_enabled(void)
 	return false;
 }
 
+static inline bool bpf_jit_blinding_enabled(struct bpf_prog *prog)
+{
+	return false;
+}
+
 static inline bool bpf_prog_ebpf_jited(const struct bpf_prog *fp)
 {
 	return false;
-- 
2.21.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] bpf: add bpf_jit_blinding_enabled for !CONFIG_BPF_JIT
  2019-11-23 20:37 [PATCH bpf-next] bpf: add bpf_jit_blinding_enabled for !CONFIG_BPF_JIT Daniel Borkmann
@ 2019-11-23 21:04 ` Alexei Starovoitov
  2019-11-24 22:54 ` kbuild test robot
  1 sibling, 0 replies; 5+ messages in thread
From: Alexei Starovoitov @ 2019-11-23 21:04 UTC (permalink / raw)
  To: Daniel Borkmann
  Cc: Alexei Starovoitov, Jakub Sitnicki, Andrii Nakryiko,
	Network Development, bpf, Andrii Nakryiko

On Sat, Nov 23, 2019 at 12:37 PM Daniel Borkmann <daniel@iogearbox.net> wrote:
>
> Add a definition of bpf_jit_blinding_enabled() when CONFIG_BPF_JIT is not set
> in order to fix a recent build regression:
>
>   [...]
>   CC      kernel/bpf/verifier.o
>   CC      kernel/bpf/inode.o
> kernel/bpf/verifier.c: In function ‘fixup_bpf_calls’:
> kernel/bpf/verifier.c:9132:25: error: implicit declaration of function ‘bpf_jit_blinding_enabled’; did you mean ‘bpf_jit_kallsyms_enabled’? [-Werror=implicit-function-declaration]
>  9132 |  bool expect_blinding = bpf_jit_blinding_enabled(prog);
>       |                         ^~~~~~~~~~~~~~~~~~~~~~~~
>       |                         bpf_jit_kallsyms_enabled
>   CC      kernel/bpf/helpers.o
>   CC      kernel/bpf/hashtab.o
>   [...]
>
> Fixes: bad63c9ea554 ("bpf: Constant map key tracking for prog array pokes")
> Reported-by: Jakub Sitnicki <jakub@cloudflare.com>
> Reported-by: Andrii Nakryiko <andriin@fb.com>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Applied. Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] bpf: add bpf_jit_blinding_enabled for !CONFIG_BPF_JIT
  2019-11-23 20:37 [PATCH bpf-next] bpf: add bpf_jit_blinding_enabled for !CONFIG_BPF_JIT Daniel Borkmann
  2019-11-23 21:04 ` Alexei Starovoitov
@ 2019-11-24 22:54 ` kbuild test robot
  2019-11-25  7:27   ` Daniel Borkmann
  1 sibling, 1 reply; 5+ messages in thread
From: kbuild test robot @ 2019-11-24 22:54 UTC (permalink / raw)
  To: Daniel Borkmann
  Cc: kbuild-all, ast, jakub, andrii.nakryiko, netdev, bpf,
	Daniel Borkmann, Andrii Nakryiko

[-- Attachment #1: Type: text/plain, Size: 2036 bytes --]

Hi Daniel,

I love your patch! Yet something to improve:

[auto build test ERROR on bpf-next/master]
[cannot apply to v5.4-rc8 next-20191122]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Daniel-Borkmann/bpf-add-bpf_jit_blinding_enabled-for-CONFIG_BPF_JIT/20191125-042008
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/net/sock.h:59:0,
                    from include/linux/tcp.h:19,
                    from include/linux/ipv6.h:87,
                    from include/net/ipv6.h:12,
                    from include/linux/sunrpc/clnt.h:28,
                    from include/linux/nfs_fs.h:32,
                    from init/do_mounts.c:23:
>> include/linux/filter.h:1061:20: error: redefinition of 'bpf_jit_blinding_enabled'
    static inline bool bpf_jit_blinding_enabled(struct bpf_prog *prog)
                       ^~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/filter.h:1056:20: note: previous definition of 'bpf_jit_blinding_enabled' was here
    static inline bool bpf_jit_blinding_enabled(struct bpf_prog *prog)
                       ^~~~~~~~~~~~~~~~~~~~~~~~

vim +/bpf_jit_blinding_enabled +1061 include/linux/filter.h

  1060	
> 1061	static inline bool bpf_jit_blinding_enabled(struct bpf_prog *prog)
  1062	{
  1063		return false;
  1064	}
  1065	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 7224 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] bpf: add bpf_jit_blinding_enabled for !CONFIG_BPF_JIT
  2019-11-24 22:54 ` kbuild test robot
@ 2019-11-25  7:27   ` Daniel Borkmann
  2019-11-26  5:55     ` [kbuild-all] " Rong Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Borkmann @ 2019-11-25  7:27 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, ast, jakub, andrii.nakryiko, netdev, bpf,
	Andrii Nakryiko, philip.li, fengguang.wu

[ +Philip, +Fengguang ]

On 11/24/19 11:54 PM, kbuild test robot wrote:
> Hi Daniel,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on bpf-next/master]
> [cannot apply to v5.4-rc8 next-20191122]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
> 
> url:    https://github.com/0day-ci/linux/commits/Daniel-Borkmann/bpf-add-bpf_jit_blinding_enabled-for-CONFIG_BPF_JIT/20191125-042008
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
> config: i386-tinyconfig (attached as .config)
> compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
> reproduce:
>          # save the attached .config to linux build tree
>          make ARCH=i386
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>     In file included from include/net/sock.h:59:0,
>                      from include/linux/tcp.h:19,
>                      from include/linux/ipv6.h:87,
>                      from include/net/ipv6.h:12,
>                      from include/linux/sunrpc/clnt.h:28,
>                      from include/linux/nfs_fs.h:32,
>                      from init/do_mounts.c:23:
>>> include/linux/filter.h:1061:20: error: redefinition of 'bpf_jit_blinding_enabled'
>      static inline bool bpf_jit_blinding_enabled(struct bpf_prog *prog)
>                         ^~~~~~~~~~~~~~~~~~~~~~~~
>     include/linux/filter.h:1056:20: note: previous definition of 'bpf_jit_blinding_enabled' was here
>      static inline bool bpf_jit_blinding_enabled(struct bpf_prog *prog)
>                         ^~~~~~~~~~~~~~~~~~~~~~~~

Hmm, can't reproduce with above .config for `make ARCH=i386`. The .config doesn't have
CONFIG_BPF_JIT, and given there's only exactly *one* definition of bpf_jit_blinding_enabled()
for CONFIG_BPF_JIT and *one* for !CONFIG_BPF_JIT this build bot warning feels invalid to me
(unless I'm completely blind and missing something obvious, but the succeeded kernel build
seems to agree with me).

Thanks,
Daniel

> vim +/bpf_jit_blinding_enabled +1061 include/linux/filter.h
> 
>    1060	
>> 1061	static inline bool bpf_jit_blinding_enabled(struct bpf_prog *prog)
>    1062	{
>    1063		return false;
>    1064	}
>    1065	
> 
> ---
> 0-DAY kernel test infrastructure                 Open Source Technology Center
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [kbuild-all] Re: [PATCH bpf-next] bpf: add bpf_jit_blinding_enabled for !CONFIG_BPF_JIT
  2019-11-25  7:27   ` Daniel Borkmann
@ 2019-11-26  5:55     ` " Rong Chen
  0 siblings, 0 replies; 5+ messages in thread
From: Rong Chen @ 2019-11-26  5:55 UTC (permalink / raw)
  To: Daniel Borkmann, kbuild test robot
  Cc: kbuild-all, ast, jakub, andrii.nakryiko, netdev, bpf,
	Andrii Nakryiko, fengguang.wu

Hi Daniel,

Sorry for the inconvenience, It's our fault. the patch("bpf: Add 
bpf_jit_blinding_enabled for !CONFIG_BPF_JIT") has been applied into 
bpf-next/master,
but kbuild bot catched the patch("bpf: add bpf_jit_blinding_enabled for 
!CONFIG_BPF_JIT") and applied it again.

$ git log --oneline 
linux-review/Daniel-Borkmann/bpf-add-bpf_jit_blinding_enabled-for-CONFIG_BPF_JIT/20191125-042008 
-n5
139a0e0d24031 bpf: add bpf_jit_blinding_enabled for !CONFIG_BPF_JIT
b633b4ea8a963 bpf: Simplify __bpf_arch_text_poke poke type handling
11d450039666e bpf: Introduce BPF_TRACE_x helper for the tracing tests
691ed80326693 bpf: Add bpf_jit_blinding_enabled for !CONFIG_BPF_JIT
eb41045096419 Merge branch 'optimize-bpf_tail_call'

Best Regards,
Rong Chen

On 11/25/19 3:27 PM, Daniel Borkmann wrote:
> [ +Philip, +Fengguang ]
>
> On 11/24/19 11:54 PM, kbuild test robot wrote:
>> Hi Daniel,
>>
>> I love your patch! Yet something to improve:
>>
>> [auto build test ERROR on bpf-next/master]
>> [cannot apply to v5.4-rc8 next-20191122]
>> [if your patch is applied to the wrong git tree, please drop us a 
>> note to help
>> improve the system. BTW, we also suggest to use '--base' option to 
>> specify the
>> base tree in git format-patch, please see 
>> https://stackoverflow.com/a/37406982]
>>
>> url: 
>> https://github.com/0day-ci/linux/commits/Daniel-Borkmann/bpf-add-bpf_jit_blinding_enabled-for-CONFIG_BPF_JIT/20191125-042008
>> base: 
>> https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
>> config: i386-tinyconfig (attached as .config)
>> compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
>> reproduce:
>>          # save the attached .config to linux build tree
>>          make ARCH=i386
>>
>> If you fix the issue, kindly add following tag
>> Reported-by: kbuild test robot <lkp@intel.com>
>>
>> All errors (new ones prefixed by >>):
>>
>>     In file included from include/net/sock.h:59:0,
>>                      from include/linux/tcp.h:19,
>>                      from include/linux/ipv6.h:87,
>>                      from include/net/ipv6.h:12,
>>                      from include/linux/sunrpc/clnt.h:28,
>>                      from include/linux/nfs_fs.h:32,
>>                      from init/do_mounts.c:23:
>>>> include/linux/filter.h:1061:20: error: redefinition of 
>>>> 'bpf_jit_blinding_enabled'
>>      static inline bool bpf_jit_blinding_enabled(struct bpf_prog *prog)
>>                         ^~~~~~~~~~~~~~~~~~~~~~~~
>>     include/linux/filter.h:1056:20: note: previous definition of 
>> 'bpf_jit_blinding_enabled' was here
>>      static inline bool bpf_jit_blinding_enabled(struct bpf_prog *prog)
>>                         ^~~~~~~~~~~~~~~~~~~~~~~~
>
> Hmm, can't reproduce with above .config for `make ARCH=i386`. The 
> .config doesn't have
> CONFIG_BPF_JIT, and given there's only exactly *one* definition of 
> bpf_jit_blinding_enabled()
> for CONFIG_BPF_JIT and *one* for !CONFIG_BPF_JIT this build bot 
> warning feels invalid to me
> (unless I'm completely blind and missing something obvious, but the 
> succeeded kernel build
> seems to agree with me).
>
> Thanks,
> Daniel
>
>> vim +/bpf_jit_blinding_enabled +1061 include/linux/filter.h
>>
>>    1060
>>> 1061    static inline bool bpf_jit_blinding_enabled(struct bpf_prog 
>>> *prog)
>>    1062    {
>>    1063        return false;
>>    1064    }
>>    1065
>>
>> ---
>> 0-DAY kernel test infrastructure                 Open Source 
>> Technology Center
>> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel 
>> Corporation
>>
> _______________________________________________
> kbuild-all mailing list -- kbuild-all@lists.01.org
> To unsubscribe send an email to kbuild-all-leave@lists.01.org


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-23 20:37 [PATCH bpf-next] bpf: add bpf_jit_blinding_enabled for !CONFIG_BPF_JIT Daniel Borkmann
2019-11-23 21:04 ` Alexei Starovoitov
2019-11-24 22:54 ` kbuild test robot
2019-11-25  7:27   ` Daniel Borkmann
2019-11-26  5:55     ` [kbuild-all] " Rong Chen

BPF Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/bpf/0 bpf/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 bpf bpf/ https://lore.kernel.org/bpf \
		bpf@vger.kernel.org
	public-inbox-index bpf

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.bpf


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git