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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202203290625.2evhIzSX-lkp@intel.com>
Date:   Tue, 29 Mar 2022 06:36:11 +0800
From:   kernel test robot <lkp@...el.com>
To:     Stanislav Fomichev <sdf@...gle.com>, netdev@...r.kernel.org,
        bpf@...r.kernel.org
Cc:     kbuild-all@...ts.01.org, ast@...nel.org, daniel@...earbox.net,
        andrii@...nel.org, Stanislav Fomichev <sdf@...gle.com>
Subject: Re: [PATCH bpf-next 2/7] bpf: per-cgroup lsm flavor

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@...el.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