Skip to contentSkip to conversation

Default Mikefile in /usr/share/selinux/devel not nice

DISCUSSION Michael C Thompson 4 participants 5 messages Sep 29, 2006 – Oct 2, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

I just discovered a nasty surprise waiting for me in the default Makefile provided by selinux-policy-devel.

Basically, the Makefile produces, on an MLS system, a TYPE value of mls-msc (this is due to the SELINUXTYPE=mls line in /etc/selinux/config). This will not 'enable_mls' for the M4FLAGS, because the Makefile in /usr/share/selinux/devel/include/ does a findstring for '-mls'.

Dan Walsh has suggested a fix for the default Makefile, but I'm wondering why we can't just change /usr/share/selinux/devel/include/Makefile to do a $(findstring mls,$TYPE)) instead, since its not unreasonable to think that TYPE=mls makes sense.

Thanks,
Mike

--
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 9 lines · Michael C Thompson

I just discovered a nasty surprise waiting for me in the default Makefile provided by selinux-policy-devel.

Basically, the Makefile produces, on an MLS system, a TYPE value of mls-msc (this is due to the SELINUXTYPE=mls line in /etc/selinux/config). This will not 'enable_mls' for the M4FLAGS, because the Makefile in /usr/share/selinux/devel/include/ does a findstring for '-mls'.

Quoted 5 lines

Dan Walsh has suggested a fix for the default Makefile, but I'm wondering why we can't just change /usr/share/selinux/devel/include/Makefile to do a $(findstring mls,$TYPE)) instead, since its not unreasonable to think that TYPE=mls makes sense.

There is some confusion here, the SELINUXTYPE is not the same as TYPE in refpolicy, it is NAME in refpolicy. The TYPE of the Redhat MLS policy is strict-mls. TYPE=mls does not make sense, since it does not specify if the policy is strict or targeted.

Signature · 7 lines
Chris PeBenito
<[email protected]>
Developer,
Hardened Gentoo Linux
 
Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE6AF9243
Key fingerprint = B0E6 877A 883F A57A 8E6A  CB00 BC8E E42D E6AF 9243
#2 lore raw
Quoted 11 lines · Chris PeBenito
Quoted 5 lines · Michael C Thompson

I just discovered a nasty surprise waiting for me in the default Makefile provided by selinux-policy-devel.

Basically, the Makefile produces, on an MLS system, a TYPE value of mls-msc (this is due to the SELINUXTYPE=mls line in /etc/selinux/config). This will not 'enable_mls' for the M4FLAGS, because the Makefile in /usr/share/selinux/devel/include/ does a findstring for '-mls'.

Dan Walsh has suggested a fix for the default Makefile, but I'm wondering why we can't just change /usr/share/selinux/devel/include/Makefile to do a $(findstring mls,$TYPE)) instead, since its not unreasonable to think that TYPE=mls makes sense.

There is some confusion here, the SELINUXTYPE is not the same as TYPE in refpolicy, it is NAME in refpolicy. The TYPE of the Redhat MLS policy is strict-mls. TYPE=mls does not make sense, since it does not specify if the policy is strict or targeted.

Are there flags (like 'enable_mls') in the policy which require this delineation?

Mike

--
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 17 lines · Michael C Thompson
Quoted 16 lines · Chris PeBenito
Quoted 14 lines · Michael C Thompson

I just discovered a nasty surprise waiting for me in the default Makefile provided by selinux-policy-devel.

Basically, the Makefile produces, on an MLS system, a TYPE value of mls-msc (this is due to the SELINUXTYPE=mls line in /etc/selinux/config). This will not 'enable_mls' for the M4FLAGS, because the Makefile in /usr/share/selinux/devel/include/ does a findstring for '-mls'.

Dan Walsh has suggested a fix for the default Makefile, but I'm wondering why we can't just change /usr/share/selinux/devel/include/Makefile to do a $(findstring mls,$TYPE)) instead, since its not unreasonable to think that TYPE=mls makes sense.

Quoted 7 lines
Quoted 4 lines

There is some confusion here, the SELINUXTYPE is not the same as TYPE in refpolicy, it is NAME in refpolicy. The TYPE of the Redhat MLS policy is strict-mls. TYPE=mls does not make sense, since it does not specify if the policy is strict or targeted.

Are there flags (like 'enable_mls') in the policy which require this delineation?

Yes, strict_policy and targeted_policy.

Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
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.
#4 lore raw
Quoted 17 lines · Christopher J. PeBenito
Quoted 15 lines · Michael C Thompson
Quoted 13 lines · Chris PeBenito
Quoted 6 lines · Michael C Thompson

I just discovered a nasty surprise waiting for me in the default Makefile provided by selinux-policy-devel.

Basically, the Makefile produces, on an MLS system, a TYPE value of mls-msc (this is due to the SELINUXTYPE=mls line in /etc/selinux/config). This will not 'enable_mls' for the M4FLAGS, because the Makefile in /usr/share/selinux/devel/include/ does a findstring for '-mls'.

Dan Walsh has suggested a fix for the default Makefile, but I'm wondering why we can't just change /usr/share/selinux/devel/include/Makefile to do a $(findstring mls,$TYPE)) instead, since its not unreasonable to think that TYPE=mls makes sense.

There is some confusion here, the SELINUXTYPE is not the same as TYPE in refpolicy, it is NAME in refpolicy. The TYPE of the Redhat MLS policy is strict-mls. TYPE=mls does not make sense, since it does not specify if the policy is strict or targeted.

Quoted 6 lines
Quoted 2 lines

Are there flags (like 'enable_mls') in the policy which require this delineation?

Yes, strict_policy and targeted_policy.

The latest Makefile in 2.3.17-2 should work properly.

# installation paths
SHAREDIR := /usr/share/selinux

AWK ?= gawk
NAME ?= $(strip $(shell $(AWK) -F= '/^SELINUXTYPE/{ print $$2 }' /etc/selinux/config))

MLSENABLED := $(shell cat /selinux/mls)
ifeq ($(MLSENABLED),)
MLSENABLED := 1
endif

ifeq ($(MLSENABLED),1)
MCSFLAG=-mcs
endif

ifeq ($(NAME), mls)
NAME = strict
MCSFLAG = -mls
endif

TYPE ?= $(NAME)${MCSFLAG}
HEADERDIR := $(SHAREDIR)/devel/include
include $(HEADERDIR)/Makefile