summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-08-10 13:36:34 -0700
committerMichael Bestas <mkbestas@lineageos.org>2020-01-27 20:39:02 +0200
commit3edf0a32f5825b8b71edb6a8953eedb6400d271c (patch)
tree6ac96fa42ac584f96f98b3ed383a776307aa3710
parent22d88e1acee89743969b02a4f79afbbde4ce7e34 (diff)
FROMLIST: pstore: Make default pstorefs root dir perms 0750
Currently only DMESG and CONSOLE record types are protected, and it isn't obvious that they are using a capability check. Instead switch to explicit root directory mode of 0750 to keep files private by default. This will allow the removal of the capability check, which was non-obvious and forces a process to have possibly too much privilege when simple post-boot chgrp for readers would be possible without it. Bug: 64503253 Change-Id: I4ee226d953227310b4c33e7a0436ba353abfde6f Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Siqi Lin <siqilin@google.com> (am from https://patchwork.kernel.org/patch/9894577/)
-rw-r--r--fs/pstore/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
index 30212a6f278d..75bf5e7d5d84 100644
--- a/fs/pstore/inode.c
+++ b/fs/pstore/inode.c
@@ -430,7 +430,7 @@ static int pstore_fill_super(struct super_block *sb, void *data, int silent)
inode = pstore_get_inode(sb);
if (inode) {
- inode->i_mode = S_IFDIR | 0755;
+ inode->i_mode = S_IFDIR | 0750;
inode->i_op = &pstore_dir_inode_operations;
inode->i_fop = &simple_dir_operations;
inc_nlink(inode);