[nf:master 4/4] net//netfilter/nft_compat.c:852:28: error: assignment from incompatible pointer type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git master
head:   6b98ffc6b41b43ceb5f448af1de09c3e7a9ee826
commit: 6b98ffc6b41b43ceb5f448af1de09c3e7a9ee826 [4/4] netfilter: nf_tables: unbind set in rule from commit path
config: x86_64-rhel-7.2-clear (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout 6b98ffc6b41b43ceb5f448af1de09c3e7a9ee826
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   net//netfilter/nft_compat.c: In function 'nft_match_select_ops':
>> net//netfilter/nft_compat.c:852:28: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
     nft_match->ops.deactivate = nft_compat_deactivate;
                               ^
   net//netfilter/nft_compat.c: In function 'nft_target_select_ops':
   net//netfilter/nft_compat.c:957:29: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
     nft_target->ops.deactivate = nft_compat_deactivate;
                                ^
   cc1: some warnings being treated as errors

vim +852 net//netfilter/nft_compat.c

ba378ca9c0 Pablo Neira Ayuso 2015-09-14  798  
0ca743a559 Pablo Neira Ayuso 2013-10-14  799  static const struct nft_expr_ops *
0ca743a559 Pablo Neira Ayuso 2013-10-14  800  nft_match_select_ops(const struct nft_ctx *ctx,
0ca743a559 Pablo Neira Ayuso 2013-10-14  801  		     const struct nlattr * const tb[])
0ca743a559 Pablo Neira Ayuso 2013-10-14  802  {
cf52572ebb Florian Westphal  2019-01-14  803  	struct nft_compat_net *cn;
0ca743a559 Pablo Neira Ayuso 2013-10-14  804  	struct nft_xt *nft_match;
0ca743a559 Pablo Neira Ayuso 2013-10-14  805  	struct xt_match *match;
732a8049f3 Florian Westphal  2018-05-07  806  	unsigned int matchsize;
0ca743a559 Pablo Neira Ayuso 2013-10-14  807  	char *mt_name;
ba378ca9c0 Pablo Neira Ayuso 2015-09-14  808  	u32 rev, family;
2bf4fade54 Liping Zhang      2016-07-23  809  	int err;
0ca743a559 Pablo Neira Ayuso 2013-10-14  810  
0ca743a559 Pablo Neira Ayuso 2013-10-14  811  	if (tb[NFTA_MATCH_NAME] == NULL ||
0ca743a559 Pablo Neira Ayuso 2013-10-14  812  	    tb[NFTA_MATCH_REV] == NULL ||
0ca743a559 Pablo Neira Ayuso 2013-10-14  813  	    tb[NFTA_MATCH_INFO] == NULL)
0ca743a559 Pablo Neira Ayuso 2013-10-14  814  		return ERR_PTR(-EINVAL);
0ca743a559 Pablo Neira Ayuso 2013-10-14  815  
0ca743a559 Pablo Neira Ayuso 2013-10-14  816  	mt_name = nla_data(tb[NFTA_MATCH_NAME]);
0ca743a559 Pablo Neira Ayuso 2013-10-14  817  	rev = ntohl(nla_get_be32(tb[NFTA_MATCH_REV]));
36596dadf5 Pablo Neira Ayuso 2018-01-09  818  	family = ctx->family;
0ca743a559 Pablo Neira Ayuso 2013-10-14  819  
cf52572ebb Florian Westphal  2019-01-14  820  	cn = nft_compat_pernet(ctx->net);
cf52572ebb Florian Westphal  2019-01-14  821  
0ca743a559 Pablo Neira Ayuso 2013-10-14  822  	/* Re-use the existing match if it's already loaded. */
cf52572ebb Florian Westphal  2019-01-14  823  	list_for_each_entry(nft_match, &cn->nft_match_list, head) {
0ca743a559 Pablo Neira Ayuso 2013-10-14  824  		struct xt_match *match = nft_match->ops.data;
0ca743a559 Pablo Neira Ayuso 2013-10-14  825  
b8e9dc1c75 Florian Westphal  2018-05-02  826  		if (nft_match_cmp(match, mt_name, rev, family))
0ca743a559 Pablo Neira Ayuso 2013-10-14  827  			return &nft_match->ops;
0ca743a559 Pablo Neira Ayuso 2013-10-14  828  	}
0ca743a559 Pablo Neira Ayuso 2013-10-14  829  
0ca743a559 Pablo Neira Ayuso 2013-10-14  830  	match = xt_request_find_match(family, mt_name, rev);
0ca743a559 Pablo Neira Ayuso 2013-10-14  831  	if (IS_ERR(match))
0ca743a559 Pablo Neira Ayuso 2013-10-14  832  		return ERR_PTR(-ENOENT);
0ca743a559 Pablo Neira Ayuso 2013-10-14  833  
2bf4fade54 Liping Zhang      2016-07-23  834  	if (match->matchsize > nla_len(tb[NFTA_MATCH_INFO])) {
2bf4fade54 Liping Zhang      2016-07-23  835  		err = -EINVAL;
2bf4fade54 Liping Zhang      2016-07-23  836  		goto err;
2bf4fade54 Liping Zhang      2016-07-23  837  	}
f0716cd6eb Florian Westphal  2016-03-09  838  
0ca743a559 Pablo Neira Ayuso 2013-10-14  839  	/* This is the first time we use this match, allocate operations */
0ca743a559 Pablo Neira Ayuso 2013-10-14  840  	nft_match = kzalloc(sizeof(struct nft_xt), GFP_KERNEL);
2bf4fade54 Liping Zhang      2016-07-23  841  	if (nft_match == NULL) {
2bf4fade54 Liping Zhang      2016-07-23  842  		err = -ENOMEM;
2bf4fade54 Liping Zhang      2016-07-23  843  		goto err;
2bf4fade54 Liping Zhang      2016-07-23  844  	}
0ca743a559 Pablo Neira Ayuso 2013-10-14  845  
12c44aba66 Florian Westphal  2019-01-14  846  	refcount_set(&nft_match->refcnt, 0);
0ca743a559 Pablo Neira Ayuso 2013-10-14  847  	nft_match->ops.type = &nft_match_type;
0ca743a559 Pablo Neira Ayuso 2013-10-14  848  	nft_match->ops.eval = nft_match_eval;
0ca743a559 Pablo Neira Ayuso 2013-10-14  849  	nft_match->ops.init = nft_match_init;
0ca743a559 Pablo Neira Ayuso 2013-10-14  850  	nft_match->ops.destroy = nft_match_destroy;
b2e3d68d12 Florian Westphal  2019-01-14  851  	nft_match->ops.activate = nft_compat_activate_mt;
b2e3d68d12 Florian Westphal  2019-01-14 @852  	nft_match->ops.deactivate = nft_compat_deactivate;
0ca743a559 Pablo Neira Ayuso 2013-10-14  853  	nft_match->ops.dump = nft_match_dump;
0ca743a559 Pablo Neira Ayuso 2013-10-14  854  	nft_match->ops.validate = nft_match_validate;
0ca743a559 Pablo Neira Ayuso 2013-10-14  855  	nft_match->ops.data = match;
0ca743a559 Pablo Neira Ayuso 2013-10-14  856  
732a8049f3 Florian Westphal  2018-05-07  857  	matchsize = NFT_EXPR_SIZE(XT_ALIGN(match->matchsize));
732a8049f3 Florian Westphal  2018-05-07  858  	if (matchsize > NFT_MATCH_LARGE_THRESH) {
732a8049f3 Florian Westphal  2018-05-07  859  		matchsize = NFT_EXPR_SIZE(sizeof(struct nft_xt_match_priv));
732a8049f3 Florian Westphal  2018-05-07  860  
732a8049f3 Florian Westphal  2018-05-07  861  		nft_match->ops.eval = nft_match_large_eval;
732a8049f3 Florian Westphal  2018-05-07  862  		nft_match->ops.init = nft_match_large_init;
732a8049f3 Florian Westphal  2018-05-07  863  		nft_match->ops.destroy = nft_match_large_destroy;
732a8049f3 Florian Westphal  2018-05-07  864  		nft_match->ops.dump = nft_match_large_dump;
732a8049f3 Florian Westphal  2018-05-07  865  	}
732a8049f3 Florian Westphal  2018-05-07  866  
732a8049f3 Florian Westphal  2018-05-07  867  	nft_match->ops.size = matchsize;
732a8049f3 Florian Westphal  2018-05-07  868  
b2e3d68d12 Florian Westphal  2019-01-14  869  	nft_match->listcnt = 1;
cf52572ebb Florian Westphal  2019-01-14  870  	list_add(&nft_match->head, &cn->nft_match_list);
0ca743a559 Pablo Neira Ayuso 2013-10-14  871  
0ca743a559 Pablo Neira Ayuso 2013-10-14  872  	return &nft_match->ops;
2bf4fade54 Liping Zhang      2016-07-23  873  err:
2bf4fade54 Liping Zhang      2016-07-23  874  	module_put(match->me);
2bf4fade54 Liping Zhang      2016-07-23  875  	return ERR_PTR(err);
0ca743a559 Pablo Neira Ayuso 2013-10-14  876  }
0ca743a559 Pablo Neira Ayuso 2013-10-14  877  

:::::: The code at line 852 was first introduced by commit
:::::: b2e3d68d1251a051a620f9086e18f7ffa6833b5b netfilter: nft_compat: destroy function must not have side effects

:::::: TO: Florian Westphal <fw@xxxxxxxxx>
:::::: CC: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux