All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>,
	will@kernel.org, pablo@netfilter.org, stranche@codeaurora.org,
	netfilter-devel@vger.kernel.org, tglx@linutronix.de,
	fw@strlen.de, peterz@infradead.org
Cc: kbuild-all@lists.01.org,
	Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Subject: Re: [PATCH nf] netfilter: x_tables: Switch synchronization to RCU
Date: Wed, 25 Nov 2020 11:40:10 +0800	[thread overview]
Message-ID: <202011251112.EMlfNssQ-lkp@intel.com> (raw)
In-Reply-To: <1606072636-23555-1-git-send-email-subashab@codeaurora.org>

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

Hi Subash,

I love your patch! Perhaps something to improve:

[auto build test WARNING on nf/master]

url:    https://github.com/0day-ci/linux/commits/Subash-Abhinov-Kasiviswanathan/netfilter-x_tables-Switch-synchronization-to-RCU/20201123-032122
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git master
config: i386-randconfig-s002-20201125 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/2d87a7da9e77a1c31af435d23238e60d0067aac0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Subash-Abhinov-Kasiviswanathan/netfilter-x_tables-Switch-synchronization-to-RCU/20201123-032122
        git checkout 2d87a7da9e77a1c31af435d23238e60d0067aac0
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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/ipv4/netfilter/arp_tables.c:810:56: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct xt_table_info const *private @@     got struct xt_table_info [noderef] __rcu *private @@
>> net/ipv4/netfilter/arp_tables.c:810:56: sparse:     expected struct xt_table_info const *private
>> net/ipv4/netfilter/arp_tables.c:810:56: sparse:     got struct xt_table_info [noderef] __rcu *private
   net/ipv4/netfilter/arp_tables.c:863:56: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct xt_table_info const *private @@     got struct xt_table_info [noderef] __rcu *private @@
   net/ipv4/netfilter/arp_tables.c:863:56: sparse:     expected struct xt_table_info const *private
   net/ipv4/netfilter/arp_tables.c:863:56: sparse:     got struct xt_table_info [noderef] __rcu *private
>> net/ipv4/netfilter/arp_tables.c:1020:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct xt_table_info const *private @@     got struct xt_table_info [noderef] __rcu *private @@
   net/ipv4/netfilter/arp_tables.c:1020:17: sparse:     expected struct xt_table_info const *private
   net/ipv4/netfilter/arp_tables.c:1020:17: sparse:     got struct xt_table_info [noderef] __rcu *private
   net/ipv4/netfilter/arp_tables.c:40:16: sparse: sparse: Initializer entry defined twice
   net/ipv4/netfilter/arp_tables.c:40:16: sparse:   also defined here
   net/ipv4/netfilter/arp_tables.c:40:16: sparse: sparse: Initializer entry defined twice
   net/ipv4/netfilter/arp_tables.c:40:16: sparse:   also defined here

vim +810 net/ipv4/netfilter/arp_tables.c

