diff options
| author | Kyle Zeng <kylebot@openai.com> | 2026-11-09 21:44:11 -0800 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2026-11-20 10:02:36 -0500 |
| commit | c62206dfe9c80490de8cc2d211fb28eea4958240 (patch) | |
| tree | 29793d3716cc16d43428914b8e7be76ac3aab0b7 /rust/kernel/alloc/kvec/errors.rs | |
| parent | 2b237dc23a3957a6b8413cf31b686a3e5d871367 (diff) | |
tracing: Validate user addresses in faultable buffer copies
trace_user_fault_read() uses __copy_from_user() when no custom copy
function is supplied. That primitive assumes the source address has
already been validated, but the helper only checks the destination
buffer size. A caller that passes an unchecked kernel address can
therefore cause mapped kernel memory to be copied into the tracing
buffer. The original syscall-array tracing implementation exposed this
path to syscall arguments before the syscall validated them.
Use copy_from_user() for the default copy as documented. Non-user
addresses then fail the copy and follow the existing NULL-return path.
Successful user copies, buffer bounds, and preemption and migration
retry rules are unchanged.
Cc: stable@vger.kernel.org
Fixes: 64cf7d058a005 ("tracing: Have trace_marker use per-cpu data to read user space")
Link: https://patch.msgid.link/20261110054411.75788-1-kylebot@openai.com
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions
