diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2021-08-18 18:24:51 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-11-18 21:16:15 +0300 |
commit | 4e4f6e33d6f22b073697098ef6fa0f33e44c391c (patch) | |
tree | 54f0a91bb0d5999429b24404e5d34553700f06f3 /kernel/trace/trace_stat.c | |
parent | 1067f23c1ee7b00852c14ed543bbee9874d6867c (diff) | |
download | linux-4e4f6e33d6f22b073697098ef6fa0f33e44c391c.tar.xz |
tracing: Disable "other" permission bits in the tracefs files
[ Upstream commit 21ccc9cd72116289469e5519b6159c675a2fa58f ]
When building the files in the tracefs file system, do not by default set
any permissions for OTH (other). This will make it easier for admins who
want to define a group for accessing tracefs and not having to first
disable all the permission bits for "other" in the file system.
As tracing can leak sensitive information, it should never by default
allowing all users access. An admin can still set the permission bits for
others to have access, which may be useful for creating a honeypot and
seeing who takes advantage of it and roots the machine.
Link: https://lkml.kernel.org/r/20210818153038.864149276@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel/trace/trace_stat.c')
-rw-r--r-- | kernel/trace/trace_stat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/trace/trace_stat.c b/kernel/trace/trace_stat.c index 8d141c3825a9..bb247beec447 100644 --- a/kernel/trace/trace_stat.c +++ b/kernel/trace/trace_stat.c @@ -297,9 +297,9 @@ static int init_stat_file(struct stat_session *session) if (!stat_dir && (ret = tracing_stat_init())) return ret; - session->file = tracefs_create_file(session->ts->name, 0644, - stat_dir, - session, &tracing_stat_fops); + session->file = tracefs_create_file(session->ts->name, TRACE_MODE_WRITE, + stat_dir, session, + &tracing_stat_fops); if (!session->file) return -ENOMEM; return 0; |