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 118/415] drivers/hid/hid-picolcd_debugfs.c:49 picolcd_debug_reset_write() warn: potential spectre issue 'buf' [w] (local cap)
Date: Fri, 12 Apr 2024 06:41:38 +0800	[thread overview]
Message-ID: <202404120631.XwkeGYur-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: 63f49fb8afefcadfed5b557296f8f7345a772633 [118/415] drivers/hid: convert to read/write iterators
:::::: branch date: 4 hours ago
:::::: commit date: 22 hours ago
config: x86_64-randconfig-161-20240411 (https://download.01.org/0day-ci/archive/20240412/202404120631.XwkeGYur-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/202404120631.XwkeGYur-lkp@intel.com/

smatch warnings:
drivers/hid/hid-picolcd_debugfs.c:49 picolcd_debug_reset_write() warn: potential spectre issue 'buf' [w] (local cap)

vim +/buf +49 drivers/hid/hid-picolcd_debugfs.c

fabdbf2fd22fa1 Bruno Prémont 2012-07-30  36  
63f49fb8afefca Jens Axboe    2024-04-05  37  static ssize_t picolcd_debug_reset_write(struct kiocb *iocb,
63f49fb8afefca Jens Axboe    2024-04-05  38  					 struct iov_iter *from)
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  39  {
63f49fb8afefca Jens Axboe    2024-04-05  40  	struct picolcd_data *data = ((struct seq_file *)iocb->ki_filp->private_data)->private;
63f49fb8afefca Jens Axboe    2024-04-05  41  	size_t count = iov_iter_count(from);
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  42  	char buf[32];
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  43  	size_t cnt = min(count, sizeof(buf)-1);
63f49fb8afefca Jens Axboe    2024-04-05  44  	if (!copy_from_iter_full(buf, cnt, from))
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  45  		return -EFAULT;
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  46  
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  47  	while (cnt > 0 && (buf[cnt-1] == ' ' || buf[cnt-1] == '\n'))
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  48  		cnt--;
fabdbf2fd22fa1 Bruno Prémont 2012-07-30 @49  	buf[cnt] = '\0';
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  50  	if (strcmp(buf, "all") == 0) {
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  51  		picolcd_reset(data->hdev);
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  52  		picolcd_fb_reset(data, 1);
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  53  	} else if (strcmp(buf, "fb") == 0) {
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  54  		picolcd_fb_reset(data, 1);
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  55  	} else {
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  56  		return -EINVAL;
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  57  	}
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  58  	return count;
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  59  }
fabdbf2fd22fa1 Bruno Prémont 2012-07-30  60  

:::::: The code at line 49 was first introduced by commit
:::::: fabdbf2fd22fa170b4c5340dbdda5c8cd88fb205 HID: picoLCD: split driver code

:::::: TO: Bruno Prémont <bonbons@linux-vserver.org>
:::::: CC: Jiri Kosina <jkosina@suse.cz>

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

                 reply	other threads:[~2024-04-11 22:41 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=202404120631.XwkeGYur-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.