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: <202205261859.oX2Ndm8n-lkp@intel.com>
Date:   Thu, 26 May 2022 18:46:55 +0800
From:   kernel test robot <lkp@...el.com>
To:     Cong Wang <xiyou.wangcong@...il.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [congwang:sch_bpf 3/4] net/sched/sch_bpf.c:120:19: sparse: sparse:
 incompatible types in comparison expression (different address spaces):

tree:   https://github.com/congwang/linux.git sch_bpf
head:   59219ec0c11347c742ce9c432a733036eb4ed9c9
commit: 1d25d83ca077206d9665b3491b722068de876a73 [3/4] net_sched: introduce eBPF based Qdisc
config: powerpc-randconfig-s032-20220524 (https://download.01.org/0day-ci/archive/20220526/202205261859.oX2Ndm8n-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 11.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-14-g5a0004b5-dirty
        # https://github.com/congwang/linux/commit/1d25d83ca077206d9665b3491b722068de876a73
        git remote add congwang https://github.com/congwang/linux.git
        git fetch --no-tags congwang sch_bpf
        git checkout 1d25d83ca077206d9665b3491b722068de876a73
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash net/sched/

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


sparse warnings: (new ones prefixed by >>)
>> net/sched/sch_bpf.c:120:19: sparse: sparse: incompatible types in comparison expression (different address spaces):
>> net/sched/sch_bpf.c:120:19: sparse:    struct bpf_prog [noderef] __rcu *
>> net/sched/sch_bpf.c:120:19: sparse:    struct bpf_prog *
   net/sched/sch_bpf.c:166:19: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/sched/sch_bpf.c:166:19: sparse:    struct bpf_prog [noderef] __rcu *
   net/sched/sch_bpf.c:166:19: sparse:    struct bpf_prog *

vim +120 net/sched/sch_bpf.c

   109	
   110	static int sch_bpf_enqueue(struct sk_buff *skb, struct Qdisc *sch,
   111				   struct sk_buff **to_free)
   112	{
   113		struct sch_bpf_qdisc *q = qdisc_priv(sch);
   114		unsigned int len = qdisc_pkt_len(skb);
   115		struct sch_bpf_ctx ctx = {};
   116		struct sch_bpf_class *cl;
   117		int res = NET_XMIT_SUCCESS;
   118		struct bpf_prog *enqueue;
   119	
 > 120		enqueue = rcu_dereference(q->enqueue_prog.prog);
   121		bpf_compute_data_pointers(skb);
   122		ctx.skb = (struct __sk_buff *)skb;
   123		ctx.classid = sch->handle;
   124		res = bpf_prog_run(enqueue, &ctx);
   125		switch (res) {
   126		case SCH_BPF_DROP:
   127			__qdisc_drop(skb, to_free);
   128			return NET_XMIT_DROP;
   129		case SCH_BPF_QUEUED:
   130			return NET_XMIT_SUCCESS;
   131		}
   132	
   133		cl = sch_bpf_find(sch, ctx.classid);
   134		if (!cl || !cl->qdisc) {
   135			if (res & __NET_XMIT_BYPASS)
   136				qdisc_qstats_drop(sch);
   137			__qdisc_drop(skb, to_free);
   138			return res;
   139		}
   140	
   141		res = qdisc_enqueue(skb, cl->qdisc, to_free);
   142		if (res != NET_XMIT_SUCCESS) {
   143			if (net_xmit_drop_count(res)) {
   144				qdisc_qstats_drop(sch);
   145				cl->drops++;
   146			}
   147			return res;
   148		}
   149	
   150		sch->qstats.backlog += len;
   151		sch->q.qlen++;
   152		return res;
   153	}
   154	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