From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [axboe:rw_iter 424/471] kernel/sched/debug.c:141 sched_feat_write() warn: potential spectre issue 'buf' [w]
Date: Fri, 13 Mar 2026 15:23:41 +0800 [thread overview]
Message-ID: <202603131526.wBA9qa4z-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.git rw_iter
head: 0a49759be1c3b29207758e467fdc1a90d0716d06
commit: dee2a50905cf3505d706c0bdb2648900b643b4d3 [424/471] sched/debug: convert to read/write iterators
:::::: branch date: 7 days ago
:::::: commit date: 7 days ago
config: openrisc-randconfig-r071-20260307 (https://download.01.org/0day-ci/archive/20260313/202603131526.wBA9qa4z-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 15.2.0
smatch: v0.5.0-9004-gb810ac53
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/202603131526.wBA9qa4z-lkp@intel.com/
smatch warnings:
kernel/sched/debug.c:141 sched_feat_write() warn: potential spectre issue 'buf' [w]
vim +/buf +141 kernel/sched/debug.c
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 125)
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 126) static ssize_t
dee2a50905cf350 Jens Axboe 2026-03-04 127 sched_feat_write(struct kiocb *iocb, struct iov_iter *from)
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 128) {
dee2a50905cf350 Jens Axboe 2026-03-04 129 size_t cnt = iov_iter_count(from);
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 130) char buf[64];
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 131) char *cmp;
8f894bf47dc9e8b Yisheng Xie 2018-05-31 132 int ret;
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 133) struct inode *inode;
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 134)
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 135) if (cnt > 63)
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 136) cnt = 63;
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 137)
dee2a50905cf350 Jens Axboe 2026-03-04 138 if (!copy_from_iter_full(buf, cnt, from))
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 139) return -EFAULT;
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 140)
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 @141) buf[cnt] = 0;
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 142) cmp = strstrip(buf);
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 143)
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 144) /* Ensure the static_key remains in a consistent state */
dee2a50905cf350 Jens Axboe 2026-03-04 145 inode = file_inode(iocb->ki_filp);
e73e81975f2447e Jiada Wang 2018-07-31 146 cpus_read_lock();
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 147) inode_lock(inode);
8f894bf47dc9e8b Yisheng Xie 2018-05-31 148 ret = sched_feat_set(cmp);
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 149) inode_unlock(inode);
e73e81975f2447e Jiada Wang 2018-07-31 150 cpus_read_unlock();
8f894bf47dc9e8b Yisheng Xie 2018-05-31 151 if (ret < 0)
8f894bf47dc9e8b Yisheng Xie 2018-05-31 152 return ret;
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 153)
dee2a50905cf350 Jens Axboe 2026-03-04 154 iocb->ki_pos += cnt;
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 155)
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 156) return cnt;
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 157) }
d6ca41d7922ce01 Steven Rostedt (Red Hat 2016-02-22 158)
:::::: The code at line 141 was first introduced by commit
:::::: d6ca41d7922ce0110a840ef4f8ec4afdd5a239d3 sched/debug: Move the /sys/kernel/debug/sched_features file setup into debug.c
:::::: TO: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
:::::: CC: Ingo Molnar <mingo@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-03-13 7:24 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=202603131526.wBA9qa4z-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.