BPF List
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Andrii Nakryiko <andrii@kernel.org>,
	bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, andrii@kernel.org,
	kernel-team@fb.com
Subject: Re: [PATCH bpf-next 1/4] bpf: fix potential 32-bit overflow when accessing ARRAY map element
Date: Fri, 15 Jul 2022 09:44:55 +0800	[thread overview]
Message-ID: <202207150918.GuUgOFHd-lkp@intel.com> (raw)
In-Reply-To: <20220714214305.3189551-2-andrii@kernel.org>

Hi Andrii,

I love your patch! Yet something to improve:

[auto build test ERROR on bpf-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Andrii-Nakryiko/BPF-array-map-fixes-and-improvements/20220715-054514
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: hexagon-randconfig-r045-20220714 (https://download.01.org/0day-ci/archive/20220715/202207150918.GuUgOFHd-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 2da550140aa98cf6a3e96417c87f1e89e3a26047)
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://github.com/intel-lab-lkp/linux/commit/c740c9bcbe3ab67a921ace0d988bd45214c41bef
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Andrii-Nakryiko/BPF-array-map-fixes-and-improvements/20220715-054514
        git checkout c740c9bcbe3ab67a921ace0d988bd45214c41bef
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash kernel/bpf/

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

All errors (new ones prefixed by >>):

>> kernel/bpf/arraymap.c:173:75: error: expected ';' after return statement
           return array->value + (u64)array->elem_size * (index & array->index_mask)
                                                                                    ^
                                                                                    ;
   1 error generated.


vim +173 kernel/bpf/arraymap.c

   163	
   164	/* Called from syscall or from eBPF program */
   165	static void *array_map_lookup_elem(struct bpf_map *map, void *key)
   166	{
   167		struct bpf_array *array = container_of(map, struct bpf_array, map);
   168		u32 index = *(u32 *)key;
   169	
   170		if (unlikely(index >= array->map.max_entries))
   171			return NULL;
   172	
 > 173		return array->value + (u64)array->elem_size * (index & array->index_mask)
   174	}
   175	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

  reply	other threads:[~2022-07-15  1:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 21:43 [PATCH bpf-next 0/4] BPF array map fixes and improvements Andrii Nakryiko
2022-07-14 21:43 ` [PATCH bpf-next 1/4] bpf: fix potential 32-bit overflow when accessing ARRAY map element Andrii Nakryiko
2022-07-15  1:44   ` kernel test robot [this message]
2022-07-15  4:57   ` Alexei Starovoitov
2022-07-15  5:09     ` Andrii Nakryiko
2022-07-14 21:43 ` [PATCH bpf-next 2/4] bpf: make uniform use of array->elem_size everywhere in arraymap.c Andrii Nakryiko
2022-07-14 21:43 ` [PATCH bpf-next 3/4] bpf: remove obsolete KMALLOC_MAX_SIZE restriction on array map value size Andrii Nakryiko
2022-07-14 21:43 ` [PATCH bpf-next 4/4] selftests/bpf: validate .bss section bigger than 8MB is possible now Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202207150918.GuUgOFHd-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kbuild-all@lists.01.org \
    --cc=kernel-team@fb.com \
    --cc=llvm@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox