tracing: Do not set trace clock if tracefs lockdown is in effect
Subsystems (2)
PATCH 1/1 tracing: Do not set trace clock if tracefs lockdown is in effect
When trace_clock option is not set and unstable clcok detected, tracing_set_default_clock() sets trace_clock(ThinkPad A285 is one of case). In that case, if lockdown is in effect, null pointer dereference error happens in ring_buffer_set_clock().
--- kernel/trace/trace.c | 5 +++++ 1 file changed, 5 insertions(+)
kernel/trace/trace.c +5 -0
@@ -9420,6 +9420,11 @@ __init static int tracing_set_default_clock(void) {/* sched_clock_stable() is determined in late_initcall */ if (!trace_boot_clock && !sched_clock_stable ()) { +if (security_locked_down (LOCKDOWN_TRACEFS )) { +pr_warn ("Can not set tracing clock due to lockdown\n" ); +return -EPERM ; + } +printk (KERN_WARNING "Unstable clock detected, switching default tracing clock to \"global\"\n" "If you want to keep using the local clock, then add:\n"
Signature · 1 line
2.24.1
Greg KH
maintainerQuoted 10 lines · Masami Ichikawa
When
trace_clockoption is not set and unstable clcok detected,tracing_set_default_clock()setstrace_clock(ThinkPad A285 is one of case). In that case, if lockdown is in effect, null pointer dereference error happens inring_buffer_set_clock().Signed-off-by Masami Ichikawa <[email protected]>--- kernel/trace/trace.c | 5 +++++ 1 file changed, 5 insertions(+)
<formletter>
This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.
</formletter>
Quoted 14 lines · Greg KH
Quoted 10 lines · Masami Ichikawa
When
trace_clockoption is not set and unstable clcok detected,tracing_set_default_clock()setstrace_clock(ThinkPad A285 is one of case). In that case, if lockdown is in effect, null pointer dereference error happens inring_buffer_set_clock().Signed-off-by Masami Ichikawa <[email protected]>--- kernel/trace/trace.c | 5 +++++ 1 file changed, 5 insertions(+)
Quoted 8 lines
<formletter>
This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.</formletter>
Sorry, I'll resend patch without stable mailing list.
Signature · 1 line
Masami Ichikawa
PATCH 1/1 tracing: Do not set trace clock if tracefs lockdown is in effect
In reply to Masami IchikawaWhen trace_clock option is not set and unstable clcok detected, tracing_set_default_clock() sets trace_clock(ThinkPad A285 is one of case). In that case, if lockdown is in effect, null pointer dereference error happens in ring_buffer_set_clock().
--- kernel/trace/trace.c | 5 +++++ 1 file changed, 5 insertions(+)
kernel/trace/trace.c +5 -0
@@ -9420,6 +9420,11 @@ __init static int tracing_set_default_clock(void) {/* sched_clock_stable() is determined in late_initcall */ if (!trace_boot_clock && !sched_clock_stable ()) { +if (security_locked_down (LOCKDOWN_TRACEFS )) { +pr_warn ("Can not set tracing clock due to lockdown\n" ); +return -EPERM ; + } +printk (KERN_WARNING "Unstable clock detected, switching default tracing clock to \"global\"\n" "If you want to keep using the local clock, then add:\n"
Signature · 1 line
2.24.1