restorecon /data/misc/media.

Otherwise it will be mislabeled on upgrades with existing userdata.

Change-Id: Ibde88d5d692ead45b480bb34cfe0831baeffbf94
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Add DC-HSPA+ TCP buffer sizes

Change-Id: I5e7ca981ed79a3563215dd7fcef3504c39e973d5
Add keystore to system group

 * Required in order to request firmware for hardware implementation

Change-Id: Ibd1ba79667d4489f0972b8fba587a8ba9c6083dd
Do not change ownership on /sys/fs/selinux/enforce.

There is no longer any reason to permit system UID to set enforcing mode.

Change-Id: Ie28beed1ca2b215c71f2847e2390cee1af1713c3
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Run the console service shell in the shell domain.

This allows it to be permissive in userdebug/eng builds
but confined/enforcing in user builds.

Change-Id: Ie322eaa0acdbefea2de4e71ae386778c929d042b
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Apply strict SELinux checking of PROT_EXEC on mmap/mprotect calls.

If checkreqprot == 1, SELinux only checks the protection flags passed
by the application, even if the kernel internally adds PROT_EXEC for
READ_IMPLIES_EXEC personality flags.  Switch to checkreqprot == 0
to check the final protection flags applied by the kernel.

Change-Id: Ic39242bbbd104fc9a1bcf2cd2ded7ce1aeadfac4
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Set security context of /adb_keys and /data/misc/adb/adb_keys.

I97b3d86a69681330bba549491a2fb39df6cf20ef introduced a separate type
for the adb_keys file.  Set the security context of the adb_keys file
accordingly by adding restorecon commands to init.rc.

Change-Id: I30e4d2a1ae223a03eadee58a883c79932fff59fe
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Move creation of /data/misc/wifi and /data/misc/dhcp to main init.rc file.

mkdir /data/misc/wifi subdirectories and /data/misc/dhcp is performed
in the various device-specific init*.rc files but seems generic.
Move it to the main init.rc file.

Drop the separate chown for /data/misc/dhcp as this is handled by mkdir
built-in if the directory already exists.

Add a restorecon_recursive /data/misc/wifi/sockets.

Change-Id: I51b09c5e40946673a38732ea9f601b2d047d3b62
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Trigger a policy reload from post-fs-data.

Once userdata is available and decrypted, trigger a policy reload to pick
up any policy update files stored under /data/security.

Change-Id: Ic2b3121c3395429b108c40d1d7f5a3124a5896c5
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Apply restorecon_recursive to all of /data.

With the following prior changes:
I77bf2a0c4c34b1feef6fdf4d6c3bd92dbf32f4a1
I698b1b2c3f00f31fbb2015edf23d33b51aa5bba1
I8dd915d9bb80067339621b905ea2b4ea0fa8d71e
it should now be safe (will correctly label all files)
and reasonably performant (will skip processing unless
file_contexts has changed since the last call) to call
restorecon_recursive /data from init.rc.

The call is placed after the setprop selinux.policy_reload 1 so that
we use any policy update under /data/security if present.

Change-Id: Ib8d9751a47c8e0238cf499fcec61898937945d9d
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Handle policy reloads within ueventd rather than restarting it.

Restarting ueventd upon policy reloads has reportedly created
stability problems for some users and could cause events to be lost.
Stop restarting ueventd and instead handle policy reloads within ueventd.

Also stops restarting installd upon policy reloads.

Change-Id: Ic7f310d69a7c420e48fbc974000cf4a5b9ab4a3b
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Revert "Apply strict SELinux checking of PROT_EXEC on mmap/mprotect calls."

This reverts commit 0ad86b4ec9818a2665d06d97039702bc266ca386.