Skip to contentSkip to conversation

SELinux: change Kconfig to use select instead of depends

PATCH In review Eric Paris 3 participants 8 messages Feb 7, 2007 – Aug 21, 2007 SELinux security module

lore
Share & tools
lore

Eric Paris

author
#0 lore raw

PATCH 1/1 SELinux: change Kconfig to use select instead of depends

Changes the security/selinux/Kconfig to use select instead of depends for most of the SELinux requirements. This allows the SELinux option to show up when people do a make config without already knowing they had to enable audit and other non-obvious choices. Added a depends on SECURITY (which previously existed through SECURITY_NETWORK) so that SELinux would not always show up, but would be easy and intuitive to find.

-Eric

 security/selinux/Kconfig |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
security/selinux/Kconfig +6 -1
index 23b5104..42ae47f 100644
@@ -1,6 +1,10 @@
 config SECURITY_SELINUX
 	bool "NSA SELinux Support"
-	depends on SECURITY_NETWORK && AUDIT && NET && INET
+	depends on SECURITY
+	select SECURITY_NETWORK
+	select AUDIT
+	select NET
+	select INET
 	select NETWORK_SECMARK
 	default n
 	help
@@ -9,6 +13,7 @@ config SECURITY_SELINUX
 	  You can obtain the policy compiler (checkpolicy), the utility for
 	  labeling filesystems (setfiles), and an example policy configuration
 	  from <http://www.nsa.gov/selinux/>.
+
 	  If you are unsure how to answer this question, answer N.
 
 config SECURITY_SELINUX_BOOTPARAM

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 6 lines · Eric Paris

Changes the security/selinux/Kconfig to use select instead of depends for most of the SELinux requirements. This allows the SELinux option to show up when people do a make config without already knowing they had to enable audit and other non-obvious choices. Added a depends on SECURITY (which previously existed through SECURITY_NETWORK) so that SELinux would not always show up, but would be easy and intuitive to find.

Looks sane; only question I have is whether the NET and INET selection should happen from SECURITY_NETWORK or NETWORK_SECMARK rather than from SECURITY_SELINUX (and then selinux would pick it up from there).

Quoted 33 lines

-Eric

 security/selinux/Kconfig |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
security/selinux/Kconfig +6 -1
index 23b5104..42ae47f 100644
@@ -1,6 +1,10 @@
 config SECURITY_SELINUX
 	bool "NSA SELinux Support"
-	depends on SECURITY_NETWORK && AUDIT && NET && INET
+	depends on SECURITY
+	select SECURITY_NETWORK
+	select AUDIT
+	select NET
+	select INET
 	select NETWORK_SECMARK
 	default n
 	help
@@ -9,6 +13,7 @@ config SECURITY_SELINUX
 	  You can obtain the policy compiler (checkpolicy), the utility for
 	  labeling filesystems (setfiles), and an example policy configuration
 	  from <http://www.nsa.gov/selinux/>.
+
 	  If you are unsure how to answer this question, answer N.
 
 config SECURITY_SELINUX_BOOTPARAM
Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw
Quoted 11 lines · Stephen Smalley
Quoted 6 lines · Eric Paris

Changes the security/selinux/Kconfig to use select instead of depends for most of the SELinux requirements. This allows the SELinux option to show up when people do a make config without already knowing they had to enable audit and other non-obvious choices. Added a depends on SECURITY (which previously existed through SECURITY_NETWORK) so that SELinux would not always show up, but would be easy and intuitive to find.

Looks sane; only question I have is whether the NET and INET selection should happen from SECURITY_NETWORK or NETWORK_SECMARK rather than from SECURITY_SELINUX (and then selinux would pick it up from there).

Also, we had talked about selecting PROC_FS and dropping the #ifdef on it during the earlier sysctl discussion, given the fundamental need for proc to support the process security attribute API.

Naturally, we also have an effective dependency on the filesystem security attribute options (e.g. EXT3_FS_SECURITY), but we can't really "select" those since they are per-filesystem.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#3 lore raw
Quoted 13 lines · Stephen Smalley
Quoted 11 lines · Stephen Smalley
Quoted 6 lines · Eric Paris

