linux/scripts
Serge E. Hallyn 93c06cbbf9 selinux: add support for installing a dummy policy (v2)
In August 2006 I posted a patch generating a minimal SELinux policy.  This
week, David P. Quigley posted an updated version of that as a patch against
the kernel.  It also had nice logic for auto-installing the policy.

Following is David's original patch intro (preserved especially
bc it has stats on the generated policies):

se interested in the changes there were only two significant
changes. The first is that the iteration through the list of classes
used NULL as a sentinel value. The problem with this is that the
class_to_string array actually has NULL entries in its table as place
holders for the user space object classes.

The second change was that it would seem at some point the initial sids
table was NULL terminated. This is no longer the case so that iteration
has to be done on array length instead of looking for NULL.

Some statistics on the policy that it generates:

The policy consists of 523 lines which contain no blank lines. Of those
523 lines 453 of them are class, permission, and initial sid
definitions. These lines are usually little to no concern to the policy
developer since they will not be adding object classes or permissions.
Of the remaining 70 lines there is one type, one role, and one user
statement. The remaining lines are broken into three portions. The first
group are TE allow rules which make up 29 of the remaining lines, the
second is assignment of labels to the initial sids which consist of 27
lines, and file system labeling statements which are the remaining 11.

In addition to the policy.conf generated there is a single file_contexts
file containing two lines which labels the entire system with base_t.

This policy generates a policy.23 binary that is 7920 bytes.

(then a few versions later...):

The new policy is 587 lines (stripped of blank lines) with 476 of those
lines being the boilerplate that I mentioned last time. The remaining
111 lines have the 3 lines for type, user, and role, 70 lines for the
allow rules (one for each object class including user space object
classes), 27 lines to assign types to the initial sids, and 11 lines for
file system labeling. The policy binary is 9194 bytes.

Changelog:

	Aug 26: Added Documentation/SELinux.txt
	Aug 26: Incorporated a set of comments by Stephen Smalley:
		1. auto-setup SELINUXTYPE=dummy
		2. don't auto-install if selinux is enabled with
			non-dummy policy
		3. don't re-compute policy version
		4. /sbin/setfiles not /usr/sbin/setfiles
	Aug 22: As per JMorris comments, made sure make distclean
		cleans up the mdp directory.
		Removed a check for file_contexts which is now
		created in the same file as the check, making it
		superfluous.