d6a2ba07c31b049 Patrick McHardy   2007-12-17  789  
983094b4fc2d6a0 Christoph Hellwig 2020-07-17  790  static int get_info(struct net *net, void __user *user, const int *len)
41acd975b954ad6 Patrick McHardy   2007-12-17  791  {
12b00c2c025b8af Jan Engelhardt    2010-10-13  792  	char name[XT_TABLE_MAXNAMELEN];
4abff0775d5e4fe Jan Engelhardt    2008-04-14  793  	struct xt_table *t;
41acd975b954ad6 Patrick McHardy   2007-12-17  794  	int ret;
41acd975b954ad6 Patrick McHardy   2007-12-17  795  
d7cdf81657776ca Pablo Neira Ayuso 2016-05-03  796  	if (*len != sizeof(struct arpt_getinfo))
41acd975b954ad6 Patrick McHardy   2007-12-17  797  		return -EINVAL;
41acd975b954ad6 Patrick McHardy   2007-12-17  798  
41acd975b954ad6 Patrick McHardy   2007-12-17  799  	if (copy_from_user(name, user, sizeof(name)) != 0)
41acd975b954ad6 Patrick McHardy   2007-12-17  800  		return -EFAULT;
41acd975b954ad6 Patrick McHardy   2007-12-17  801  
12b00c2c025b8af Jan Engelhardt    2010-10-13  802  	name[XT_TABLE_MAXNAMELEN-1] = '\0';
d6a2ba07c31b049 Patrick McHardy   2007-12-17  803  #ifdef CONFIG_COMPAT
983094b4fc2d6a0 Christoph Hellwig 2020-07-17  804  	if (in_compat_syscall())
ee999d8b9573df1 Jan Engelhardt    2008-10-08  805  		xt_compat_lock(NFPROTO_ARP);
d6a2ba07c31b049 Patrick McHardy   2007-12-17  806  #endif
03d13b6868a261f Florian Westphal  2017-12-08  807  	t = xt_request_find_table_lock(net, NFPROTO_ARP, name);
03d13b6868a261f Florian Westphal  2017-12-08  808  	if (!IS_ERR(t)) {
41acd975b954ad6 Patrick McHardy   2007-12-17  809  		struct arpt_getinfo info;
5452e425adfdfc4 Jan Engelhardt    2008-04-14 @810  		const struct xt_table_info *private = t->private;
d6a2ba07c31b049 Patrick McHardy   2007-12-17  811  #ifdef CONFIG_COMPAT
d6a2ba07c31b049 Patrick McHardy   2007-12-17  812  		struct xt_table_info tmp;
14c7dbe043d01a8 Alexey Dobriyan   2010-02-08  813  
983094b4fc2d6a0 Christoph Hellwig 2020-07-17  814  		if (in_compat_syscall()) {
d6a2ba07c31b049 Patrick McHardy   2007-12-17  815  			ret = compat_table_info(private, &tmp);
ee999d8b9573df1 Jan Engelhardt    2008-10-08  816  			xt_compat_flush_offsets(NFPROTO_ARP);
d6a2ba07c31b049 Patrick McHardy   2007-12-17  817  			private = &tmp;
d6a2ba07c31b049 Patrick McHardy   2007-12-17  818  		}
d6a2ba07c31b049 Patrick McHardy   2007-12-17  819  #endif
1a8b7a67224eb0c Vasiliy Kulikov   2010-11-03  820  		memset(&info, 0, sizeof(info));
41acd975b954ad6 Patrick McHardy   2007-12-17  821  		info.valid_hooks = t->valid_hooks;
41acd975b954ad6 Patrick McHardy   2007-12-17  822  		memcpy(info.hook_entry, private->hook_entry,
41acd975b954ad6 Patrick McHardy   2007-12-17  823  		       sizeof(info.hook_entry));
41acd975b954ad6 Patrick McHardy   2007-12-17  824  		memcpy(info.underflow, private->underflow,
41acd975b954ad6 Patrick McHardy   2007-12-17  825  		       sizeof(info.underflow));
41acd975b954ad6 Patrick McHardy   2007-12-17  826  		info.num_entries = private->number;
41acd975b954ad6 Patrick McHardy   2007-12-17  827  		info.size = private->size;
41acd975b954ad6 Patrick McHardy   2007-12-17  828  		strcpy(info.name, name);
41acd975b954ad6 Patrick McHardy   2007-12-17  829  
41acd975b954ad6 Patrick McHardy   2007-12-17  830  		if (copy_to_user(user, &info, *len) != 0)
41acd975b954ad6 Patrick McHardy   2007-12-17  831  			ret = -EFAULT;
41acd975b954ad6 Patrick McHardy   2007-12-17  832  		else
41acd975b954ad6 Patrick McHardy   2007-12-17  833  			ret = 0;
41acd975b954ad6 Patrick McHardy   2007-12-17  834  		xt_table_unlock(t);
41acd975b954ad6 Patrick McHardy   2007-12-17  835  		module_put(t->me);
41acd975b954ad6 Patrick McHardy   2007-12-17  836  	} else
03d13b6868a261f Florian Westphal  2017-12-08  837  		ret = PTR_ERR(t);
d6a2ba07c31b049 Patrick McHardy   2007-12-17  838  #ifdef CONFIG_COMPAT
983094b4fc2d6a0 Christoph Hellwig 2020-07-17  839  	if (in_compat_syscall())
ee999d8b9573df1 Jan Engelhardt    2008-10-08  840  		xt_compat_unlock(NFPROTO_ARP);
d6a2ba07c31b049 Patrick McHardy   2007-12-17  841  #endif
41acd975b954ad6 Patrick McHardy   2007-12-17  842  	return ret;
41acd975b954ad6 Patrick McHardy   2007-12-17  843  }
41acd975b954ad6 Patrick McHardy   2007-12-17  844  

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

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH nf] netfilter: x_tables: Switch synchronization to RCU
Date: Wed, 25 Nov 2020 11:40:10 +0800	[thread overview]
Message-ID: <202011251112.EMlfNssQ-lkp@intel.com> (raw)
In-Reply-To: <1606072636-23555-1-git-send-email-subashab@codeaurora.org>

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

