linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tracing: dynevent: Add a missing lockdown check on dynevent
@ 2025-09-19  1:15 Masami Hiramatsu (Google)
  2025-09-24 14:28 ` Masami Hiramatsu
  0 siblings, 1 reply; 2+ messages in thread
From: Masami Hiramatsu (Google) @ 2025-09-19  1:15 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Masami Hiramatsu, Mathieu Desnoyers, linux-kernel,
	linux-trace-kernel

From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Since dynamic_events interface on tracefs is compatible with
kprobe_events and uprobe_events, it should also check the lockdown
status and reject if it is set.

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
 kernel/trace/trace_dynevent.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/trace/trace_dynevent.c b/kernel/trace/trace_dynevent.c
index 5d64a18cacac..d06854bd32b3 100644
--- a/kernel/trace/trace_dynevent.c
+++ b/kernel/trace/trace_dynevent.c
@@ -230,6 +230,10 @@ static int dyn_event_open(struct inode *inode, struct file *file)
 {
 	int ret;
 
+	ret = security_locked_down(LOCKDOWN_TRACEFS);
+	if (ret)
+		return ret;
+
 	ret = tracing_check_open_get_tr(NULL);
 	if (ret)
 		return ret;


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tracing: dynevent: Add a missing lockdown check on dynevent
  2025-09-19  1:15 [PATCH] tracing: dynevent: Add a missing lockdown check on dynevent Masami Hiramatsu (Google)
@ 2025-09-24 14:28 ` Masami Hiramatsu
  0 siblings, 0 replies; 2+ messages in thread
From: Masami Hiramatsu @ 2025-09-24 14:28 UTC (permalink / raw)
  To: Masami Hiramatsu (Google)
  Cc: Steven Rostedt, Mathieu Desnoyers, linux-kernel,
	linux-trace-kernel

I think this should be backported to stable.

On Fri, 19 Sep 2025 10:15:56 +0900
"Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:

> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Since dynamic_events interface on tracefs is compatible with
> kprobe_events and uprobe_events, it should also check the lockdown
> status and reject if it is set.
> 
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Fixes: 17911ff38aa5 ("tracing: Add locked_down checks to the open calls of files created for tracefs")
Cc: stable@vger.kernel.org

Thanks,

> ---
>  kernel/trace/trace_dynevent.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/kernel/trace/trace_dynevent.c b/kernel/trace/trace_dynevent.c
> index 5d64a18cacac..d06854bd32b3 100644
> --- a/kernel/trace/trace_dynevent.c
> +++ b/kernel/trace/trace_dynevent.c
> @@ -230,6 +230,10 @@ static int dyn_event_open(struct inode *inode, struct file *file)
>  {
>  	int ret;
>  
> +	ret = security_locked_down(LOCKDOWN_TRACEFS);
> +	if (ret)
> +		return ret;
> +
>  	ret = tracing_check_open_get_tr(NULL);
>  	if (ret)
>  		return ret;
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-24 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-19  1:15 [PATCH] tracing: dynevent: Add a missing lockdown check on dynevent Masami Hiramatsu (Google)
2025-09-24 14:28 ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).