Skip to content

Commit

Permalink
pstore: Make default pstorefs root dir perms 0750
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Kees Cook <[email protected]>
Reviewed-by: Sergey Senozhatsky <[email protected]>
  • Loading branch information
kees committed Aug 17, 2017
1 parent 520eccd commit d7caa33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/pstore/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,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);
Expand Down

0 comments on commit d7caa33

Please sign in to comment.