Hi Subash,

I love your patch! Perhaps something to improve:

[auto build test WARNING on nf/master]

url:    https://github.com/0day-ci/linux/commits/Subash-Abhinov-Kasiviswanathan/netfilter-x_tables-Switch-synchronization-to-RCU/20201123-032122
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git master
config: i386-randconfig-s002-20201125 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-151-g540c2c4b-dirty
        # https://github.com/0day-ci/linux/commit/2d87a7da9e77a1c31af435d23238e60d0067aac0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Subash-Abhinov-Kasiviswanathan/netfilter-x_tables-Switch-synchronization-to-RCU/20201123-032122
        git checkout 2d87a7da9e77a1c31af435d23238e60d0067aac0
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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/ipv4/netfilter/arp_tables.c:810:56: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct xt_table_info const *private @@     got struct xt_table_info [noderef] __rcu *private @@
>> net/ipv4/netfilter/arp_tables.c:810:56: sparse:     expected struct xt_table_info const *private
>> net/ipv4/netfilter/arp_tables.c:810:56: sparse:     got struct xt_table_info [noderef] __rcu *private
   net/ipv4/netfilter/arp_tables.c:863:56: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct xt_table_info const *private @@     got struct xt_table_info [noderef] __rcu *private @@
   net/ipv4/netfilter/arp_tables.c:863:56: sparse:     expected struct xt_table_info const *private
   net/ipv4/netfilter/arp_tables.c:863:56: sparse:     got struct xt_table_info [noderef] __rcu *private
>> net/ipv4/netfilter/arp_tables.c:1020:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct xt_table_info const *private @@     got struct xt_table_info [noderef] __rcu *private @@
   net/ipv4/netfilter/arp_tables.c:1020:17: sparse:     expected struct xt_table_info const *private
   net/ipv4/netfilter/arp_tables.c:1020:17: sparse:     got struct xt_table_info [noderef] __rcu *private
   net/ipv4/netfilter/arp_tables.c:40:16: sparse: sparse: Initializer entry defined twice
   net/ipv4/netfilter/arp_tables.c:40:16: sparse:   also defined here
   net/ipv4/netfilter/arp_tables.c:40:16: sparse: sparse: Initializer entry defined twice
   net/ipv4/netfilter/arp_tables.c:40:16: sparse:   also defined here

vim +810 net/ipv4/netfilter/arp_tables.c

