projects/linux·commit 2c2b3d90

Merge tag 'trace-v6.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

2c2b3d90 · Linus Torvalds <[email protected]> · 2024-12-27 10:33:21 -08:00

Pull tracing fixes from Steven Rostedt:
 "Two minor tracing fixes:

   - Add "const" to "char *" in event structure field that gets assigned
     literals.

   - Check size of input passed into the tracing cpumask file.

     If a too large of an input gets passed into the cpumask file, it
     could trigger a warning in the bitmask parsing code"

* tag 'trace-v6.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  tracing: Prevent bad count for tracing_cpumask_write
  tracing: Constify string literal data member in struct trace_event_call
Commit
2c2b3d906c88a40b75f8d258119400a047e587de
Parents
d6ef8b40 · 98feccbf

Merge commit. Changes below are compared with the first parent: d6ef8b40.

Changes

2 files changed · +4 −1

FileStatusAddDelContent
include/linux/trace_events.hmodified+1−1View file
kernel/trace/trace.cmodified+3−0View file

include/linux/trace_events.h

View file
diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
index 91b8ffb..58ad4ea 100644
--- a/include/linux/trace_events.h
+++ b/include/linux/trace_events.h
@@ -364,7 +364,7 @@ struct trace_event_call {
struct list_head list;
struct trace_event_class *class;
union {
- char *name;
+ const char *name;
/* Set TRACE_EVENT_FL_TRACEPOINT flag when using "tp" */
struct tracepoint *tp;
};

kernel/trace/trace.c

View file
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 957f941..f8aebcb 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -5087,6 +5087,9 @@ tracing_cpumask_write(struct file *filp, const char __user *ubuf,
cpumask_var_t tracing_cpumask_new;
int err;
+ if (count == 0 || count > KMALLOC_MAX_SIZE)
+ return -EINVAL;
+
if (!zalloc_cpumask_var(&tracing_cpumask_new, GFP_KERNEL))
return -ENOMEM;