summaryrefslogtreecommitdiff
path: root/kernel/trace/trace_uprobe.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2019-10-29 04:43:29 -0600
committerJonathan Corbet <corbet@lwn.net>2019-10-29 04:43:29 -0600
commit822bbba0cabb50825a0ce22707dc45eb82d02853 (patch)
treeea61d4ca72cb60b4cae8e95f64eefa7cd2a36603 /kernel/trace/trace_uprobe.c
parentd41abfd7ae33cd3c1d9189438937d61cb75e690a (diff)
parent7d194c2100ad2a6dded545887d02754948ca5241 (diff)
Merge tag 'v5.4-rc4' into docs-next
I need to pick up the independent changes made to Documentation/core-api/memory-allocation.rst to be able to merge further work without creating a total mess.
Diffstat (limited to 'kernel/trace/trace_uprobe.c')
-rw-r--r--kernel/trace/trace_uprobe.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index dd884341f5c5..352073d36585 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -7,6 +7,7 @@
*/
#define pr_fmt(fmt) "trace_uprobe: " fmt
+#include <linux/security.h>
#include <linux/ctype.h>
#include <linux/module.h>
#include <linux/uaccess.h>
@@ -769,6 +770,10 @@ static int probes_open(struct inode *inode, struct file *file)
{
int ret;
+ ret = security_locked_down(LOCKDOWN_TRACEFS);
+ if (ret)
+ return ret;
+
if ((file->f_mode & FMODE_WRITE) && (file->f_flags & O_TRUNC)) {
ret = dyn_events_release_all(&trace_uprobe_ops);
if (ret)
@@ -818,6 +823,12 @@ static const struct seq_operations profile_seq_op = {
static int profile_open(struct inode *inode, struct file *file)
{
+ int ret;
+
+ ret = security_locked_down(LOCKDOWN_TRACEFS);
+ if (ret)
+ return ret;
+
return seq_open(file, &profile_seq_op);
}