Skip to contentSkip to conversation

tracing: dynevent: Add a missing lockdown check on dynevent

PATCH In review Masami Hiramatsu (Google) 1 participant 2 messages Sep 19, 2025 – Sep 24, 2025 Tracing

lore
Share & tools
lore

Masami Hiramatsu (Google)

author maintainer
#0 lore raw

PATCH 1/1 tracing: dynevent: Add a missing lockdown check on dynevent

From: Masami Hiramatsu (Google) <[email protected]>

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.

---
 kernel/trace/trace_dynevent.c |    4 ++++
 1 file changed, 4 insertions(+)
kernel/trace/trace_dynevent.c +4 -0
index 5d64a18cacac..d06854bd32b3 100644
@@ -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;
author maintainer
#1 lore raw

I think this should be backported to stable.

Quoted 7 lines · On Fri, 19 Sep 2025 10:15:56 +0900 "Masami Hiramatsu (Google)"…

From: Masami Hiramatsu (Google) <[email protected]>

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.

Fixes 17911ff38aa5 ("tracing: Add locked_down checks to the open calls of files created for tracefs")

Thanks,

Quoted 20 lines
---
 kernel/trace/trace_dynevent.c |    4 ++++
 1 file changed, 4 insertions(+)
kernel/trace/trace_dynevent.c +4 -0
index 5d64a18cacac..d06854bd32b3 100644
@@ -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;
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>