Signed-off-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: David Quigley <dpquigl@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
2008-08-27 08:54:08 +10:00
..
basic kernel-doc: new P directive for DOC: sections 2008-01-28 23:14:35 +01:00
genksyms kbuild: genksyms: Include extern information in dumps 2008-07-31 23:01:31 +02:00
kconfig kconfig: scripts/kconfig/zconf.l: add %option noinput 2008-07-30 22:29:50 +02:00
ksymoops Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mod scripts/mod/modpost.c: fix spelling of module and happens 2008-07-30 09:41:46 -07:00
package Kbuild: Fix deb-pkg target to work with kernel versions ending with -<text-without-digit> 2008-02-09 10:51:47 +01:00
rt-tester [PATCH] rtmutex: Modify rtmutex-tester to test the setscheduler propagation 2006-06-27 17:32:47 -07:00
selinux selinux: add support for installing a dummy policy (v2) 2008-08-27 08:54:08 +10:00
.gitignore Add binoffset to gitignore 2008-02-09 10:43:58 +01:00
bin2c.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
binoffset.c update the email address of Randy Dunlap 2006-01-03 13:37:51 +01:00
bloat-o-meter fix bloat-o-meter for ppc64 2007-12-17 19:28:17 -08:00
checkincludes.pl Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
checkkconfigsymbols.sh kbuild: script to check for undefined Kconfig symbols 2007-10-12 21:13:50 +02:00
checkpatch.pl checkpatch: version 0.21 2008-07-24 10:47:27 -07:00
checkstack.pl fix checkstack.pl arch detection 2008-07-25 10:53:27 -07:00
checksyscalls.sh i386/x86_64: move headers to include/asm-x86 2007-10-11 11:20:03 +02:00
checkversion.pl kbuild: introduce utsrelease.h 2006-07-03 23:30:54 +02:00
cleanfile scripts: Make cleanfile/cleanpatch warn about long lines 2007-07-16 21:15:50 +02:00
cleanpatch scripts: Make cleanfile/cleanpatch warn about long lines 2007-07-16 21:15:50 +02:00
conmakehash.c [PATCH] kbuild: signed char fixes for scripts 2005-07-27 22:27:08 +02:00
decodecode Mark 'scripts/decodecode' executable 2008-05-30 14:02:21 -07:00
diffconfig kconfig: add diffconfig utility 2008-07-25 22:12:41 +02:00
export_report.pl kbuild: fix perl usage in export_report.pl 2007-10-12 21:13:50 +02:00
extract-ikconfig [PATCH] extract-ikconfig: don't use --long-options 2006-03-24 07:33:21 -08:00
gcc-version.sh kbuild: fix buglet in gcc-version.sh 2008-01-28 23:14:36 +01:00
gcc-x86_64-has-stack-protector.sh [PATCH] Add the -fstack-protector option to the CFLAGS 2006-09-26 10:52:39 +02:00
gen_initramfs_list.sh kbuild: fix unportability in gen_initramfs_list.sh 2008-04-28 22:50:51 +02:00
headers_check.pl kbuild: optimize headers_* targets 2008-07-25 22:12:16 +02:00
headers_install.pl kbuild: install all headers when arch is changed 2008-07-25 22:12:18 +02:00
headers.sh kbuild: prepare headers_* for arch/$ARCH/include 2008-07-25 22:12:33 +02:00
kallsyms.c kbuild: filter away debug symbols from kernel symbols 2008-05-19 20:07:58 +02:00
Kbuild.include kbuild: fix make V=1 2008-02-11 17:43:54 +01:00
kernel-doc kernel-doc: handle/strip __init 2008-07-25 22:12:38 +02:00
Lindent scripts/Lindent: support gnu indent v2.2.10 2008-04-29 08:06:04 -07:00
Makefile selinux: add support for installing a dummy policy (v2) 2008-08-27 08:54:08 +10:00
Makefile.build kbuild: fix some minor typoes 2008-04-25 20:18:48 +02:00
Makefile.clean kbuild: fix some minor typoes 2008-04-25 20:18:48 +02:00
Makefile.fwinst firmware: create firmware binaries during 'make modules'. 2008-07-25 14:26:30 -04:00
Makefile.headersinst kbuild: install all headers when arch is changed 2008-07-25 22:12:18 +02:00
Makefile.host kbuild: fix some minor typoes 2008-04-25 20:18:48 +02:00
Makefile.lib kbuild: create new CFLAGS_REMOVE_(basename).o option 2008-05-23 22:43:33 +02:00
Makefile.modinst kbuild: fix installing external modules 2008-01-28 23:14:36 +01:00
Makefile.modpost markers: fix duplicate modpost entry 2008-07-22 09:59:41 -07:00
makelst kbuild: introduce ccflags-y, asflags-y and ldflags-y 2007-10-15 22:25:06 +02:00
mkcompile_h kbuild: override build timestamp & version 2007-05-02 20:58:09 +02:00
mkmakefile kbuild: scripts/mkmakefile: dynamic determination of output directory 2008-01-28 23:14:38 +01:00
mksysmap kbuild: filter away debug symbols from kernel symbols 2008-05-19 20:07:58 +02:00
mkuboot.sh kbuild/mkuboot.sh: allow spaces in CROSS_COMPILE 2007-05-02 20:58:10 +02:00
mkversion Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
namespace.pl x86: fixup the x86 namespace change in scripts/namespace.pl 2007-10-11 17:56:02 +02:00
patch-kernel kbuild: eradicate bashisms in scripts/patch-kernel 2008-01-28 23:14:37 +01:00
pnmtologo.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
profile2linkerlist.pl [PATCH] x86_64: Basic reorder infrastructure 2006-03-25 09:10:56 -08:00
setlocalversion setlocalversion: do not describe if there is nothing to describe 2008-07-25 22:12:53 +02:00
show_delta kbuild: fix mode of checkstack.pl and other files. 2006-04-11 13:37:07 +02:00
unifdef.c kbuild: replace use of strlcpy with a dedicated implmentation in unifdef 2006-09-25 09:00:00 +02:00
ver_linux kbuild: scripts/ver_linux: don't set PATH 2008-07-31 23:36:54 +02:00