[saeed:mlx5-queue 6/13] kernel/bpf/verifier.c:3552:11: error: implicit declaration of function 'bpf_ct_is_valid_access'

From: kernel test robot
Date: Sun Oct 17 2021 - 07:13:52 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git mlx5-queue
head: 46fb2d6328c851496c3bcc5e50a1e58786c83acb
commit: 66d7b124a88b85fab8335567dd9c69450a9648dc [6/13] bpf: Expose struct nf_conn to BPF
config: riscv-randconfig-r006-20211017 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 746dd6a700931988dd9021d3d04718f1929885a5)
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
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git/commit/?id=66d7b124a88b85fab8335567dd9c69450a9648dc
git remote add saeed https://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git
git fetch --no-tags saeed mlx5-queue
git checkout 66d7b124a88b85fab8335567dd9c69450a9648dc
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv

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

All errors (new ones prefixed by >>):

In file included from kernel/bpf/verifier.c:12:
In file included from include/linux/bpf_verifier.h:9:
In file included from include/linux/filter.h:11:
In file included from include/linux/skbuff.h:17:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from kernel/bpf/verifier.c:12:
In file included from include/linux/bpf_verifier.h:9:
In file included from include/linux/filter.h:11:
In file included from include/linux/skbuff.h:17:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from kernel/bpf/verifier.c:12:
In file included from include/linux/bpf_verifier.h:9:
In file included from include/linux/filter.h:11:
In file included from include/linux/skbuff.h:17:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:1024:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> kernel/bpf/verifier.c:3552:11: error: implicit declaration of function 'bpf_ct_is_valid_access' [-Werror,-Wimplicit-function-declaration]
valid = bpf_ct_is_valid_access(off, size, t, &info);
^
kernel/bpf/verifier.c:3552:11: note: did you mean 'bpf_sock_is_valid_access'?
include/linux/bpf.h:2165:20: note: 'bpf_sock_is_valid_access' declared here
static inline bool bpf_sock_is_valid_access(int off, int size,
^
>> kernel/bpf/verifier.c:12388:25: error: use of undeclared identifier 'bpf_ct_convert_ctx_access'; did you mean 'bpf_sock_convert_ctx_access'?
convert_ctx_access = bpf_ct_convert_ctx_access;
^~~~~~~~~~~~~~~~~~~~~~~~~
bpf_sock_convert_ctx_access
include/linux/bpf.h:2171:19: note: 'bpf_sock_convert_ctx_access' declared here
static inline u32 bpf_sock_convert_ctx_access(enum bpf_access_type type,
^
7 warnings and 2 errors generated.


vim +/bpf_ct_is_valid_access +3552 kernel/bpf/verifier.c

3535
3536 static int check_ct_access(struct bpf_verifier_env *env, int insn_idx,
3537 u32 regno, int off, int size, enum bpf_access_type t)
3538 {
3539 struct bpf_reg_state *regs = cur_regs(env);
3540 struct bpf_reg_state *reg = &regs[regno];
3541 struct bpf_insn_access_aux info = {};
3542 bool valid;
3543
3544 if (reg->smin_value < 0) {
3545 verbose(env, "R%d min value is negative, either use unsigned index or do a if (index >=0) check.\n",
3546 regno);
3547 return -EACCES;
3548 }
3549
3550 switch (reg->type) {
3551 case PTR_TO_NF_CONN:
> 3552 valid = bpf_ct_is_valid_access(off, size, t, &info);
3553 break;
3554 default:
3555 valid = false;
3556 }
3557
3558 if (valid) {
3559 env->insn_aux_data[insn_idx].ctx_field_size =
3560 info.ctx_field_size;
3561 return 0;
3562 }
3563
3564 verbose(env, "R%d invalid %s access off=%d size=%d\n",
3565 regno, reg_type_str[reg->type], off, size);
3566
3567 return -EACCES;
3568 }
3569

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

Attachment: .config.gz
Description: application/gzip