Re: [PATCH nf 2/2] netfilter: nftables_offload: build mask based from the matching bytes

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

 



Hi Pablo,

I love your patch! Perhaps something to improve:

[auto build test WARNING on nf/master]

url:    https://github.com/0day-ci/linux/commits/Pablo-Neira-Ayuso/fixes-for-nftables-offload/20201104-205357
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git master
config: x86_64-randconfig-s021-20201104 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-76-gf680124b-dirty
        # https://github.com/0day-ci/linux/commit/b0df362f18e57b8bc4dc0fc8e3775a5fc349bee9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Pablo-Neira-Ayuso/fixes-for-nftables-offload/20201104-205357
        git checkout b0df362f18e57b8bc4dc0fc8e3775a5fc349bee9
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

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


"sparse warnings: (new ones prefixed by >>)"
>> net/netfilter/nft_payload.c:186:30: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int @@     got restricted __be32 [usertype] @@
>> net/netfilter/nft_payload.c:186:30: sparse:     expected unsigned int
>> net/netfilter/nft_payload.c:186:30: sparse:     got restricted __be32 [usertype]

vim +186 net/netfilter/nft_payload.c

   167	
   168	static bool nft_payload_offload_mask(struct nft_offload_reg *reg,
   169					     u32 priv_len, u32 field_len)
   170	{
   171		unsigned int remainder, delta, k;
   172		struct nft_data mask = {};
   173	
   174		if (priv_len == field_len) {
   175			memset(&reg->mask, 0xff, priv_len);
   176			return true;
   177		} else if (priv_len > field_len) {
   178			return false;
   179		}
   180	
   181		memset(&mask, 0xff, field_len);
   182		remainder = priv_len % sizeof(u32);
   183		if (remainder) {
   184			k = priv_len / sizeof(u32);
   185			delta = field_len - priv_len;
 > 186			mask.data[k] = htonl(~((1 << (delta * BITS_PER_BYTE)) - 1));
   187		}
   188	
   189		memcpy(&reg->mask, &mask, field_len);
   190	
   191		return true;
   192	}
   193	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux