Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp614633imu; Mon, 26 Nov 2018 15:50:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/XeXjnpMQ9DU+EVuPbhiwpKsnJtjuw2Y2OKgxvtp3+TODSEXHgoykMOfkiSMwvMjvXxK4BT X-Received: by 2002:a63:a91a:: with SMTP id u26mr26720748pge.349.1543276229143; Mon, 26 Nov 2018 15:50:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543276229; cv=none; d=google.com; s=arc-20160816; b=Hy+edFjQWJoopd+tguuMh/zzInV9cBRsJFUOUlpt66oeA9c/Lp01kKuR1qIEtEuhJv +UtTEgoj/zudo0rghqAyomDnWw2ODsxQWqNOywdsEEgjgj71Myq3JhAkcvx0OR8DDbWj +m3GJhjJb4XI/yAvpW0BBZ1CsJ58CeNWH7/DhGB1nKurSrRZqkkJjWtapFHXbQaETIqc Kn/E3BIWL31F5fBdSLw5RvudMe9jXpU6jhT3g76HsCmx5X+f5t3/p0IrFSx2pxZTHm4w Sijy7Cpx+hLOqj/qgRzCqj+IHxpfG/mSyW/BOqyN66ptBPnQuF1Ycpp4l5Vz2k4Z9CJi VahQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=mOH1jMGSjEQ/xFrT6GtLpC/r3huR+zGxEWp8FnuIDGw=; b=WZS8Yt5lvVWaBLv0fZNRRAWs22sex0KZPs425M1ur96Xksh8cHsY8uYzPQzG9gUkOo PDrmhTGx7lw0jWjhiiy6U02rn1Oh/X86d/7gXipOPV0GJ5KULSUohEvKLnxvvF9Cinju YiGqLj+TKtZBAI8m1P9y0L3CY8seeTWNmj+Vc4kr9r5+okBSmhh/mJDZm6iaA4QB6JZM DcHF6rQlRuSHl5wgtd0gvEdIioOBbELwH/SE6cui+4rpP3Q5htR/pSvi+YJ8ZHMPhrkF JGTM4flHLvYVzeCvmq7Co6nPzY/yy6Ps24XV7g+2TTWBzWxOd9x6R32KiLuzyu3Z+5r0 LpjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=skIuVzj6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 86si2181844pfl.46.2018.11.26.15.50.14; Mon, 26 Nov 2018 15:50:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=skIuVzj6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728043AbeK0KpB (ORCPT + 99 others); Tue, 27 Nov 2018 05:45:01 -0500 Received: from sonic309-48.consmr.mail.ne1.yahoo.com ([66.163.184.174]:46852 "EHLO sonic309-48.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727652AbeK0KpA (ORCPT ); Tue, 27 Nov 2018 05:45:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1543276149; bh=mOH1jMGSjEQ/xFrT6GtLpC/r3huR+zGxEWp8FnuIDGw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=skIuVzj6GesAhMBCuXNCurKLMmgw4kDrOdXkmSGufOMk+tgiE20NK6w3dvGRd/qDOOj3DxHP1xotD77hN2vYTC833ZV9j9isL5NiHGnG5+nhB/WgmpIUYb5Jo9WbrvkhsSQxDL0x3q+6FUTPI/na/xrHqiooY/CoBL0B8KA/8gUxzp0XzM5xQ9m839OIBCjq5XA6Nr7ghaYxJCQbjfcbuuIRZ40g4UdnH6sPg5rEnSEU1mH1vx7O+9UDCtIP+GrN19TCV1j0YbLWw3cuDGmdoeBSdToSzKyWKik1PlKaLzrvGTIoKqXxord/NSkH5fadeGHBDm6h9Nhg41X+TXjO8Q== X-YMail-OSG: d3pmbgEVM1llWOF2tZuzwc9V9jVaNTKNwr9e4YE8huehbYkgGKsge_S0oUfznnR lXhuy_6UO3A-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Mon, 26 Nov 2018 23:49:09 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.105]) ([67.169.65.224]) by smtp405.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 5288dd96c25f63a0964f292e22c42e02; Mon, 26 Nov 2018 23:45:08 +0000 (UTC) Subject: [PATCH v5 24/38] SELinux: Remove unused selinux_is_enabled To: James Morris , LSM , LKLM , SE Linux Cc: John Johansen , Kees Cook , Tetsuo Handa , Paul Moore , "linux-fsdevel@vger.kernel.org" , Stephen Smalley , Alexey Dobriyan , =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= , Salvatore Mesoraca References: <50db058a-7dde-441b-a7f9-f6837fe8b69f@schaufler-ca.com> From: Casey Schaufler Message-ID: <8b7b3c7e-acd1-cd0f-95a3-02f09bfbfc96@schaufler-ca.com> Date: Mon, 26 Nov 2018 15:45:05 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <50db058a-7dde-441b-a7f9-f6837fe8b69f@schaufler-ca.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are no longer users of selinux_is_enabled(). Remove it. As selinux_is_enabled() is the only reason for include/linux/selinux.h remove that as well. Signed-off-by: Casey Schaufler Reviewed-by: Kees Cook Signed-off-by: Kees Cook --- include/linux/cred.h | 1 - include/linux/selinux.h | 35 ----------------------------------- security/selinux/Makefile | 2 +- security/selinux/exports.c | 23 ----------------------- security/selinux/hooks.c | 1 - security/selinux/include/audit.h | 3 --- security/selinux/ss/services.c | 1 - 7 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 include/linux/selinux.h delete mode 100644 security/selinux/exports.c diff --git a/include/linux/cred.h b/include/linux/cred.h index 7eed6101c791..2e715e202e6a 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/include/linux/selinux.h b/include/linux/selinux.h deleted file mode 100644 index 44f459612690..000000000000 --- a/include/linux/selinux.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SELinux services exported to the rest of the kernel. - * - * Author: James Morris - * - * Copyright (C) 2005 Red Hat, Inc., James Morris - * Copyright (C) 2006 Trusted Computer Solutions, Inc. - * Copyright (C) 2006 IBM Corporation, Timothy R. Chavez - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, - * as published by the Free Software Foundation. - */ -#ifndef _LINUX_SELINUX_H -#define _LINUX_SELINUX_H - -struct selinux_audit_rule; -struct audit_context; -struct kern_ipc_perm; - -#ifdef CONFIG_SECURITY_SELINUX - -/** - * selinux_is_enabled - is SELinux enabled? - */ -bool selinux_is_enabled(void); -#else - -static inline bool selinux_is_enabled(void) -{ - return false; -} -#endif /* CONFIG_SECURITY_SELINUX */ - -#endif /* _LINUX_SELINUX_H */ diff --git a/security/selinux/Makefile b/security/selinux/Makefile index c7161f8792b2..ccf950409384 100644 --- a/security/selinux/Makefile +++ b/security/selinux/Makefile @@ -6,7 +6,7 @@ obj-$(CONFIG_SECURITY_SELINUX) := selinux.o selinux-y := avc.o hooks.o selinuxfs.o netlink.o nlmsgtab.o netif.o \ - netnode.o netport.o ibpkey.o exports.o \ + netnode.o netport.o ibpkey.o \ ss/ebitmap.o ss/hashtab.o ss/symtab.o ss/sidtab.o ss/avtab.o \ ss/policydb.o ss/services.o ss/conditional.o ss/mls.o ss/status.o diff --git a/security/selinux/exports.c b/security/selinux/exports.c deleted file mode 100644 index e75dd94e2d2b..000000000000 --- a/security/selinux/exports.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SELinux services exported to the rest of the kernel. - * - * Author: James Morris - * - * Copyright (C) 2005 Red Hat, Inc., James Morris - * Copyright (C) 2006 Trusted Computer Solutions, Inc. - * Copyright (C) 2006 IBM Corporation, Timothy R. Chavez - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, - * as published by the Free Software Foundation. - */ -#include -#include - -#include "security.h" - -bool selinux_is_enabled(void) -{ - return selinux_enabled; -} -EXPORT_SYMBOL_GPL(selinux_is_enabled); diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 41b230d459a6..c82f11270de6 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -79,7 +79,6 @@ #include #include #include -#include #include #include #include diff --git a/security/selinux/include/audit.h b/security/selinux/include/audit.h index 1bdf973433cc..36e1d44c0209 100644 --- a/security/selinux/include/audit.h +++ b/security/selinux/include/audit.h @@ -1,9 +1,6 @@ /* * SELinux support for the Audit LSM hooks * - * Most of below header was moved from include/linux/selinux.h which - * is released under below copyrights: - * * Author: James Morris * * Copyright (C) 2005 Red Hat, Inc., James Morris diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 12e414394530..1a745e2f49a9 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include -- 2.14.5