* [PATCH] tracing: Do not set trace clock if tracefs lockdown is in effect
@ 2020-01-16 9:47 Masami Ichikawa
2020-01-16 10:09 ` Greg KH
2020-01-16 13:12 ` Masami Ichikawa
0 siblings, 2 replies; 4+ messages in thread
From: Masami Ichikawa @ 2020-01-16 9:47 UTC (permalink / raw)
To: rostedt, mingo; +Cc: Masami Ichikawa, linux-kernel, stable
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().
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1788488
Signed-off-by: Masami Ichikawa <masami256@gmail.com>
---
kernel/trace/trace.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index ddb7e7f5fe8d..5b6ee4aadc26 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -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"
--
2.24.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] tracing: Do not set trace clock if tracefs lockdown is in effect
2020-01-16 9:47 [PATCH] tracing: Do not set trace clock if tracefs lockdown is in effect Masami Ichikawa
@ 2020-01-16 10:09 ` Greg KH
2020-01-16 13:06 ` Masami Ichikawa
2020-01-16 13:12 ` Masami Ichikawa
1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2020-01-16 10:09 UTC (permalink / raw)
To: Masami Ichikawa; +Cc: rostedt, mingo, linux-kernel, stable
On Thu, Jan 16, 2020 at 06:47:06PM +0900, Masami Ichikawa wrote:
> 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().
>
> Link: https://bugzilla.redhat.com/show_bug.cgi?id=1788488
> Signed-off-by: Masami Ichikawa <masami256@gmail.com>
> ---
> 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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tracing: Do not set trace clock if tracefs lockdown is in effect
2020-01-16 10:09 ` Greg KH
@ 2020-01-16 13:06 ` Masami Ichikawa
0 siblings, 0 replies; 4+ messages in thread
From: Masami Ichikawa @ 2020-01-16 13:06 UTC (permalink / raw)
To: Greg KH; +Cc: rostedt, mingo, LKML, stable
On Thu, Jan 16, 2020 at 7:09 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Thu, Jan 16, 2020 at 06:47:06PM +0900, Masami Ichikawa wrote:
> > 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().
> >
> > Link: https://bugzilla.redhat.com/show_bug.cgi?id=1788488
> > Signed-off-by: Masami Ichikawa <masami256@gmail.com>
> > ---
> > 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>
Sorry, I'll resend patch without stable mailing list.
--
Masami Ichikawa
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] tracing: Do not set trace clock if tracefs lockdown is in effect
2020-01-16 9:47 [PATCH] tracing: Do not set trace clock if tracefs lockdown is in effect Masami Ichikawa
2020-01-16 10:09 ` Greg KH
@ 2020-01-16 13:12 ` Masami Ichikawa
1 sibling, 0 replies; 4+ messages in thread
From: Masami Ichikawa @ 2020-01-16 13:12 UTC (permalink / raw)
To: rostedt, mingo; +Cc: Masami Ichikawa, linux-kernel
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().
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1788488
Signed-off-by: Masami Ichikawa <masami256@gmail.com>
---
kernel/trace/trace.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index ddb7e7f5fe8d..5b6ee4aadc26 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -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"
--
2.24.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-01-16 13:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16 9:47 [PATCH] tracing: Do not set trace clock if tracefs lockdown is in effect Masami Ichikawa
2020-01-16 10:09 ` Greg KH
2020-01-16 13:06 ` Masami Ichikawa
2020-01-16 13:12 ` Masami Ichikawa
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.