lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202109281502.INTSi0XQ-lkp@intel.com>
Date:   Tue, 28 Sep 2021 15:55:09 +0800
From:   kernel test robot <lkp@...el.com>
To:     Björn Töpel <bjorn.topel@...el.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Daniel Borkmann <daniel@...earbox.net>
Subject: include/linux/filter.h:363:18: warning: cast between incompatible
 function types from 'int (*)(struct bpf_map *, u32,  u64)' {aka 'int
 (*)(struct bpf_map *, unsigned int,  long long unsigned int)'} to 'u64
 (*)(u64,  u64,  u64,  u64,  u64)' {aka 'long long...

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   92477dd1faa650e50bd3bb35a6c0b8d09198cc35
commit: e6a4750ffe9d701c4d55212b14b615e63571d235 bpf, xdp: Make bpf_redirect_map() a map operation
date:   7 months ago
config: nds32-buildonly-randconfig-r002-20210927 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e6a4750ffe9d701c4d55212b14b615e63571d235
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout e6a4750ffe9d701c4d55212b14b615e63571d235
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=nds32 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/bpf_verifier.h:9,
                    from kernel/bpf/verifier.c:12:
   kernel/bpf/verifier.c: In function 'jit_subprogs':
   include/linux/filter.h:363:18: warning: cast between incompatible function types from 'unsigned int (*)(const void *, const struct bpf_insn *)' to 'u64 (*)(u64,  u64,  u64,  u64,  u64)' {aka 'long long unsigned int (*)(long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int)'} [-Wcast-function-type]
     363 |                 ((u64 (*)(u64, u64, u64, u64, u64))(x))
         |                  ^
   kernel/bpf/verifier.c:11662:37: note: in expansion of macro 'BPF_CAST_CALL'
   11662 |                         insn->imm = BPF_CAST_CALL(func[subprog]->bpf_func) -
         |                                     ^~~~~~~~~~~~~
   kernel/bpf/verifier.c: In function 'do_misc_fixups':
   include/linux/filter.h:363:18: warning: cast between incompatible function types from 'void * (*)(struct bpf_map *, void *)' to 'u64 (*)(u64,  u64,  u64,  u64,  u64)' {aka 'long long unsigned int (*)(long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int)'} [-Wcast-function-type]
     363 |                 ((u64 (*)(u64, u64, u64, u64, u64))(x))
         |                  ^
   kernel/bpf/verifier.c:12070:45: note: in expansion of macro 'BPF_CAST_CALL'
   12070 |                                 insn->imm = BPF_CAST_CALL(ops->map_lookup_elem) -
         |                                             ^~~~~~~~~~~~~
   include/linux/filter.h:363:18: warning: cast between incompatible function types from 'int (*)(struct bpf_map *, void *, void *, u64)' {aka 'int (*)(struct bpf_map *, void *, void *, long long unsigned int)'} to 'u64 (*)(u64,  u64,  u64,  u64,  u64)' {aka 'long long unsigned int (*)(long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int)'} [-Wcast-function-type]
     363 |                 ((u64 (*)(u64, u64, u64, u64, u64))(x))
         |                  ^
   kernel/bpf/verifier.c:12074:45: note: in expansion of macro 'BPF_CAST_CALL'
   12074 |                                 insn->imm = BPF_CAST_CALL(ops->map_update_elem) -
         |                                             ^~~~~~~~~~~~~
   include/linux/filter.h:363:18: warning: cast between incompatible function types from 'int (*)(struct bpf_map *, void *)' to 'u64 (*)(u64,  u64,  u64,  u64,  u64)' {aka 'long long unsigned int (*)(long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int)'} [-Wcast-function-type]
     363 |                 ((u64 (*)(u64, u64, u64, u64, u64))(x))
         |                  ^
   kernel/bpf/verifier.c:12078:45: note: in expansion of macro 'BPF_CAST_CALL'
   12078 |                                 insn->imm = BPF_CAST_CALL(ops->map_delete_elem) -
         |                                             ^~~~~~~~~~~~~
   include/linux/filter.h:363:18: warning: cast between incompatible function types from 'int (*)(struct bpf_map *, void *, u64)' {aka 'int (*)(struct bpf_map *, void *, long long unsigned int)'} to 'u64 (*)(u64,  u64,  u64,  u64,  u64)' {aka 'long long unsigned int (*)(long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int)'} [-Wcast-function-type]
     363 |                 ((u64 (*)(u64, u64, u64, u64, u64))(x))
         |                  ^
   kernel/bpf/verifier.c:12082:45: note: in expansion of macro 'BPF_CAST_CALL'
   12082 |                                 insn->imm = BPF_CAST_CALL(ops->map_push_elem) -
         |                                             ^~~~~~~~~~~~~
   include/linux/filter.h:363:18: warning: cast between incompatible function types from 'int (*)(struct bpf_map *, void *)' to 'u64 (*)(u64,  u64,  u64,  u64,  u64)' {aka 'long long unsigned int (*)(long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int)'} [-Wcast-function-type]
     363 |                 ((u64 (*)(u64, u64, u64, u64, u64))(x))
         |                  ^
   kernel/bpf/verifier.c:12086:45: note: in expansion of macro 'BPF_CAST_CALL'
   12086 |                                 insn->imm = BPF_CAST_CALL(ops->map_pop_elem) -
         |                                             ^~~~~~~~~~~~~
   include/linux/filter.h:363:18: warning: cast between incompatible function types from 'int (*)(struct bpf_map *, void *)' to 'u64 (*)(u64,  u64,  u64,  u64,  u64)' {aka 'long long unsigned int (*)(long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int)'} [-Wcast-function-type]
     363 |                 ((u64 (*)(u64, u64, u64, u64, u64))(x))
         |                  ^
   kernel/bpf/verifier.c:12090:45: note: in expansion of macro 'BPF_CAST_CALL'
   12090 |                                 insn->imm = BPF_CAST_CALL(ops->map_peek_elem) -
         |                                             ^~~~~~~~~~~~~
>> include/linux/filter.h:363:18: warning: cast between incompatible function types from 'int (*)(struct bpf_map *, u32,  u64)' {aka 'int (*)(struct bpf_map *, unsigned int,  long long unsigned int)'} to 'u64 (*)(u64,  u64,  u64,  u64,  u64)' {aka 'long long unsigned int (*)(long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int)'} [-Wcast-function-type]
     363 |                 ((u64 (*)(u64, u64, u64, u64, u64))(x))
         |                  ^
   kernel/bpf/verifier.c:12094:45: note: in expansion of macro 'BPF_CAST_CALL'
   12094 |                                 insn->imm = BPF_CAST_CALL(ops->map_redirect) -
         |                                             ^~~~~~~~~~~~~


vim +363 include/linux/filter.h

f8f6d679aaa78b Daniel Borkmann 2014-05-29  361  
09772d92cd5ad9 Daniel Borkmann 2018-06-02  362  #define BPF_CAST_CALL(x)					\
09772d92cd5ad9 Daniel Borkmann 2018-06-02 @363  		((u64 (*)(u64, u64, u64, u64, u64))(x))
09772d92cd5ad9 Daniel Borkmann 2018-06-02  364  

:::::: The code at line 363 was first introduced by commit
:::::: 09772d92cd5ad998b0d5f6f46cd1658f8cb698cf bpf: avoid retpoline for lookup/update/delete calls on maps

:::::: TO: Daniel Borkmann <daniel@...earbox.net>
:::::: CC: Alexei Starovoitov <ast@...nel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (28194 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