Skip to content

Commit d7caa33

Browse files
committed
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. Signed-off-by: Kees Cook <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]>
1 parent 520eccd commit d7caa33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/pstore/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ static int pstore_fill_super(struct super_block *sb, void *data, int silent)
471471

472472
inode = pstore_get_inode(sb);
473473
if (inode) {
474-
inode->i_mode = S_IFDIR | 0755;
474+
inode->i_mode = S_IFDIR | 0750;
475475
inode->i_op = &pstore_dir_inode_operations;
476476
inode->i_fop = &simple_dir_operations;
477477
inc_nlink(inode);

0 commit comments

Comments
 (0)