All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH RFC v4 31/42] kmsan: hooks for copy_to_user() and friends
Date: Tue, 24 Dec 2019 12:50:11 +0800	[thread overview]
Message-ID: <201912241227.h2iNMa7T%lkp@intel.com> (raw)
In-Reply-To: <20191220184955.223741-32-glider@google.com>

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

Hi,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linus/master]
[also build test WARNING on v5.5-rc3]
[cannot apply to tip/x86/core tip/x86/mm efi/next next-20191220]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/glider-google-com/Add-KernelMemorySanitizer-infrastructure/20191224-024330
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 46cf053efec6a3a5f343fead837777efe8252a46
config: openrisc-simple_smp_defconfig (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=9.2.0 make.cross ARCH=openrisc 

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

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   net/core/sysctl_net_core.c: In function 'flow_limit_cpu_sysctl':
>> net/core/sysctl_net_core.c:183:6: warning: 'res' may be used uninitialized in this function [-Wmaybe-uninitialized]
     183 |   if (copy_to_user(buffer, kbuf, len)) {
         |      ^

vim +/res +183 net/core/sysctl_net_core.c

99bbc70741903c Willem de Bruijn 2013-05-20  116  
fe2c6338fd2c6f Joe Perches      2013-06-11  117  static int flow_limit_cpu_sysctl(struct ctl_table *table, int write,
99bbc70741903c Willem de Bruijn 2013-05-20  118  				 void __user *buffer, size_t *lenp,
99bbc70741903c Willem de Bruijn 2013-05-20  119  				 loff_t *ppos)
99bbc70741903c Willem de Bruijn 2013-05-20  120  {
99bbc70741903c Willem de Bruijn 2013-05-20  121  	struct sd_flow_limit *cur;
99bbc70741903c Willem de Bruijn 2013-05-20  122  	struct softnet_data *sd;
99bbc70741903c Willem de Bruijn 2013-05-20  123  	cpumask_var_t mask;
99bbc70741903c Willem de Bruijn 2013-05-20  124  	int i, len, ret = 0;
99bbc70741903c Willem de Bruijn 2013-05-20  125  
99bbc70741903c Willem de Bruijn 2013-05-20  126  	if (!alloc_cpumask_var(&mask, GFP_KERNEL))
99bbc70741903c Willem de Bruijn 2013-05-20  127  		return -ENOMEM;
99bbc70741903c Willem de Bruijn 2013-05-20  128  
99bbc70741903c Willem de Bruijn 2013-05-20  129  	if (write) {
99bbc70741903c Willem de Bruijn 2013-05-20  130  		ret = cpumask_parse_user(buffer, *lenp, mask);
99bbc70741903c Willem de Bruijn 2013-05-20  131  		if (ret)
99bbc70741903c Willem de Bruijn 2013-05-20  132  			goto done;
99bbc70741903c Willem de Bruijn 2013-05-20  133  
99bbc70741903c Willem de Bruijn 2013-05-20  134  		mutex_lock(&flow_limit_update_mutex);
99bbc70741903c Willem de Bruijn 2013-05-20  135  		len = sizeof(*cur) + netdev_flow_limit_table_len;
99bbc70741903c Willem de Bruijn 2013-05-20  136  		for_each_possible_cpu(i) {
99bbc70741903c Willem de Bruijn 2013-05-20  137  			sd = &per_cpu(softnet_data, i);
99bbc70741903c Willem de Bruijn 2013-05-20  138  			cur = rcu_dereference_protected(sd->flow_limit,
99bbc70741903c Willem de Bruijn 2013-05-20  139  				     lockdep_is_held(&flow_limit_update_mutex));
99bbc70741903c Willem de Bruijn 2013-05-20  140  			if (cur && !cpumask_test_cpu(i, mask)) {
99bbc70741903c Willem de Bruijn 2013-05-20  141  				RCU_INIT_POINTER(sd->flow_limit, NULL);
99bbc70741903c Willem de Bruijn 2013-05-20  142  				synchronize_rcu();
99bbc70741903c Willem de Bruijn 2013-05-20  143  				kfree(cur);
99bbc70741903c Willem de Bruijn 2013-05-20  144  			} else if (!cur && cpumask_test_cpu(i, mask)) {
5b59d467ad9ff9 Eric Dumazet     2013-12-18  145  				cur = kzalloc_node(len, GFP_KERNEL,
5b59d467ad9ff9 Eric Dumazet     2013-12-18  146  						   cpu_to_node(i));
99bbc70741903c Willem de Bruijn 2013-05-20  147  				if (!cur) {
99bbc70741903c Willem de Bruijn 2013-05-20  148  					/* not unwinding previous changes */
99bbc70741903c Willem de Bruijn 2013-05-20  149  					ret = -ENOMEM;
99bbc70741903c Willem de Bruijn 2013-05-20  150  					goto write_unlock;
99bbc70741903c Willem de Bruijn 2013-05-20  151  				}
99bbc70741903c Willem de Bruijn 2013-05-20  152  				cur->num_buckets = netdev_flow_limit_table_len;
99bbc70741903c Willem de Bruijn 2013-05-20  153  				rcu_assign_pointer(sd->flow_limit, cur);
99bbc70741903c Willem de Bruijn 2013-05-20  154  			}
99bbc70741903c Willem de Bruijn 2013-05-20  155  		}
99bbc70741903c Willem de Bruijn 2013-05-20  156  write_unlock:
99bbc70741903c Willem de Bruijn 2013-05-20  157  		mutex_unlock(&flow_limit_update_mutex);
99bbc70741903c Willem de Bruijn 2013-05-20  158  	} else {
5f121b9a83b499 Willem de Bruijn 2013-06-13  159  		char kbuf[128];
5f121b9a83b499 Willem de Bruijn 2013-06-13  160  
99bbc70741903c Willem de Bruijn 2013-05-20  161  		if (*ppos || !*lenp) {
99bbc70741903c Willem de Bruijn 2013-05-20  162  			*lenp = 0;
99bbc70741903c Willem de Bruijn 2013-05-20  163  			goto done;
99bbc70741903c Willem de Bruijn 2013-05-20  164  		}
99bbc70741903c Willem de Bruijn 2013-05-20  165  
99bbc70741903c Willem de Bruijn 2013-05-20  166  		cpumask_clear(mask);
99bbc70741903c Willem de Bruijn 2013-05-20  167  		rcu_read_lock();
99bbc70741903c Willem de Bruijn 2013-05-20  168  		for_each_possible_cpu(i) {
99bbc70741903c Willem de Bruijn 2013-05-20  169  			sd = &per_cpu(softnet_data, i);
99bbc70741903c Willem de Bruijn 2013-05-20  170  			if (rcu_dereference(sd->flow_limit))
99bbc70741903c Willem de Bruijn 2013-05-20  171  				cpumask_set_cpu(i, mask);
99bbc70741903c Willem de Bruijn 2013-05-20  172  		}
99bbc70741903c Willem de Bruijn 2013-05-20  173  		rcu_read_unlock();
99bbc70741903c Willem de Bruijn 2013-05-20  174  
5f121b9a83b499 Willem de Bruijn 2013-06-13  175  		len = min(sizeof(kbuf) - 1, *lenp);
f09068276c5cbe Tejun Heo        2015-02-13  176  		len = scnprintf(kbuf, len, "%*pb", cpumask_pr_args(mask));
5f121b9a83b499 Willem de Bruijn 2013-06-13  177  		if (!len) {
5f121b9a83b499 Willem de Bruijn 2013-06-13  178  			*lenp = 0;
5f121b9a83b499 Willem de Bruijn 2013-06-13  179  			goto done;
5f121b9a83b499 Willem de Bruijn 2013-06-13  180  		}
5f121b9a83b499 Willem de Bruijn 2013-06-13  181  		if (len < *lenp)
5f121b9a83b499 Willem de Bruijn 2013-06-13  182  			kbuf[len++] = '\n';
5f121b9a83b499 Willem de Bruijn 2013-06-13 @183  		if (copy_to_user(buffer, kbuf, len)) {
5f121b9a83b499 Willem de Bruijn 2013-06-13  184  			ret = -EFAULT;
5f121b9a83b499 Willem de Bruijn 2013-06-13  185  			goto done;
5f121b9a83b499 Willem de Bruijn 2013-06-13  186  		}
5f121b9a83b499 Willem de Bruijn 2013-06-13  187  		*lenp = len;
5f121b9a83b499 Willem de Bruijn 2013-06-13  188  		*ppos += len;
99bbc70741903c Willem de Bruijn 2013-05-20  189  	}
99bbc70741903c Willem de Bruijn 2013-05-20  190  
99bbc70741903c Willem de Bruijn 2013-05-20  191  done:
99bbc70741903c Willem de Bruijn 2013-05-20  192  	free_cpumask_var(mask);
99bbc70741903c Willem de Bruijn 2013-05-20  193  	return ret;
99bbc70741903c Willem de Bruijn 2013-05-20  194  }
99bbc70741903c Willem de Bruijn 2013-05-20  195  

:::::: The code@line 183 was first introduced by commit
:::::: 5f121b9a83b499a61ed44e5ba619c7de8f7271ad net-rps: fixes for rps flow limit

:::::: TO: Willem de Bruijn <willemb@google.com>
:::::: CC: David S. Miller <davem@davemloft.net>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

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

  reply	other threads:[~2019-12-24  4:50 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20 18:49 [PATCH RFC v4 00/42] Add KernelMemorySanitizer infrastructure glider
2019-12-20 18:49 ` [PATCH RFC v4 01/42] stackdepot: check depot_index before accessing the stack slab glider
2019-12-20 18:49 ` [PATCH RFC v4 02/42] stackdepot: build with -fno-builtin glider
2020-01-03 17:37   ` Steven Rostedt
2019-12-20 18:49 ` [PATCH RFC v4 03/42] kasan: stackdepot: move filter_irq_stacks() to stackdepot.c glider
2019-12-20 18:49 ` [PATCH RFC v4 04/42] stackdepot: reserve 5 extra bits in depot_stack_handle_t glider
2019-12-20 18:49 ` [PATCH RFC v4 05/42] kmsan: add ReST documentation glider
2019-12-20 18:49 ` [PATCH RFC v4 06/42] kmsan: gfp: introduce __GFP_NO_KMSAN_SHADOW glider
2019-12-20 18:49 ` [PATCH RFC v4 07/42] kmsan: introduce __no_sanitize_memory and __SANITIZE_MEMORY__ glider
2019-12-20 18:49 ` [PATCH RFC v4 08/42] kmsan: reduce vmalloc space glider
2019-12-20 18:49 ` [PATCH RFC v4 09/42] kmsan: add KMSAN runtime core glider
2019-12-20 18:49 ` [PATCH RFC v4 10/42] kmsan: KMSAN compiler API implementation glider
2019-12-20 18:49 ` [PATCH RFC v4 11/42] kmsan: add KMSAN hooks for kernel subsystems glider
2019-12-20 18:49 ` [PATCH RFC v4 12/42] kmsan: stackdepot: don't allocate KMSAN metadata for stackdepot glider
2019-12-20 18:49 ` [PATCH RFC v4 13/42] kmsan: define READ_ONCE_NOCHECK() glider
2019-12-20 18:49 ` [PATCH RFC v4 14/42] kmsan: make READ_ONCE_TASK_STACK() return initialized values glider
2019-12-20 18:49 ` [PATCH RFC v4 15/42] kmsan: x86: sync metadata pages on page fault glider
2019-12-20 18:49 ` [PATCH RFC v4 16/42] kmsan: add tests for KMSAN glider
2019-12-20 18:49 ` [PATCH RFC v4 17/42] crypto: kmsan: disable accelerated configs under KMSAN glider
2019-12-20 19:44   ` Eric Biggers
2020-01-09 14:56     ` Alexander Potapenko
2019-12-20 18:49 ` [PATCH RFC v4 18/42] kmsan: x86: disable UNWINDER_ORC " glider
2019-12-20 18:49 ` [PATCH RFC v4 19/42] kmsan: x86/asm: softirq: add KMSAN IRQ entry hooks glider
2019-12-23 19:58   ` kbuild test robot
2019-12-24 14:38   ` kbuild test robot
2019-12-20 18:49 ` [PATCH RFC v4 20/42] kmsan: x86: increase stack sizes in KMSAN builds glider
2019-12-30 17:39   ` Arnd Bergmann
2020-01-08 15:31     ` Alexander Potapenko
2019-12-20 18:49 ` [PATCH RFC v4 21/42] kmsan: disable KMSAN instrumentation for certain kernel parts glider
2019-12-20 18:49 ` [PATCH RFC v4 22/42] kmsan: mm: call KMSAN hooks from SLUB code glider
2019-12-20 18:49 ` [PATCH RFC v4 23/42] kmsan: mm: maintain KMSAN metadata for page operations glider
2019-12-20 18:49 ` [PATCH RFC v4 24/42] kmsan: handle memory sent to/from USB glider
2019-12-20 18:49 ` [PATCH RFC v4 25/42] kmsan: handle task creation and exiting glider
2019-12-20 18:49 ` [PATCH RFC v4 26/42] kmsan: net: check the value of skb before sending it to the network glider
2019-12-20 18:49 ` [PATCH RFC v4 27/42] kmsan: printk: treat the result of vscnprintf() as initialized glider
2019-12-20 18:49 ` [PATCH RFC v4 28/42] kmsan: disable instrumentation of certain functions glider
2019-12-20 18:49 ` [PATCH RFC v4 29/42] kmsan: unpoison |tlb| in arch_tlb_gather_mmu() glider
2019-12-20 18:49 ` [PATCH RFC v4 30/42] kmsan: use __msan_ string functions where possible glider
2019-12-20 18:49 ` [PATCH RFC v4 31/42] kmsan: hooks for copy_to_user() and friends glider
2019-12-24  4:50   ` kbuild test robot [this message]
2019-12-24  4:50   ` kbuild test robot
2019-12-20 18:49 ` [PATCH RFC v4 32/42] kmsan: init: call KMSAN initialization routines glider
2019-12-20 18:49 ` [PATCH RFC v4 33/42] kmsan: enable KMSAN builds glider
2019-12-20 18:49 ` [PATCH RFC v4 34/42] kmsan: handle /dev/[u]random glider
2019-12-20 18:49 ` [PATCH RFC v4 35/42] kmsan: virtio: check/unpoison scatterlist in vring_map_one_sg() glider
2019-12-20 18:49 ` [PATCH RFC v4 36/42] kmsan: disable strscpy() optimization under KMSAN glider
2019-12-20 18:49 ` [PATCH RFC v4 37/42] kmsan: add iomap support glider
2019-12-20 18:49 ` [PATCH RFC v4 38/42] kmsan: dma: unpoison memory mapped by dma_direct_map_page() glider
2019-12-20 18:49 ` [PATCH RFC v4 39/42] kmsan: disable physical page merging in biovec glider
2019-12-20 18:49 ` [PATCH RFC v4 40/42] kmsan: ext4: skip block merging logic in ext4_mpage_readpages for KMSAN glider
2019-12-20 19:18   ` Eric Biggers
2020-01-08 16:14     ` Alexander Potapenko
2019-12-20 18:49 ` [PATCH RFC v4 41/42] x86: kasan: kmsan: support CONFIG_GENERIC_CSUM on x86, enable it for KASAN/KMSAN glider
2019-12-20 18:49 ` [PATCH RFC v4 42/42] kmsan: x86/uprobes: unpoison regs in arch_uprobe_exception_notify() glider
2019-12-23  7:51 ` [PATCH RFC v4 00/42] Add KernelMemorySanitizer infrastructure Leon Romanovsky
2020-01-09 14:38   ` Alexander Potapenko
2020-01-09 16:29     ` Thomas Gleixner
2020-03-25 11:04       ` Alexander Potapenko

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=201912241227.h2iNMa7T%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.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.