netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Stanislav Fomichev <sdf@google.com>,
	netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: kbuild-all@lists.01.org, ast@kernel.org, daniel@iogearbox.net,
	andrii@kernel.org, Stanislav Fomichev <sdf@google.com>
Subject: Re: [PATCH bpf-next 2/7] bpf: per-cgroup lsm flavor
Date: Tue, 29 Mar 2022 06:36:11 +0800	[thread overview]
Message-ID: <202203290625.2evhIzSX-lkp@intel.com> (raw)
In-Reply-To: <20220328181644.1748789-3-sdf@google.com>

Hi Stanislav,

Thank you for the patch! Perhaps something to improve:

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

url:    https://github.com/intel-lab-lkp/linux/commits/Stanislav-Fomichev/bpf-cgroup_sock-lsm-flavor/20220329-021809
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20220329/202203290625.2evhIzSX-lkp@intel.com/config)
compiler: powerpc-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://github.com/intel-lab-lkp/linux/commit/cf70645346b1affcc956902a44671c1d0eaa451a
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Stanislav-Fomichev/bpf-cgroup_sock-lsm-flavor/20220329-021809
        git checkout cf70645346b1affcc956902a44671c1d0eaa451a
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash kernel/bpf/

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

All warnings (new ones prefixed by >>):

   kernel/bpf/bpf_lsm.c: In function '__cgroup_bpf_run_lsm_socket':
>> kernel/bpf/bpf_lsm.c:49:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      49 |         sock = (void *)regs[BPF_REG_0];
         |                ^


vim +49 kernel/bpf/bpf_lsm.c

    37	
    38	static unsigned int __cgroup_bpf_run_lsm_socket(const void *ctx,
    39							const struct bpf_insn *insn)
    40	{
    41		const struct bpf_prog *prog;
    42		struct socket *sock;
    43		struct cgroup *cgrp;
    44		struct sock *sk;
    45		int ret = 0;
    46		u64 *regs;
    47	
    48		regs = (u64 *)ctx;
  > 49		sock = (void *)regs[BPF_REG_0];
    50		/*prog = container_of(insn, struct bpf_prog, insnsi);*/
    51		prog = (const struct bpf_prog *)((void *)insn - offsetof(struct bpf_prog, insnsi));
    52	
    53		if (unlikely(!sock))
    54			return 0;
    55	
    56		sk = sock->sk;
    57		if (unlikely(!sk))
    58			return 0;
    59	
    60		cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
    61		if (likely(cgrp))
    62			ret = BPF_PROG_RUN_ARRAY_CG(cgrp->bpf.effective[prog->aux->cgroup_atype],
    63						    ctx, bpf_prog_run, 0);
    64		return ret;
    65	}
    66	

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

  parent reply	other threads:[~2022-03-28 22:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28 18:16 [PATCH bpf-next 0/7] bpf: cgroup_sock lsm flavor Stanislav Fomichev
2022-03-28 18:16 ` [PATCH bpf-next 1/7] bpf: add bpf_func_t and trampoline helpers Stanislav Fomichev
2022-03-28 18:16 ` [PATCH bpf-next 2/7] bpf: per-cgroup lsm flavor Stanislav Fomichev
2022-03-28 22:36   ` kernel test robot
2022-03-28 22:36   ` kernel test robot [this message]
2022-03-28 18:16 ` [PATCH bpf-next 3/7] bpf: minimize number of allocated lsm slots per program Stanislav Fomichev
2022-03-28 18:16 ` [PATCH bpf-next 4/7] bpf: allow writing to a subset of sock fields from lsm progtype Stanislav Fomichev
2022-03-28 18:16 ` [PATCH bpf-next 5/7] libbpf: add lsm_cgoup_sock type Stanislav Fomichev
2022-03-28 18:16 ` [PATCH bpf-next 6/7] selftests/bpf: lsm_cgroup functional test Stanislav Fomichev
2022-03-28 18:16 ` [PATCH bpf-next 7/7] selftests/bpf: verify lsm_cgroup struct sock access Stanislav Fomichev

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=202203290625.2evhIzSX-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=netdev@vger.kernel.org \
    --cc=sdf@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).