Changes the security/selinux/Kconfig to use select instead of depends for most of the SELinux requirements. This allows the SELinux option to show up when people do a make config without already knowing they had to enable audit and other non-obvious choices. Added a depends on SECURITY (which previously existed through SECURITY_NETWORK) so that SELinux would not always show up, but would be easy and intuitive to find.

Looks sane; only question I have is whether the NET and INET selection should happen from SECURITY_NETWORK or NETWORK_SECMARK rather than from SECURITY_SELINUX (and then selinux would pick it up from there).

Quoted 7 lines

Also, we had talked about selecting PROC_FS and dropping the #ifdef on it during the earlier sysctl discussion, given the fundamental need for proc to support the process security attribute API.

Naturally, we also have an effective dependency on the filesystem security attribute options (e.g. EXT3_FS_SECURITY), but we can't really "select" those since they are per-filesystem.

We could also select NETFILTER and drop the #if on it (required for the packet send checks).

Full secmark support actually requires other config options as well for the connection tracking support and targetsm but those likely aren't suitable to select.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
author
#4 lore raw
In reply to Stephen Smalley
Quoted 11 lines · Stephen Smalley
Quoted 6 lines · Eric Paris

Changes the security/selinux/Kconfig to use select instead of depends for most of the SELinux requirements. This allows the SELinux option to show up when people do a make config without already knowing they had to enable audit and other non-obvious choices. Added a depends on SECURITY (which previously existed through SECURITY_NETWORK) so that SELinux would not always show up, but would be easy and intuitive to find.

Looks sane; only question I have is whether the NET and INET selection should happen from SECURITY_NETWORK or NETWORK_SECMARK rather than from SECURITY_SELINUX (and then selinux would pick it up from there).

It does appear that NETWORK_SECMARK is already inside an "if NET" so that one should be able to be dropped entirely. James, do you have feelings on the proper placement of the INET depends/select?

-Eric

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#5 lore raw
Quoted 9 lines · Eric Paris
Quoted 8 lines · Stephen Smalley
Quoted 6 lines · Eric Paris

Changes the security/selinux/Kconfig to use select instead of depends for most of the SELinux requirements. This allows the SELinux option to show up when people do a make config without already knowing they had to enable audit and other non-obvious choices. Added a depends on SECURITY (which previously existed through SECURITY_NETWORK) so that SELinux would not always show up, but would be easy and intuitive to find.

Quoted 7 lines
Quoted 3 lines

Looks sane; only question I have is whether the NET and INET selection should happen from SECURITY_NETWORK or NETWORK_SECMARK rather than from SECURITY_SELINUX (and then selinux would pick it up from there).

It does appear that NETWORK_SECMARK is already inside an "if NET" so that one should be able to be dropped entirely. James, do you have feelings on the proper placement of the INET depends/select?

If it's all going to be selected, perhaps it's simpler to keep all the selects in one place.

Signature · 7 lines
James Morris
<[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
Acked-by on v1 1/1
#6 lore raw
In reply to Eric Paris
Quoted 10 lines · Eric Paris

Changes the security/selinux/Kconfig to use select instead of depends for most of the SELinux requirements. This allows the SELinux option to show up when people do a make config without already knowing they had to enable audit and other non-obvious choices. Added a depends on SECURITY (which previously existed through SECURITY_NETWORK) so that SELinux would not always show up, but would be easy and intuitive to find.

-Eric

Quoted 35 lines
 security/selinux/Kconfig |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
security/selinux/Kconfig +6 -2
index 23b5104..42ae47f 100644
@@ -1,6 +1,10 @@
 config SECURITY_SELINUX
 	bool "NSA SELinux Support"
-	depends on SECURITY_NETWORK && AUDIT && NET && INET
+	depends on SECURITY
+	select SECURITY_NETWORK
+	select AUDIT
+	select NET
+	select INET
 	select NETWORK_SECMARK
 	default n
 	help
@@ -9,6 +13,7 @@ config SECURITY_SELINUX
 	  You can obtain the policy compiler (checkpolicy), the utility for
 	  labeling filesystems (setfiles), and an example policy configuration
 	  from <http://www.nsa.gov/selinux/>.
+
 	  If you are unsure how to answer this question, answer N.
 
 config SECURITY_SELINUX_BOOTPARAM
 
 
 
--

This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#7 lore raw
Quoted 1 line · Stephen Smalley

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6.git#for-akpm

Signature · 7 lines
James Morris
<[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.