From patchwork Thu Apr 14 14:40:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prarit Bhargava X-Patchwork-Id: 8838351 Return-Path: X-Original-To: patchwork-selinux@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 48B17C0553 for ; Thu, 14 Apr 2016 14:59:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BB0FE2021F for ; Thu, 14 Apr 2016 14:59:30 +0000 (UTC) Received: from emvm-gh1-uea08.nsa.gov (smtp.nsa.gov [8.44.101.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F2222025A for ; Thu, 14 Apr 2016 14:59:29 +0000 (UTC) X-TM-IMSS-Message-ID: <3852accb0003492b@nsa.gov> Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by nsa.gov ([10.208.42.193]) with ESMTP (TREND IMSS SMTP Service 7.1) id 3852accb0003492b ; Thu, 14 Apr 2016 10:45:38 -0400 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u3EEjOde009916; Thu, 14 Apr 2016 10:45:33 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id u3EEhALd223699 for ; Thu, 14 Apr 2016 10:43:10 -0400 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u3EEfO2n009030; Thu, 14 Apr 2016 10:41:24 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1AcAADRqw9Xkxy3hNFeHYQ3NKd9ggABjiKDLwVahg6CBQEBAQEBARMBAQEBBw0JCSGFHlKBUYgUAxLDAI93hQoFjVKKOY4NAmSDeYovAo8pghhfgW4gMAGJRQEBAQ X-IPAS-Result: A1AcAADRqw9Xkxy3hNFeHYQ3NKd9ggABjiKDLwVahg6CBQEBAQEBARMBAQEBBw0JCSGFHlKBUYgUAxLDAI93hQoFjVKKOY4NAmSDeYovAo8pghhfgW4gMAGJRQEBAQ X-IronPort-AV: E=Sophos;i="5.24,485,1454994000"; d="scan'208";a="5380740" Received: from emvm-gh1-uea09.nsa.gov ([10.208.42.194]) by goalie.tycho.ncsc.mil with ESMTP; 14 Apr 2016 10:41:07 -0400 X-TM-IMSS-Message-ID: <842c9ca20002dc39@nsa.gov> Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by nsa.gov ([10.208.42.194]) with ESMTP (TREND IMSS SMTP Service 7.1; TLSv1/SSLv3 ADH-AES256-SHA (256/256)) id 842c9ca20002dc39 ; Thu, 14 Apr 2016 10:40:54 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D26D8627E7; Thu, 14 Apr 2016 14:41:04 +0000 (UTC) Received: from prarit.bos.redhat.com (prarit-guest.khw.lab.eng.bos.redhat.com [10.16.186.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3EEf2TI007619; Thu, 14 Apr 2016 10:41:02 -0400 From: Prarit Bhargava To: linux-security-module@vger.kernel.org Subject: [PATCH] security/selinux: Change bool variable name to index. Date: Thu, 14 Apr 2016 10:40:57 -0400 Message-Id: <1460644857-29218-1-git-send-email-prarit@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 14 Apr 2016 14:41:05 +0000 (UTC) X-TM-AS-MML: disable X-Mailman-Approved-At: Thu, 14 Apr 2016 10:45:23 -0400 X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Cc: Prarit Bhargava , David Howells , Rasmus Villemoes , Eric Paris , James Morris , Andrew Perepechko , Stephen Smalley , selinux@tycho.nsa.gov MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP security_get_bool_value(int bool) argument "bool" conflicts with in-kernel macros such as BUILD_BUG(). This patch changes this to index which isn't a type. Cc: Paul Moore Cc: Stephen Smalley Cc: Eric Paris Cc: James Morris Cc: "Serge E. Hallyn" Cc: Rasmus Villemoes Cc: Andrew Perepechko Cc: Jeff Vander Stoep Cc: selinux@tycho.nsa.gov Cc: Eric Paris Cc: Paul Moore Cc: David Howells Signed-off-by: Prarit Bhargava --- security/selinux/include/conditional.h | 2 +- security/selinux/ss/services.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/security/selinux/include/conditional.h b/security/selinux/include/conditional.h index 67ce7a8..ff4fddc 100644 --- a/security/selinux/include/conditional.h +++ b/security/selinux/include/conditional.h @@ -17,6 +17,6 @@ int security_get_bools(int *len, char ***names, int **values); int security_set_bools(int len, int *values); -int security_get_bool_value(int bool); +int security_get_bool_value(int index); #endif diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index ebda973..89df646 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -2696,7 +2696,7 @@ out: return rc; } -int security_get_bool_value(int bool) +int security_get_bool_value(int index) { int rc; int len; @@ -2705,10 +2705,10 @@ int security_get_bool_value(int bool) rc = -EFAULT; len = policydb.p_bools.nprim; - if (bool >= len) + if (index >= len) goto out; - rc = policydb.bool_val_to_struct[bool]->state; + rc = policydb.bool_val_to_struct[index]->state; out: read_unlock(&policy_rwlock); return rc;