linux/scripts
Stephen Smalley c6d3aaa4e3 selinux: dynamic class/perm discovery
Modify SELinux to dynamically discover class and permission values
upon policy load, based on the dynamic object class/perm discovery
logic from libselinux.  A mapping is created between kernel-private
class and permission indices used outside the security server and the
policy values used within the security server.

The mappings are only applied upon kernel-internal computations;
similar mappings for the private indices of userspace object managers
is handled on a per-object manager basis by the userspace AVC.  The
interfaces for compute_av and transition_sid are split for kernel
vs. userspace; the userspace functions are distinguished by a _user
suffix.

The kernel-private class indices are no longer tied to the policy
values and thus do not need to skip indices for userspace classes;
thus the kernel class index values are compressed.  The flask.h
definitions were regenerated by deleting the userspace classes from
refpolicy's definitions and then regenerating the headers.  Going
forward, we can just maintain the flask.h, av_permissions.h, and
classmap.h definitions separately from policy as they are no longer
tied to the policy values.  The next patch introduces a utility to
automate generation of flask.h and av_permissions.h from the
classmap.h definitions.

The older kernel class and permission string tables are removed and
replaced by a single security class mapping table that is walked at
policy load to generate the mapping.  The old kernel class validation
logic is completely replaced by the mapping logic.

The handle unknown logic is reworked.  reject_unknown=1 is handled
when the mappings are computed at policy load time, similar to the old
handling by the class validation logic.  allow_unknown=1 is handled
when computing and mapping decisions - if the permission was not able
to be mapped (i.e. undefined, mapped to zero), then it is
automatically added to the allowed vector.  If the class was not able
to be mapped (i.e. undefined, mapped to zero), then all permissions
are allowed for it if allow_unknown=1.

avc_audit leverages the new security class mapping table to lookup the
class and permission names from the kernel-private indices.

The mdp program is updated to use the new table when generating the
class definitions and allow rules for a minimal boot policy for the
kernel.  It should be noted that this policy will not include any
userspace classes, nor will its policy index values for the kernel
classes correspond with the ones in refpolicy (they will instead match
the kernel-private indices).

Signed-off-by:  Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
2009-10-07 21:56:42 +11:00
..
basic Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next 2009-09-23 15:37:02 -07:00
dtc powerpc: Have git ignore generated files from dtc compile 2009-06-26 14:37:23 +10:00
genksyms Documentation/: fix warnings from -Wmissing-prototypes in HOSTCFLAGS 2009-09-23 07:39:28 -07:00
kconfig kbuild: add static to prototypes 2009-09-20 12:27:44 +02:00
ksymoops
mod spi: prefix modalias with "spi:" 2009-09-23 07:39:43 -07:00
package kbuild, deb-pkg: fix install scripts for posix sh 2009-07-17 23:02:57 +02:00
rt-tester
selinux selinux: dynamic class/perm discovery 2009-10-07 21:56:42 +11:00
tracing tracing, perf: Convert the power tracer into an event tracer 2009-09-19 11:42:12 +02:00
.gitignore gitignore: ignore scripts/ihex2fw 2009-06-27 00:17:48 +02:00
Kbuild.include kbuild: fix cc1 options check to ensure we do not use -fPIC when compiling 2009-09-20 12:27:43 +02:00
Lindent
Makefile sparc: Kill PROM console driver. 2009-09-15 17:04:38 -07:00
Makefile.build kbuild: Don't define ALIGN and ENTRY when preprocessing linker scripts. 2009-09-21 06:27:08 +02:00
Makefile.clean
Makefile.fwinst
Makefile.headersinst kbuild: fix "Argument list too long" error for "make headers_check", 2009-06-09 22:37:56 +02:00
Makefile.host
Makefile.lib gcov: add gcov profiling infrastructure 2009-06-18 13:03:57 -07:00
Makefile.modinst
Makefile.modpost tracing: Remove markers 2009-09-18 21:22:08 +02:00
bin2c.c
binoffset.c
bloat-o-meter
bootgraph.pl bootgraph: fix for use with dot symbols 2009-02-15 12:50:08 +01:00
checkincludes.pl checkincludes.pl: add option to remove duplicates in place 2009-09-20 12:27:43 +02:00
checkkconfigsymbols.sh
checkpatch.pl checkpatch: add some common Blackfin checks 2009-09-22 07:17:48 -07:00
checkstack.pl
checksyscalls.sh asm-generic: add a generic unistd.h 2009-06-11 21:02:16 +02:00
checkversion.pl
cleanfile
cleanpatch
config kbuild: add generic --set-str option to scripts/config 2009-06-14 22:48:08 +02:00
conmakehash.c Fix all -Wmissing-prototypes warnings in x86 defconfig 2009-09-23 07:39:28 -07:00
decodecode
diffconfig
export_report.pl
extract-ikconfig kconfig: have extract-ikconfig read ELF files 2009-08-18 22:00:18 -04:00
gcc-version.sh Remove bashisms from scripts 2009-06-09 22:37:54 +02:00
gcc-x86_32-has-stack-protector.sh stackprotector: fix multi-word cross-builds 2009-02-11 12:17:29 +01:00
gcc-x86_64-has-stack-protector.sh stackprotector: fix multi-word cross-builds 2009-02-11 12:17:29 +01:00
gen_initramfs_list.sh kbuild: fix spurious initramfs rebuild 2009-04-11 08:18:12 +02:00
get_maintainer.pl scripts/get_maintainer.pl: add maintainers in order listed in matched section 2009-09-22 07:17:46 -07:00
gfp-translate mm: add a gfp-translate script to help understand page allocation failure reports 2009-06-16 19:47:44 -07:00
headerdep.pl kbuild: fix option processing for -I in headerdep 2009-04-11 08:18:07 +02:00
headers.sh kbuild: clean up scripts/headers.sh 2009-06-09 22:37:43 +02:00
headers_check.pl kbuild/headers_check: refine extern check 2009-06-09 22:37:56 +02:00
headers_install.pl
kallsyms.c kallsyms: fix segfault in prefix_underscores_count() 2009-09-23 07:39:30 -07:00
kernel-doc kernel-doc: allow multi-line declaration purpose descriptions 2009-09-18 09:48:52 -07:00
makelst
markup_oops.pl markup_oops: use modinfo to avoid confusion with underscored module names 2009-09-20 12:27:43 +02:00
mkcompile_h
mkmakefile
mksysmap
mkuboot.sh
mkversion
module-common.lds linker script: throw away .discard section 2009-06-24 15:13:38 +09:00
namespace.pl
patch-kernel
pnmtologo.c fbdev: work around old compiler bug 2009-06-30 18:55:59 -07:00
profile2linkerlist.pl
recordmcount.pl Merge branch 'linus' into tracing/core 2009-08-11 14:19:09 +02:00
setlocalversion kbuild: fix delay in setlocalversion on readonly source 2009-06-14 22:26:00 +02:00
show_delta
tags.sh ctags: usability fix 2009-09-20 12:27:43 +02:00
unifdef.c kbuild: fix headers_exports with boolean expression 2009-06-09 22:37:57 +02:00
ver_linux Remove bashisms from scripts 2009-06-09 22:37:54 +02:00