selinux/libsepol/include/sepol/policydb
Jeff Vander Stoep 80bc7ee8fa Add support for ioctl command whitelisting
Adds support for new policy statements whitelisting individual ioctl
commands. Ioctls provide many of the operations necessary for driver control.
The typical driver supports a device specific set of operations accessible
by the ioctl system call and specified by the command argument. SELinux
provides per operation access control to many system operations e.g. chown,
kill, setuid, ipc_lock, etc. Ioclts on the other hand are granted on a per
file descriptor basis using the ioctl permission, meaning that the set of
operations provided by the driver are granted on an all-or-nothing basis.
In some cases this may be acceptable, but often the same driver provides a
large and diverse set of operations such as benign and necessary functionality
as well as dangerous capabilities or access to system information that should
be restricted.

Example policy:
allow <source> <target>:<class> { 0x8900-0x8905 0x8910 }
auditallow <source> <target>:<class> 0x8901

The ioctl permission is still required in order to make an ioctl call. If no
individual ioctl commands are specified, only the ioctl permission is
checked by the kernel - i.e. status quo. This allows ioctl whitelisting to
done in a targeted manner, protecting desired drivers without requiring every
ioctl command to be known and specified before use and otherwise allowing
existing policy to be used as-is.

This only implements ioctl whitelisting support for monolithic kernel policies
built via checkpolicy. Support for modules and CIL remains to be done.

Bug: 19419509
Change-Id: I198e8c9279b94d8ce4ae5625018daa99577ee970
Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
Acked-by:  Stephen Smalley <sds@tycho.nsa.gov>
2015-04-23 08:30:33 -04:00
..
avrule_block.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
avtab.h Add support for ioctl command whitelisting 2015-04-23 08:30:33 -04:00
conditional.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
constraint.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
context.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
ebitmap.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
expand.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
flask_types.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
flask.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
hashtab.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
hierarchy.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
link.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
mls_types.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
module.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
polcaps.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
policydb.h Add support for ioctl command whitelisting 2015-04-23 08:30:33 -04:00
services.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
sidtab.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
symtab.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
util.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00