Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751502AbdG0CmT (ORCPT ); Wed, 26 Jul 2017 22:42:19 -0400 Received: from h2.hallyn.com ([78.46.35.8]:48274 "EHLO h2.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751421AbdG0CmS (ORCPT ); Wed, 26 Jul 2017 22:42:18 -0400 Date: Wed, 26 Jul 2017 21:42:17 -0500 From: "Serge E. Hallyn" To: Stefan Berger Cc: jmorris@namei.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, serge@hallyn.com Subject: Re: [PATCH v2] security: fix description of values returned by cap_inode_need_killpriv Message-ID: <20170727024217.GA12236@mail.hallyn.com> References: <1501122425-12250-1-git-send-email-stefanb@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1501122425-12250-1-git-send-email-stefanb@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1334 Lines: 35 On Wed, Jul 26, 2017 at 10:27:05PM -0400, Stefan Berger wrote: > cap_inode_need_killpriv returns 1 if security.capability exists and > has a value and inode_killpriv() is required, 0 otherwise. Fix the > description of the return value to reflect this. > > Signed-off-by: Stefan Berger Thanks, Stefan. Reviewed-by: Serge Hallyn > --- > security/commoncap.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/security/commoncap.c b/security/commoncap.c > index 7abebd7..1234269 100644 > --- a/security/commoncap.c > +++ b/security/commoncap.c > @@ -300,10 +300,10 @@ static inline void bprm_clear_caps(struct linux_binprm *bprm) > * > * Determine if an inode having a change applied that's marked ATTR_KILL_PRIV > * affects the security markings on that inode, and if it is, should > - * inode_killpriv() be invoked or the change rejected? > + * inode_killpriv() be invoked or the change rejected. > * > - * Returns 0 if granted; +ve if granted, but inode_killpriv() is required; and > - * -ve to deny the change. > + * Returns 1 if security.capability has a value, meaning inode_killpriv() > + * is required, 0 otherwise, meaning inode_killpriv() is not required. > */ > int cap_inode_need_killpriv(struct dentry *dentry) > { > -- > 2.7.4