From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751949AbdHPIEw (ORCPT ); Wed, 16 Aug 2017 04:04:52 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:37616 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751810AbdHPIEq (ORCPT ); Wed, 16 Aug 2017 04:04:46 -0400 Date: Wed, 16 Aug 2017 17:05:02 +0900 From: Sergey Senozhatsky To: Kees Cook Cc: linux-kernel@vger.kernel.org, Nick Kralevich , Sebastian Schmidt , Tony Luck , Anton Vorontsov , Colin Cross , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Patrick Tjin , Mark Salyzyn Subject: Re: [PATCH 1/2] pstore: Make default pstorefs root dir perms 0750 Message-ID: <20170816080502.GD522@jagdpanzerIV.localdomain> References: <1502397395-118652-1-git-send-email-keescook@chromium.org> <1502397395-118652-2-git-send-email-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1502397395-118652-2-git-send-email-keescook@chromium.org> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On (08/10/17 13:36), Kees Cook wrote: > 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 it's CAP_SYSLOG, isn't it? is it too much? does chgrp require less privileges? -ss > when simple post-boot chgrp for readers would be possible without it. > > Signed-off-by: Kees Cook > --- > fs/pstore/inode.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c > index fefd22611cf6..f1e88b695090 100644 > --- a/fs/pstore/inode.c > +++ b/fs/pstore/inode.c > @@ -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); > -- > 2.7.4 >