All of lore.kernel.org
 help / color / mirror / Atom feed
* net/netfilter/nf_tables_api.c:2084:23: sparse: got struct nft_stats __percpu COPYING CREDITS Documentation Kbuild Kconfig LICENSES MAINTAINERS Makefile README arch block certs crypto drivers fs include init ipc kernel lib mm net samples scripts security sound tools usr virt
@ 2020-11-24  8:28 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-11-24  8:28 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 14503 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: John David Anglin <dave.anglin@bell.net>
CC: Helge Deller <deller@gmx.de>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d5beb3140f91b1c8a3d41b14d729aefa4dcc58bc
commit: e96ebd589debd9a6a793608c4ec7019c38785dea parisc: Implement __smp_store_release and __smp_load_acquire barriers
date:   3 months ago
:::::: branch date: 9 hours ago
:::::: commit date: 3 months ago
config: parisc-randconfig-s031-20201124 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.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.3-151-g540c2c4b-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e96ebd589debd9a6a793608c4ec7019c38785dea
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout e96ebd589debd9a6a793608c4ec7019c38785dea
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=parisc 

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


"sparse warnings: (new ones prefixed by >>)"
   net/netfilter/nf_tables_api.c:1392:25: sparse: sparse: cast between address spaces (__percpu -> __rcu)
   net/netfilter/nf_tables_api.c:1392:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/netfilter/nf_tables_api.c:1392:25: sparse:    struct nft_stats [noderef] __rcu *
   net/netfilter/nf_tables_api.c:1392:25: sparse:    struct nft_stats [noderef] __percpu *
   net/netfilter/nf_tables_api.c:1554:31: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected struct nft_stats [noderef] __percpu * @@     got void * @@
   net/netfilter/nf_tables_api.c:1557:31: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected struct nft_stats [noderef] __percpu * @@     got void * @@
   net/netfilter/nf_tables_api.c:1561:31: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected struct nft_stats [noderef] __percpu * @@     got void * @@
   net/netfilter/nf_tables_api.c:1583:17: sparse: sparse: cast between address spaces (__percpu -> __rcu)
   net/netfilter/nf_tables_api.c:1583:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/netfilter/nf_tables_api.c:1583:17: sparse:    struct nft_stats [noderef] __rcu *
   net/netfilter/nf_tables_api.c:1583:17: sparse:    struct nft_stats [noderef] __percpu *
   net/netfilter/nf_tables_api.c:1583:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/netfilter/nf_tables_api.c:1583:17: sparse:    struct nft_stats [noderef] __rcu *
   net/netfilter/nf_tables_api.c:1583:17: sparse:    struct nft_stats [noderef] __percpu *
   net/netfilter/nf_tables_api.c:1626:21: sparse: sparse: cast between address spaces (__percpu -> __rcu)
   net/netfilter/nf_tables_api.c:1626:21: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/netfilter/nf_tables_api.c:1626:21: sparse:    struct nft_stats [noderef] __rcu *
   net/netfilter/nf_tables_api.c:1626:21: sparse:    struct nft_stats [noderef] __percpu *
   net/netfilter/nf_tables_api.c:1934:25: sparse: sparse: cast between address spaces (__percpu -> __rcu)
   net/netfilter/nf_tables_api.c:1934:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
   net/netfilter/nf_tables_api.c:1934:25: sparse:    struct nft_stats [noderef] __rcu *
   net/netfilter/nf_tables_api.c:1934:25: sparse:    struct nft_stats [noderef] __percpu *
   net/netfilter/nf_tables_api.c:2084:23: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct nft_stats *stats @@     got struct nft_stats [noderef] __percpu * @@
   net/netfilter/nf_tables_api.c:2084:23: sparse:     expected struct nft_stats *stats
>> net/netfilter/nf_tables_api.c:2084:23: sparse:     got struct nft_stats [noderef] __percpu *
   net/netfilter/nf_tables_api.c:2095:38: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct nft_stats [noderef] __percpu *stats @@     got struct nft_stats *stats @@
>> net/netfilter/nf_tables_api.c:2095:38: sparse:     expected struct nft_stats [noderef] __percpu *stats
   net/netfilter/nf_tables_api.c:2095:38: sparse:     got struct nft_stats *stats
   net/netfilter/nf_tables_api.c:2131:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __percpu *__pdata @@     got struct nft_stats *stats @@
>> net/netfilter/nf_tables_api.c:2131:21: sparse:     expected void [noderef] __percpu *__pdata
   net/netfilter/nf_tables_api.c:2131:21: sparse:     got struct nft_stats *stats
   net/netfilter/nf_tables_api.c:747:12: sparse: sparse: context imbalance in 'nft_netlink_dump_start_rcu' - unexpected unlock

