diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2021-08-18 17:24:51 +0200 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2021-10-09 00:08:43 +0200 |
commit | 21ccc9cd72116289469e5519b6159c675a2fa58f (patch) | |
tree | cb906db82f29de610727da5d7f35a3f39b99824b /kernel/trace/trace_stat.c | |
parent | tracefs: Have tracefs directories not set OTH permission bits by default (diff) | |
download | linux-21ccc9cd72116289469e5519b6159c675a2fa58f.tar.xz linux-21ccc9cd72116289469e5519b6159c675a2fa58f.zip |
tracing: Disable "other" permission bits in the tracefs files
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>
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; |