All of lore.kernel.org
 help / color / mirror / Atom feed
* fs/nfs/dir.c:324 nfs_readdir_page_array_append() warn: potential spectre issue 'array->array' [r]
@ 2022-04-03 16:20 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-04-03 16:20 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Trond Myklebust <trond.myklebust@hammerspace.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   be2d3ecedd9911fbfd7e55cc9ceac5f8b79ae4cf
commit: 0adf85b445c7fbc5d2df1f8c1bc54d62c4340237 NFS: Optimise away the previous cookie field
date:   5 weeks ago
:::::: branch date: 20 hours ago
:::::: commit date: 5 weeks ago
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220404/202204040033.RYIj3Knx-lkp(a)intel.com/config)
compiler: gcc-11 (Debian 11.2.0-19) 11.2.0

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

smatch warnings:
fs/nfs/dir.c:324 nfs_readdir_page_array_append() warn: potential spectre issue 'array->array' [r]

vim +324 fs/nfs/dir.c

d1bacf9eb2fd0e Bryan Schumaker 2010-09-24  303  
0adf85b445c7fb Trond Myklebust 2022-02-27  304  static int nfs_readdir_page_array_append(struct page *page,
0adf85b445c7fb Trond Myklebust 2022-02-27  305  					 const struct nfs_entry *entry,
0adf85b445c7fb Trond Myklebust 2022-02-27  306  					 u64 *cookie)
d1bacf9eb2fd0e Bryan Schumaker 2010-09-24  307  {
a52a8a6adad99e Trond Myklebust 2020-11-01  308  	struct nfs_cache_array *array;
4a201d6e3f4253 Trond Myklebust 2010-10-23  309  	struct nfs_cache_array_entry *cache_entry;
a52a8a6adad99e Trond Myklebust 2020-11-01  310  	const char *name;
0adf85b445c7fb Trond Myklebust 2022-02-27  311  	int ret = -ENOMEM;
4a201d6e3f4253 Trond Myklebust 2010-10-23  312  
a52a8a6adad99e Trond Myklebust 2020-11-01  313  	name = nfs_readdir_copy_name(entry->name, entry->len);
3020093f578fb6 Trond Myklebust 2010-11-20  314  
a52a8a6adad99e Trond Myklebust 2020-11-01  315  	array = kmap_atomic(page);
0adf85b445c7fb Trond Myklebust 2022-02-27  316  	if (!name)
0adf85b445c7fb Trond Myklebust 2022-02-27  317  		goto out;
b1e21c97437f64 Trond Myklebust 2020-11-01  318  	ret = nfs_readdir_array_can_expand(array);
a52a8a6adad99e Trond Myklebust 2020-11-01  319  	if (ret) {
a52a8a6adad99e Trond Myklebust 2020-11-01  320  		kfree(name);
4a201d6e3f4253 Trond Myklebust 2010-10-23  321  		goto out;
a52a8a6adad99e Trond Myklebust 2020-11-01  322  	}
d1bacf9eb2fd0e Bryan Schumaker 2010-09-24  323  
b1e21c97437f64 Trond Myklebust 2020-11-01 @324  	cache_entry = &array->array[array->size];
0adf85b445c7fb Trond Myklebust 2022-02-27  325  	cache_entry->cookie = array->last_cookie;
4a201d6e3f4253 Trond Myklebust 2010-10-23  326  	cache_entry->ino = entry->ino;
0b26a0bf6ff398 Trond Myklebust 2010-11-20  327  	cache_entry->d_type = entry->d_type;
a52a8a6adad99e Trond Myklebust 2020-11-01  328  	cache_entry->name_len = entry->len;
a52a8a6adad99e Trond Myklebust 2020-11-01  329  	cache_entry->name = name;
d1bacf9eb2fd0e Bryan Schumaker 2010-09-24  330  	array->last_cookie = entry->cookie;
762567b7c798af Trond Myklebust 2020-11-04  331  	if (array->last_cookie <= cache_entry->cookie)
762567b7c798af Trond Myklebust 2020-11-04  332  		array->cookies_are_ordered = 0;
8cd51a0ccd1bed Trond Myklebust 2010-11-15  333  	array->size++;
47c716cbf638a1 Trond Myklebust 2010-12-07  334  	if (entry->eof != 0)
b1e21c97437f64 Trond Myklebust 2020-11-01  335  		nfs_readdir_array_set_eof(array);
4a201d6e3f4253 Trond Myklebust 2010-10-23  336  out:
0adf85b445c7fb Trond Myklebust 2022-02-27  337  	*cookie = array->last_cookie;
a52a8a6adad99e Trond Myklebust 2020-11-01  338  	kunmap_atomic(array);
4a201d6e3f4253 Trond Myklebust 2010-10-23  339  	return ret;
d1bacf9eb2fd0e Bryan Schumaker 2010-09-24  340  }
d1bacf9eb2fd0e Bryan Schumaker 2010-09-24  341  

:::::: The code at line 324 was first introduced by commit
:::::: b1e21c97437f64d0a00f8fea1f9e64e77e0e4242 NFS: Clean up readdir struct nfs_cache_array

:::::: TO: Trond Myklebust <trond.myklebust@hammerspace.com>
:::::: CC: Trond Myklebust <trond.myklebust@hammerspace.com>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

only message in thread, other threads:[~2022-04-03 16:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03 16:20 fs/nfs/dir.c:324 nfs_readdir_page_array_append() warn: potential spectre issue 'array->array' [r] 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.