vim +2084 net/netfilter/nf_tables_api.c

d54725cd11a57c3 Pablo Neira Ayuso 2019-10-16  2021  
c9626a2cbdb20e2 Pablo Neira Ayuso 2019-07-09  2022  static int nf_tables_updchain(struct nft_ctx *ctx, u8 genmask, u8 policy,
c9626a2cbdb20e2 Pablo Neira Ayuso 2019-07-09  2023  			      u32 flags)
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2024  {
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2025  	const struct nlattr * const *nla = ctx->nla;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2026  	struct nft_table *table = ctx->table;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2027  	struct nft_chain *chain = ctx->chain;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2028  	struct nft_base_chain *basechain;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2029  	struct nft_stats *stats = NULL;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2030  	struct nft_chain_hook hook;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2031  	struct nf_hook_ops *ops;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2032  	struct nft_trans *trans;
c974a3a36468d19 Pablo Neira Ayuso 2017-12-09  2033  	int err;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2034  
c9626a2cbdb20e2 Pablo Neira Ayuso 2019-07-09  2035  	if (chain->flags ^ flags)
c9626a2cbdb20e2 Pablo Neira Ayuso 2019-07-09  2036  		return -EOPNOTSUPP;
c9626a2cbdb20e2 Pablo Neira Ayuso 2019-07-09  2037  
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2038  	if (nla[NFTA_CHAIN_HOOK]) {
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2039  		if (!nft_is_base_chain(chain))
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2040  			return -EBUSY;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2041  
36596dadf54a920 Pablo Neira Ayuso 2018-01-09  2042  		err = nft_chain_parse_hook(ctx->net, nla, &hook, ctx->family,
445509eb9b00278 Pablo Neira Ayuso 2018-08-03  2043  					   false);
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2044  		if (err < 0)
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2045  			return err;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2046  
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2047  		basechain = nft_base_chain(chain);
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2048  		if (basechain->type != hook.type) {
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2049  			nft_chain_release_hook(&hook);
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2050  			return -EBUSY;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2051  		}
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2052  
d54725cd11a57c3 Pablo Neira Ayuso 2019-10-16  2053  		if (ctx->family == NFPROTO_NETDEV) {
d54725cd11a57c3 Pablo Neira Ayuso 2019-10-16  2054  			if (!nft_hook_list_equal(&basechain->hook_list,
d54725cd11a57c3 Pablo Neira Ayuso 2019-10-16  2055  						 &hook.list)) {
d54725cd11a57c3 Pablo Neira Ayuso 2019-10-16  2056  				nft_chain_release_hook(&hook);
d54725cd11a57c3 Pablo Neira Ayuso 2019-10-16  2057  				return -EBUSY;
d54725cd11a57c3 Pablo Neira Ayuso 2019-10-16  2058  			}
d54725cd11a57c3 Pablo Neira Ayuso 2019-10-16  2059  		} else {
c974a3a36468d19 Pablo Neira Ayuso 2017-12-09  2060  			ops = &basechain->ops;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2061  			if (ops->hooknum != hook.num ||
d54725cd11a57c3 Pablo Neira Ayuso 2019-10-16  2062  			    ops->priority != hook.priority) {
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2063  				nft_chain_release_hook(&hook);
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2064  				return -EBUSY;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2065  			}
d54725cd11a57c3 Pablo Neira Ayuso 2019-10-16  2066  		}
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2067  		nft_chain_release_hook(&hook);
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2068  	}
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2069  
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2070  	if (nla[NFTA_CHAIN_HANDLE] &&
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2071  	    nla[NFTA_CHAIN_NAME]) {
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2072  		struct nft_chain *chain2;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2073  
f102d66b335a417 Florian Westphal  2018-07-11  2074  		chain2 = nft_chain_lookup(ctx->net, table,
f102d66b335a417 Florian Westphal  2018-07-11  2075  					  nla[NFTA_CHAIN_NAME], genmask);
0d18779be13766b JingPiao Chen     2017-09-23  2076  		if (!IS_ERR(chain2))
0d18779be13766b JingPiao Chen     2017-09-23  2077  			return -EEXIST;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2078  	}
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2079  
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2080  	if (nla[NFTA_CHAIN_COUNTERS]) {
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2081  		if (!nft_is_base_chain(chain))
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2082  			return -EOPNOTSUPP;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2083  
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03 @2084  		stats = nft_stats_alloc(nla[NFTA_CHAIN_COUNTERS]);
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2085  		if (IS_ERR(stats))
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2086  			return PTR_ERR(stats);
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2087  	}
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2088  
c6cc94df65c3174 Florian Westphal  2018-07-17  2089  	err = -ENOMEM;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2090  	trans = nft_trans_alloc(ctx, NFT_MSG_NEWCHAIN,
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2091  				sizeof(struct nft_trans_chain));
c6cc94df65c3174 Florian Westphal  2018-07-17  2092  	if (trans == NULL)
c6cc94df65c3174 Florian Westphal  2018-07-17  2093  		goto err;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2094  
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03 @2095  	nft_trans_chain_stats(trans) = stats;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2096  	nft_trans_chain_update(trans) = true;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2097  
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2098  	if (nla[NFTA_CHAIN_POLICY])
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2099  		nft_trans_chain_policy(trans) = policy;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2100  	else
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2101  		nft_trans_chain_policy(trans) = -1;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2102  
c6cc94df65c3174 Florian Westphal  2018-07-17  2103  	if (nla[NFTA_CHAIN_HANDLE] &&
c6cc94df65c3174 Florian Westphal  2018-07-17  2104  	    nla[NFTA_CHAIN_NAME]) {
c6cc94df65c3174 Florian Westphal  2018-07-17  2105  		struct nft_trans *tmp;
c6cc94df65c3174 Florian Westphal  2018-07-17  2106  		char *name;
c6cc94df65c3174 Florian Westphal  2018-07-17  2107  
c6cc94df65c3174 Florian Westphal  2018-07-17  2108  		err = -ENOMEM;
c6cc94df65c3174 Florian Westphal  2018-07-17  2109  		name = nla_strdup(nla[NFTA_CHAIN_NAME], GFP_KERNEL);
c6cc94df65c3174 Florian Westphal  2018-07-17  2110  		if (!name)
c6cc94df65c3174 Florian Westphal  2018-07-17  2111  			goto err;
c6cc94df65c3174 Florian Westphal  2018-07-17  2112  
c6cc94df65c3174 Florian Westphal  2018-07-17  2113  		err = -EEXIST;
c6cc94df65c3174 Florian Westphal  2018-07-17  2114  		list_for_each_entry(tmp, &ctx->net->nft.commit_list, list) {
c6cc94df65c3174 Florian Westphal  2018-07-17  2115  			if (tmp->msg_type == NFT_MSG_NEWCHAIN &&
c6cc94df65c3174 Florian Westphal  2018-07-17  2116  			    tmp->ctx.table == table &&
c6cc94df65c3174 Florian Westphal  2018-07-17  2117  			    nft_trans_chain_update(tmp) &&
c6cc94df65c3174 Florian Westphal  2018-07-17  2118  			    nft_trans_chain_name(tmp) &&
c6cc94df65c3174 Florian Westphal  2018-07-17  2119  			    strcmp(name, nft_trans_chain_name(tmp)) == 0) {
c6cc94df65c3174 Florian Westphal  2018-07-17  2120  				kfree(name);
c6cc94df65c3174 Florian Westphal  2018-07-17  2121  				goto err;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2122  			}
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2123  		}
c6cc94df65c3174 Florian Westphal  2018-07-17  2124  
c6cc94df65c3174 Florian Westphal  2018-07-17  2125  		nft_trans_chain_name(trans) = name;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2126  	}
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2127  	list_add_tail(&trans->list, &ctx->net->nft.commit_list);
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2128  
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2129  	return 0;
c6cc94df65c3174 Florian Westphal  2018-07-17  2130  err:
c6cc94df65c3174 Florian Westphal  2018-07-17 @2131  	free_percpu(stats);
c6cc94df65c3174 Florian Westphal  2018-07-17  2132  	kfree(trans);
c6cc94df65c3174 Florian Westphal  2018-07-17  2133  	return err;
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2134  }
2c4a488a482d265 Pablo Neira Ayuso 2017-09-03  2135  

:::::: The code at line 2084 was first introduced by commit
:::::: 2c4a488a482d265df4505671f6051067524c4f76 netfilter: nf_tables: add nf_tables_updchain()

:::::: TO: Pablo Neira Ayuso <pablo@netfilter.org>
:::::: CC: Pablo Neira Ayuso <pablo@netfilter.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 25794 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-24  8:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24  8:28 net/netfilter/nf_tables_api.c:2084:23: sparse: got struct nft_stats __percpu COPYING CREDITS Documentation Kbuild Kconfig LICENSES MAINTAINERS Makefile README arch block certs crypto drivers fs include init ipc kernel lib mm net samples scripts security sound tools usr virt kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.