Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <keescook@chromium.org>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

+1 -1
+1 -1
fs/pstore/inode.c
··· 471 471 472 472 inode = pstore_get_inode(sb); 473 473 if (inode) { 474 - inode->i_mode = S_IFDIR | 0755; 474 + inode->i_mode = S_IFDIR | 0750; 475 475 inode->i_op = &pstore_dir_inode_operations; 476 476 inode->i_fop = &simple_dir_operations; 477 477 inc_nlink(inode);