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 79/471] kernel/trace/trace_events_trigger.c:352 event_trigger_regex_write() warn: potential spectre issue 'buf' [w]
Date: Sun, 08 Mar 2026 03:36:52 +0800 [thread overview]
Message-ID: <202603080352.eQSp12OC-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: a6f509b8ee48800a6cc81a95554783bf4412a23a [79/471] tracing: convert to read/write iterators
:::::: branch date: 32 hours ago
:::::: commit date: 33 hours ago
config: i386-randconfig-141-20260307 (https://download.01.org/0day-ci/archive/20260308/202603080352.eQSp12OC-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.4.0-5) 12.4.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/202603080352.eQSp12OC-lkp@intel.com/
smatch warnings:
kernel/trace/trace_events_trigger.c:352 event_trigger_regex_write() warn: potential spectre issue 'buf' [w]
kernel/trace/trace_events.c:2246 event_filter_write() warn: potential spectre issue 'buf' [w]
kernel/trace/trace_events.c:2404 subsystem_filter_write() warn: potential spectre issue 'buf' [w]
kernel/trace/trace.c:4406 tracing_cpumask_write() warn: potential spectre issue 'buf' [w]
kernel/trace/trace.c:4686 tracing_trace_options_write() warn: potential spectre issue 'buf' [w]
kernel/trace/trace.c:5688 tracing_set_trace_write() warn: potential spectre issue 'buf' [w]
kernel/trace/trace.c:7076 tracing_clock_write() warn: potential spectre issue 'buf' [w]
vim +/buf +352 kernel/trace/trace_events_trigger.c
85f2b08268c014e Tom Zanussi 2013-10-24 331
a6f509b8ee48800 Jens Axboe 2024-04-08 332 static ssize_t event_trigger_regex_write(struct kiocb *iocb,
a6f509b8ee48800 Jens Axboe 2024-04-08 333 struct iov_iter *from)
85f2b08268c014e Tom Zanussi 2013-10-24 334 {
7f1d2f8210195c8 Steven Rostedt (Red Hat 2015-05-05 335) struct trace_event_file *event_file;
a6f509b8ee48800 Jens Axboe 2024-04-08 336 size_t cnt = iov_iter_count(from);
85f2b08268c014e Tom Zanussi 2013-10-24 337 ssize_t ret;
63c72641683891c Steven Rostedt 2024-12-20 338 char *buf __free(kfree) = NULL;
85f2b08268c014e Tom Zanussi 2013-10-24 339
85f2b08268c014e Tom Zanussi 2013-10-24 340 if (!cnt)
85f2b08268c014e Tom Zanussi 2013-10-24 341 return 0;
85f2b08268c014e Tom Zanussi 2013-10-24 342
85f2b08268c014e Tom Zanussi 2013-10-24 343 if (cnt >= PAGE_SIZE)
85f2b08268c014e Tom Zanussi 2013-10-24 344 return -EINVAL;
85f2b08268c014e Tom Zanussi 2013-10-24 345
a6f509b8ee48800 Jens Axboe 2024-04-08 346 buf = kmalloc(cnt + 1, GFP_KERNEL);
a6f509b8ee48800 Jens Axboe 2024-04-08 347 if (!buf)
a6f509b8ee48800 Jens Axboe 2024-04-08 348 return -ENOMEM;
a6f509b8ee48800 Jens Axboe 2024-04-08 349
a6f509b8ee48800 Jens Axboe 2024-04-08 350 if (!copy_from_iter_full(buf, cnt, from))
a6f509b8ee48800 Jens Axboe 2024-04-08 351 return -EFAULT;
a6f509b8ee48800 Jens Axboe 2024-04-08 @352 buf[cnt] = '\0';
85f2b08268c014e Tom Zanussi 2013-10-24 353
63c72641683891c Steven Rostedt 2024-12-20 354 guard(mutex)(&event_mutex);
63c72641683891c Steven Rostedt 2024-12-20 355
a6f509b8ee48800 Jens Axboe 2024-04-08 356 event_file = event_file_file(iocb->ki_filp);
63c72641683891c Steven Rostedt 2024-12-20 357 if (unlikely(!event_file))
85f2b08268c014e Tom Zanussi 2013-10-24 358 return -ENODEV;
85f2b08268c014e Tom Zanussi 2013-10-24 359
63c72641683891c Steven Rostedt 2024-12-20 360 ret = trigger_process_regex(event_file, buf);
85f2b08268c014e Tom Zanussi 2013-10-24 361 if (ret < 0)
63c72641683891c Steven Rostedt 2024-12-20 362 return ret;
85f2b08268c014e Tom Zanussi 2013-10-24 363
a6f509b8ee48800 Jens Axboe 2024-04-08 364 iocb->ki_pos += cnt;
63c72641683891c Steven Rostedt 2024-12-20 365 return cnt;
85f2b08268c014e Tom Zanussi 2013-10-24 366 }
85f2b08268c014e Tom Zanussi 2013-10-24 367
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-03-07 19:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-07 19:36 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-03-07 11:58 [axboe:rw_iter 79/471] kernel/trace/trace_events_trigger.c:352 event_trigger_regex_write() warn: potential spectre issue 'buf' [w] kernel test robot
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=202603080352.eQSp12OC-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.