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: <202204191109.jMo5t4hA-lkp@intel.com>
Date:   Tue, 19 Apr 2022 11:26:06 +0800
From:   kernel test robot <lkp@...el.com>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org
Subject: [mingo-tip:sched/headers 1662/2356]
 include/linux/bpf-cgroup-api.h:99:17: warning: incompatible integer to
 pointer conversion initializing 'struct cgroup *' with an expression of type
 'int'

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git sched/headers
head:   af93551cf39027d176f30b9beafc60a4c130998a
commit: 946f6b0a519a1210d974a40c8400726c341e0bd6 [1662/2356] headers/deps: cgroup: Split <linux/bpf-cgroup.h> into <linux/bpf-cgroup-types.h> and <linux/bpf-cgroup-api.h>
config: x86_64-randconfig-a013-20220418 (https://download.01.org/0day-ci/archive/20220419/202204191109.jMo5t4hA-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 429cbac0390654f90bba18a41799464adf31a5ec)
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/mingo/tip.git/commit/?id=946f6b0a519a1210d974a40c8400726c341e0bd6
        git remote add mingo-tip git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git
        git fetch --no-tags mingo-tip sched/headers
        git checkout 946f6b0a519a1210d974a40c8400726c341e0bd6
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash kernel/bpf/ mm/ net/ipv4/ sound/soc/codecs/

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 kernel/bpf/cgroup.c:17:
   include/linux/bpf-cgroup-api.h:99:24: error: implicit declaration of function 'sock_cgroup_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
                                 ^
>> include/linux/bpf-cgroup-api.h:99:17: warning: incompatible integer to pointer conversion initializing 'struct cgroup *' with an expression of type 'int' [-Wint-conversion]
           struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
                          ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from kernel/bpf/cgroup.c:31:
   In file included from kernel/bpf/../cgroup/cgroup-internal.h:7:
   include/linux/cgroup_api.h:875:30: error: static declaration of 'sock_cgroup_ptr' follows non-static declaration
   static inline struct cgroup *sock_cgroup_ptr(struct sock_cgroup_data *skcd)
                                ^
   include/linux/bpf-cgroup-api.h:99:24: note: previous implicit declaration is here
           struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
                                 ^
   1 warning and 2 errors generated.
--
   In file included from net/ipv4/udp.c:103:
   include/linux/bpf-cgroup-api.h:99:24: error: implicit declaration of function 'sock_cgroup_ptr' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
                                 ^
>> include/linux/bpf-cgroup-api.h:99:17: warning: incompatible integer to pointer conversion initializing 'struct cgroup *' with an expression of type 'int' [-Wint-conversion]
           struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
                          ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning and 1 error generated.


vim +99 include/linux/bpf-cgroup-api.h

    90	
    91	int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void *key, void *value);
    92	int bpf_percpu_cgroup_storage_update(struct bpf_map *map, void *key,
    93					     void *value, u64 flags);
    94	
    95	/* Opportunistic check to see whether we have any BPF program attached*/
    96	static inline bool cgroup_bpf_sock_enabled(struct sock *sk,
    97						   enum cgroup_bpf_attach_type type)
    98	{
  > 99		struct cgroup *cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
   100		struct bpf_prog_array *array;
   101	
   102		array = rcu_access_pointer(cgrp->bpf.effective[type]);
   103		return array != &bpf_empty_prog_array.hdr;
   104	}
   105	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