From patchwork Wed Jul 26 18:31:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Berger X-Patchwork-Id: 9865681 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B2C2B602B1 for ; Wed, 26 Jul 2017 18:31:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC2E0287A3 for ; Wed, 26 Jul 2017 18:31:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0DA4287B5; Wed, 26 Jul 2017 18:31:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C162287C3 for ; Wed, 26 Jul 2017 18:31:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751202AbdGZSby (ORCPT ); Wed, 26 Jul 2017 14:31:54 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58270 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750996AbdGZSbx (ORCPT ); Wed, 26 Jul 2017 14:31:53 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6QIT5bU135393 for ; Wed, 26 Jul 2017 14:31:53 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 2bxxvgd0sf-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 26 Jul 2017 14:31:53 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 26 Jul 2017 12:31:52 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 26 Jul 2017 12:31:51 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v6QIVoRJ7864670; Wed, 26 Jul 2017 11:31:50 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 77B2978043; Wed, 26 Jul 2017 12:31:50 -0600 (MDT) Received: from sbct-3.watson.ibm.com (unknown [9.2.141.158]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id E7D4E78038; Wed, 26 Jul 2017 12:31:49 -0600 (MDT) From: Stefan Berger To: linux-security-module@vger.kernel.org, jmorris@namei.org Cc: linux-kernel@vger.kernel.org, serge@hallyn.com, Stefan Berger Subject: [PATCH] security: fix description of values returned by cap_inode_need_killpriv Date: Wed, 26 Jul 2017 14:31:08 -0400 X-Mailer: git-send-email 2.5.5 X-TM-AS-GCONF: 00 x-cbid: 17072618-0012-0000-0000-000014BDDF1F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007430; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000214; SDB=6.00893268; UDB=6.00446559; IPR=6.00673432; BA=6.00005492; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016391; XFM=3.00000015; UTC=2017-07-26 18:31:52 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17072618-0013-0000-0000-00004EC8EB40 Message-Id: <1501093868-30838-1-git-send-email-stefanb@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-26_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707260267 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP cap_inode_need_killpriv returns 1 if security.capability exists, 0 otherwise. Fix the description of the return value to reflect this. Signed-off-by: Stefan Berger --- security/commoncap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/security/commoncap.c b/security/commoncap.c index 7abebd7..92931f8 100644 --- a/security/commoncap.c +++ b/security/commoncap.c @@ -302,8 +302,7 @@ static inline void bprm_clear_caps(struct linux_binprm *bprm) * affects the security markings on that inode, and if it is, should * 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, 0 otherwise. */ int cap_inode_need_killpriv(struct dentry *dentry) {