All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [axboe-block:rw_iter 331/438] arch/x86/kernel/cpu/resctrl/pseudo_lock.c:1261 pseudo_lock_measure_trigger() warn: potential spectre issue 'buf' [w]
Date: Fri, 12 Apr 2024 19:19:27 +0800	[thread overview]
Message-ID: <202404121902.YyIVlsC0-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Jens Axboe <axboe@kernel.dk>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git rw_iter
head:   8e79f6c3d0a118031e843758491803e38794f6e8
commit: b07f20689e1567c51174538eb7ddfc7b86170dd6 [331/438] x86/kernel: convert to read/write iterators
:::::: branch date: 16 hours ago
:::::: commit date: 19 hours ago
config: x86_64-randconfig-161-20240412 (https://download.01.org/0day-ci/archive/20240412/202404121902.YyIVlsC0-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202404121902.YyIVlsC0-lkp@intel.com/

smatch warnings:
arch/x86/kernel/cpu/resctrl/pseudo_lock.c:1261 pseudo_lock_measure_trigger() warn: potential spectre issue 'buf' [w]

vim +/buf +1261 arch/x86/kernel/cpu/resctrl/pseudo_lock.c

443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1246  
b07f20689e1567c arch/x86/kernel/cpu/resctrl/pseudo_lock.c   Jens Axboe      2024-04-11  1247  static ssize_t pseudo_lock_measure_trigger(struct kiocb *iocb,
b07f20689e1567c arch/x86/kernel/cpu/resctrl/pseudo_lock.c   Jens Axboe      2024-04-11  1248  					   struct iov_iter *from)
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1249  {
b07f20689e1567c arch/x86/kernel/cpu/resctrl/pseudo_lock.c   Jens Axboe      2024-04-11  1250  	struct rdtgroup *rdtgrp = iocb->ki_filp->private_data;
b07f20689e1567c arch/x86/kernel/cpu/resctrl/pseudo_lock.c   Jens Axboe      2024-04-11  1251  	size_t count = iov_iter_count(from);
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1252  	size_t buf_size;
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1253  	char buf[32];
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1254  	int ret;
8a2fc0e1bc0cd85 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1255  	int sel;
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1256  
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1257  	buf_size = min(count, (sizeof(buf) - 1));
b07f20689e1567c arch/x86/kernel/cpu/resctrl/pseudo_lock.c   Jens Axboe      2024-04-11  1258  	if (!copy_from_iter_full(buf, buf_size, from))
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1259  		return -EFAULT;
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1260  
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22 @1261  	buf[buf_size] = '\0';
8a2fc0e1bc0cd85 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1262  	ret = kstrtoint(buf, 10, &sel);
8a2fc0e1bc0cd85 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1263  	if (ret == 0) {
53ed74af05517cf arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-09-19  1264  		if (sel != 1 && sel != 2 && sel != 3)
8a2fc0e1bc0cd85 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1265  			return -EINVAL;
b07f20689e1567c arch/x86/kernel/cpu/resctrl/pseudo_lock.c   Jens Axboe      2024-04-11  1266  		ret = debugfs_file_get(iocb->ki_filp->f_path.dentry);
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1267  		if (ret)
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1268  			return ret;
8a2fc0e1bc0cd85 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1269  		ret = pseudo_lock_measure_cycles(rdtgrp, sel);
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1270  		if (ret == 0)
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1271  			ret = count;
b07f20689e1567c arch/x86/kernel/cpu/resctrl/pseudo_lock.c   Jens Axboe      2024-04-11  1272  		debugfs_file_put(iocb->ki_filp->f_path.dentry);
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1273  	}
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1274  
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1275  	return ret;
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1276  }
443810fe6160542 arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c Reinette Chatre 2018-06-22  1277  

:::::: The code at line 1261 was first introduced by commit
:::::: 443810fe6160542c78e24c66047edd7a3cc830c6 x86/intel_rdt: Create debugfs files for pseudo-locking testing

:::::: TO: Reinette Chatre <reinette.chatre@intel.com>
:::::: CC: Thomas Gleixner <tglx@linutronix.de>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2024-04-12 11:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202404121902.YyIVlsC0-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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.