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/)
This commit is contained in:
Kees Cook 2017-08-10 13:36:34 -07:00 committed by Timi
parent 440efba9b7
commit 770519f0c0

View file

@ -435,7 +435,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);