d6a2ba07c31b049 Patrick McHardy   2007-12-17  789  
983094b4fc2d6a0 Christoph Hellwig 2020-07-17  790  static int get_info(struct net *net, void __user *user, const int *len)
41acd975b954ad6 Patrick McHardy   2007-12-17  791  {
12b00c2c025b8af Jan Engelhardt    2010-10-13  792  	char name[XT_TABLE_MAXNAMELEN];
4abff0775d5e4fe Jan Engelhardt    2008-04-14  793  	struct xt_table *t;
41acd975b954ad6 Patrick McHardy   2007-12-17  794  	int ret;
41acd975b954ad6 Patrick McHardy   2007-12-17  795  
d7cdf81657776ca Pablo Neira Ayuso 2016-05-03  796  	if (*len != sizeof(struct arpt_getinfo))
41acd975b954ad6 Patrick McHardy   2007-12-17  797  		return -EINVAL;
41acd975b954ad6 Patrick McHardy   2007-12-17  798  
41acd975b954ad6 Patrick McHardy   2007-12-17  799  	if (copy_from_user(name, user, sizeof(name)) != 0)
41acd975b954ad6 Patrick McHardy   2007-12-17  800  		return -EFAULT;
41acd975b954ad6 Patrick McHardy   2007-12-17  801  
12b00c2c025b8af Jan Engelhardt    2010-10-13  802  	name[XT_TABLE_MAXNAMELEN-1] = '\0';
d6a2ba07c31b049 Patrick McHardy   2007-12-17  803  #ifdef CONFIG_COMPAT
983094b4fc2d6a0 Christoph Hellwig 2020-07-17  804  	if (in_compat_syscall())
ee999d8b9573df1 Jan Engelhardt    2008-10-08  805  		xt_compat_lock(NFPROTO_ARP);
d6a2ba07c31b049 Patrick McHardy   2007-12-17  806  #endif
03d13b6868a261f Florian Westphal  2017-12-08  807  	t = xt_request_find_table_lock(net, NFPROTO_ARP, name);
03d13b6868a261f Florian Westphal  2017-12-08  808  	if (!IS_ERR(t)) {
41acd975b954ad6 Patrick McHardy   2007-12-17  809  		struct arpt_getinfo info;
5452e425adfdfc4 Jan Engelhardt    2008-04-14 @810  		const struct xt_table_info *private = t->private;
d6a2ba07c31b049 Patrick McHardy   2007-12-17  811  #ifdef CONFIG_COMPAT
d6a2ba07c31b049 Patrick McHardy   2007-12-17  812  		struct xt_table_info tmp;
14c7dbe043d01a8 Alexey Dobriyan   2010-02-08  813  
983094b4fc2d6a0 Christoph Hellwig 2020-07-17  814  		if (in_compat_syscall()) {
d6a2ba07c31b049 Patrick McHardy   2007-12-17  815  			ret = compat_table_info(private, &tmp);
ee999d8b9573df1 Jan Engelhardt    2008-10-08  816  			xt_compat_flush_offsets(NFPROTO_ARP);
d6a2ba07c31b049 Patrick McHardy   2007-12-17  817  			private = &tmp;
d6a2ba07c31b049 Patrick McHardy   2007-12-17  818  		}
d6a2ba07c31b049 Patrick McHardy   2007-12-17  819  #endif
1a8b7a67224eb0c Vasiliy Kulikov   2010-11-03  820  		memset(&info, 0, sizeof(info));
41acd975b954ad6 Patrick McHardy   2007-12-17  821  		info.valid_hooks = t->valid_hooks;
41acd975b954ad6 Patrick McHardy   2007-12-17  822  		memcpy(info.hook_entry, private->hook_entry,
41acd975b954ad6 Patrick McHardy   2007-12-17  823  		       sizeof(info.hook_entry));
41acd975b954ad6 Patrick McHardy   2007-12-17  824  		memcpy(info.underflow, private->underflow,
41acd975b954ad6 Patrick McHardy   2007-12-17  825  		       sizeof(info.underflow));
41acd975b954ad6 Patrick McHardy   2007-12-17  826  		info.num_entries = private->number;
41acd975b954ad6 Patrick McHardy   2007-12-17  827  		info.size = private->size;
41acd975b954ad6 Patrick McHardy   2007-12-17  828  		strcpy(info.name, name);
41acd975b954ad6 Patrick McHardy   2007-12-17  829  
41acd975b954ad6 Patrick McHardy   2007-12-17  830  		if (copy_to_user(user, &info, *len) != 0)
41acd975b954ad6 Patrick McHardy   2007-12-17  831  			ret = -EFAULT;
41acd975b954ad6 Patrick McHardy   2007-12-17  832  		else
41acd975b954ad6 Patrick McHardy   2007-12-17  833  			ret = 0;
41acd975b954ad6 Patrick McHardy   2007-12-17  834  		xt_table_unlock(t);
41acd975b954ad6 Patrick McHardy   2007-12-17  835  		module_put(t->me);
41acd975b954ad6 Patrick McHardy   2007-12-17  836  	} else
03d13b6868a261f Florian Westphal  2017-12-08  837  		ret = PTR_ERR(t);
d6a2ba07c31b049 Patrick McHardy   2007-12-17  838  #ifdef CONFIG_COMPAT
983094b4fc2d6a0 Christoph Hellwig 2020-07-17  839  	if (in_compat_syscall())
ee999d8b9573df1 Jan Engelhardt    2008-10-08  840  		xt_compat_unlock(NFPROTO_ARP);
d6a2ba07c31b049 Patrick McHardy   2007-12-17  841  #endif
41acd975b954ad6 Patrick McHardy   2007-12-17  842  	return ret;
41acd975b954ad6 Patrick McHardy   2007-12-17  843  }
41acd975b954ad6 Patrick McHardy   2007-12-17  844  

---
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: 40421 bytes --]

  parent reply	other threads:[~2020-11-25  3:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-22 19:17 [PATCH nf] netfilter: x_tables: Switch synchronization to RCU Subash Abhinov Kasiviswanathan
2020-11-22 19:35 ` Florian Westphal
2020-11-22 19:55   ` subashab
2020-11-25  6:25     ` subashab
2020-11-22 20:58 ` kernel test robot
2020-11-22 20:58   ` kernel test robot
2020-11-25  3:40 ` kernel test robot [this message]
2020-11-25  3:40   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202011251112.EMlfNssQ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=fw@strlen.de \
    --cc=kbuild-all@lists.01.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=peterz@infradead.org \
    --cc=stranche@codeaurora.org \
    --cc=subashab@codeaurora.org \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.