Commit graph

1990 commits

Author SHA1 Message Date
Nick Kralevich
0d5df96350 am 8dd5053f: Merge "Restore system_app access to system-owned /data directories."
* commit '8dd5053f928a4cff19aba4da2aee30e9bffaf93d':
  Restore system_app access to system-owned /data directories.
2014-05-28 21:01:13 +00:00
Nick Kralevich
8dd5053f92 Merge "Restore system_app access to system-owned /data directories." 2014-05-28 20:56:34 +00:00
Nick Kralevich
685e2f9d9c remove syslog_* from unconfined
As suggested in https://android-review.googlesource.com/95966 , remove
various syslog_* from unconfined. SELinux domains which want to use
syslog_* can declare it themselves.

Change-Id: I7a8335850d1b8d3463491b4ef8c657f57384cfa4
2014-05-28 13:48:52 -07:00
Nick Kralevich
9c463fe7af am 27c702dd: Merge "dontaudit su"
* commit '27c702dd5413764d4d50e33bf33f3da40261c5a1':
  dontaudit su
2014-05-28 13:11:39 +00:00
Nick Kralevich
87fa26409c am f821b5a7: allow shell dmesg
* commit 'f821b5a7977102a417b32f358bf87d1e0cdeb06d':
  allow shell dmesg
2014-05-28 13:11:38 +00:00
Nick Kralevich
27c702dd54 Merge "dontaudit su" 2014-05-28 13:10:46 +00:00
Nick Kralevich
f821b5a797 allow shell dmesg
Allow the shell user to see the dmesg output. This data is already
available via "adb bugreport", but isn't easy to access.

Bug: 10020939
Change-Id: I9d4bbbd41cb02b707cdfee79f826a39c1ec2f177
2014-05-28 13:09:53 +00:00
Torne (Richard Coles)
8e215cf43d am ba176c5f: Merge "Define SELinux policy for RELRO sharing support."
* commit 'ba176c5f0768f92fca411bf130817f32c36581a9':
  Define SELinux policy for RELRO sharing support.
2014-05-28 10:21:04 +00:00
Torne (Richard Coles)
ba176c5f07 Merge "Define SELinux policy for RELRO sharing support." 2014-05-28 10:16:23 +00:00
Nick Kralevich
af7deffb2c dontaudit su
Denials generated from the su domain aren't meaningful security
warnings, and just serve to confuse people. Don't log them.

Change-Id: Id38314d4e7b45062c29bed63df4e50e05e4b131e
2014-05-27 15:46:39 -07:00
Stephen Smalley
f1ea707a3d Restore system_app access to system-owned /data directories.
System UID apps want to be able to create/write to system-owned
/data directories outside of their own /data/data package directory,
such as /data/system/cache and /data/misc/keychain.  Restore access
(which was removed by Ifa10e3283b07f6bd6ecc16eceeb663edfd756cea when
system_app_data_file was introduced for the /data/data package
directories of system UID apps), but audit writes to system_data_file
so we can look at introducing separate types for these directories in
the future and ultimately remove access to the rest of the system-owned
data.

Change-Id: I573f120f23f2dd2d228aa738b31ad2cb3044ec6e
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-05-27 14:32:28 -04:00
Nick Kralevich
7149486724 am 0cefb701: Merge "Remove setting /proc/self/attr/* from unconfined."
* commit '0cefb70170fcc2bf88e0fb3737a2dd0680bdb123':
  Remove setting /proc/self/attr/* from unconfined.
2014-05-27 17:08:05 +00:00
Nick Kralevich
0cefb70170 Merge "Remove setting /proc/self/attr/* from unconfined." 2014-05-27 17:05:36 +00:00
Nick Kralevich
de49e370fd am f4ede35c: Merge "Assert executable content (mostly) only loaded from /system"
* commit 'f4ede35c8e77dc88411da6a5d7073a16dfdd0d3f':
  Assert executable content (mostly) only loaded from /system
2014-05-27 15:16:15 +00:00
Nick Kralevich
f4ede35c8e Merge "Assert executable content (mostly) only loaded from /system" 2014-05-27 15:13:39 +00:00
Nick Kralevich
c3e27bdac1 am 8599e34b: Introduce wakelock_use()
* commit '8599e34b95705638034b798c56bc2cc8bb2e6372':
  Introduce wakelock_use()
2014-05-27 15:05:41 +00:00
Stephen Smalley
f853715d22 Remove setting /proc/self/attr/* from unconfined.
Change I6a2fb1279318625a80f3ea8e3f0932bdbe6df676 removed
these permissions from domain.te and added them to specific domains
as required.  Remove the permissions from unconfineddomain as well
so that they are only allowed where explicitly allowed.  The earlier
change already added the necessary permissions to init, kernel,
and recovery so we do not need to add them here.

Change-Id: Ifeb5438532a7525e64328e1c54b436e9b6f7fd3b
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-05-27 10:41:56 -04:00
Torne (Richard Coles)
9786af2bca Define SELinux policy for RELRO sharing support.
Define a domain and appropriate access rules for shared RELRO files
(used for loading the WebView native library). Any app is permitted to
read the files as they are public data, but only the shared_relro
process is permitted to create/update them.

Bug: 13005501
Change-Id: I9d5ba9e9eedb9b8c80fe6f84a3fc85a68553d52e
2014-05-27 14:17:50 +01:00
Nick Kralevich
629fbc9540 Assert executable content (mostly) only loaded from /system
Add a compile time assertion that most SELinux domains don't
execute code from outside of the system partition.

Exceptions are listed in the neverallow rule.

Change-Id: I8166e29a269adca11661df3c6cda4448a42ca30d
2014-05-23 16:08:23 -07:00
Nick Kralevich
8599e34b95 Introduce wakelock_use()
Introduce wakelock_use(). This macro declares that a domain uses
wakelocks.

Wakelocks require both read-write access to files in /sys/power, and
CAP_BLOCK_SUSPEND. This macro helps ensure that both capabilities and
file access are granted at the same time.

Still TODO: fix device specific wakelock use.

Change-Id: Ib98ff374a73f89e403acd9f5e024988f59f08115
2014-05-23 15:44:40 -07:00
Nick Kralevich
befe065282 am ccb9f7a1: Merge "Label /dev/socket/zygote_secondary"
* commit 'ccb9f7a1000c35721a28c501c52b0ae87dfcb775':
  Label /dev/socket/zygote_secondary
2014-05-23 20:21:32 +00:00
Nick Kralevich
ccb9f7a100 Merge "Label /dev/socket/zygote_secondary" 2014-05-23 20:18:20 +00:00
Stephen Smalley
3ea6027a71 am 356f4be6: Restrict requesting contexts other than policy-defined defaults.
* commit '356f4be679544363466dad93e7bee68b2a6f2cf0':
  Restrict requesting contexts other than policy-defined defaults.
2014-05-23 17:48:25 +00:00
Stephen Smalley
356f4be679 Restrict requesting contexts other than policy-defined defaults.
Writing to the /proc/self/attr files (encapsulated by the libselinux
set*con functions) enables a program to request a specific security
context for various operations instead of the policy-defined defaults.
The security context specified using these calls is checked by an
operation-specific permission, e.g. dyntransition for setcon,
transition for setexeccon, create for setfscreatecon or
setsockcreatecon, but the ability to request a context at all
is controlled by a process permission.  Omit these permissions from
domain.te and only add them back where required so that only specific
domains can even request a context other than the default defined by
the policy.

Change-Id: I6a2fb1279318625a80f3ea8e3f0932bdbe6df676
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-05-23 13:14:22 -04:00
Nick Kralevich
219cef1469 am 4fce0ef9: Fix use of valgrind via app wrapping
* commit '4fce0ef97c2a4cb6e0ce2adf17c012c8be6252bf':
  Fix use of valgrind via app wrapping
2014-05-23 15:03:58 +00:00
Nick Kralevich
7cba5da2f6 Label /dev/socket/zygote_secondary
zygote_secondary talks over a different socket named
/dev/socket/zygote_secondary. Make sure it's properly labeled.

See https://android-review.googlesource.com/89604

Addresses the following denial:

<12>[   48.442004] type=1400 audit(1400801842.179:5): avc:  denied  { write } for  pid=1082 comm="main" name="zygote_secondary" dev="tmpfs" ino=9953 scontext=u:r:system_server:s0 tcontext=u:object_r:socket_device:s0 tclass=sock_file permissive=1

Bug: 13647418
Change-Id: I1ff5f1d614295a5870bb8a3992ad9167e1656c92
2014-05-22 16:51:24 -07:00
Nick Kralevich
4fce0ef97c Fix use of valgrind via app wrapping
On userdebug / eng builds, Android supports the concept of app wrapping.
You can run an app wrapped by another process. This is traditionally used
to run valgrind on apps, looking for memory leaks and other problems.

App wrapping is enabled by running the following command:

  adb shell setprop wrap.com.android.foo "TMPDIR=/data/data/com.android.foo logwrapper valgrind"

Valgrind attempts to mmap exec /system/bin/app_process, which is being denied
by SELinux. Allow app_process exec.

Addresses the following denial:

  <4>[   82.643790] type=1400 audit(16301075.079:26): avc:  denied  { execute } for  pid=1519 comm="memcheck-arm-li" path="/system/bin/app_process32" dev="mmcblk0p25" ino=61 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:zygote_exec:s0 tclass=file

Bug: 15146424

Change-Id: I65394938c53da9252ea57856d9f2de465bb30c25
2014-05-22 15:27:54 -07:00
Nick Kralevich
cb829c60ea am f007d036: make /dev/zero read-write
* commit 'f007d03628f98a40c01c12ad105ca6be14fd3c78':
  make /dev/zero read-write
2014-05-20 20:59:50 +00:00
Nick Kralevich
f007d03628 make /dev/zero read-write
CTS test luni/src/test/java/libcore/java/nio/BufferTest.java function
testDevZeroMapRW() requires us to be able to open /dev/zero in read-write
mode. Allow it.

Change-Id: I2be266875b1d190188376fd84c0996039d3c1524
2014-05-20 13:35:28 -07:00
Nick Kralevich
df3d1f86fa am dcfcdbdf: Merge "Don\'t allow ptrace on keystore"
* commit 'dcfcdbdf49cb81c1133d4c421d138ac0ec073c68':
  Don't allow ptrace on keystore
2014-05-20 16:04:15 +00:00
Nick Kralevich
7fb77b8125 am 77c00a68: Merge "Suppress installd auditallow"
* commit '77c00a68fe1115cafa79dc0fcf7ab9adb98e37f0':
  Suppress installd auditallow
2014-05-20 16:04:14 +00:00
Nick Kralevich
dcfcdbdf49 Merge "Don't allow ptrace on keystore" 2014-05-20 15:59:48 +00:00
Nick Kralevich
77c00a68fe Merge "Suppress installd auditallow" 2014-05-20 15:59:25 +00:00
Nick Kralevich
056dc80716 am fa34d471: unconfined: remove linux_immutable
* commit 'fa34d47185d6431394ffdfbc85d435653e54256a':
  unconfined: remove linux_immutable
2014-05-20 15:55:42 +00:00
Nick Kralevich
fa34d47185 unconfined: remove linux_immutable
As far as I know, this is never used. Get rid of it.

Change-Id: Iee0fb4e3f3952a0c4cc28d0aa96ca6c462ba5211
2014-05-19 22:54:07 -07:00
Nick Kralevich
8aa754c9be Don't allow ptrace on keystore
keystore may hold sensitive information in it's memory. Don't
allow anyone to ptrace keystore.

Change-Id: I4e3717e482b9fd128d38ce687c03122d41678b6f
2014-05-19 21:49:50 -07:00
Nick Kralevich
7a186b3fa8 Suppress installd auditallow
installd is expected to be handling unlabeled apps. Don't
emit an audit rule when it occurs.

Change-Id: Ia173914ff4d1b8368a18f326494eda8173d30192
2014-05-19 16:33:51 -07:00
Nick Kralevich
90901631c7 am 5ce079b9: Bring back the unlabeled allowall rules
* commit '5ce079b9165c18a5bd27b853e82478de8d9e0a7b':
  Bring back the unlabeled allowall rules
2014-05-19 14:27:14 +00:00
Nick Kralevich
5ce079b916 Bring back the unlabeled allowall rules
On an upgrade from 4.2 to tip-of-tree master, there are still a
number of files which aren't properly labeled. Restore the
unlabeled compat rules until we can get everything properly
labeled. It's not ideal, but it works around the immediate
problem.

After applying https://android-review.googlesource.com/94966 ,
I'm still seeing the following denials.

<4>[   12.040639] type=1400 audit(1400289656.430:4): avc:  denied  { read } for  pid=143 comm="installd" name="0" dev=mmcblk0p9 ino=32194 scontext=u:r:installd:s0 tcontext=u:object_r:unlabeled:s0 tclass=lnk_file
<4>[  168.289170] type=1400 audit(1400289812.680:5): avc:  denied  { getattr } for  pid=1079 comm="system_server" path="/data/data/com.android.backupconfirm" dev=mmcblk0p9 ino=112676 scontext=u:r:system_server:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir
<4>[  169.088406] type=1400 audit(1400289813.480:6): avc:  denied  { read } for  pid=143 comm="installd" name="com.android.location.fused" dev=mmcblk0p9 ino=112720 scontext=u:r:installd:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir
<4>[  169.088790] type=1400 audit(1400289813.480:7): avc:  denied  { open } for  pid=143 comm="installd" name="com.android.location.fused" dev=mmcblk0p9 ino=112720 scontext=u:r:installd:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir
<4>[  169.089205] type=1400 audit(1400289813.480:8): avc:  denied  { write } for  pid=143 comm="installd" name="com.android.location.fused" dev=mmcblk0p9 ino=112720 scontext=u:r:installd:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir
<4>[  169.089615] type=1400 audit(1400289813.480:9): avc:  denied  { remove_name } for  pid=143 comm="installd" name="lib" dev=mmcblk0p9 ino=112721 scontext=u:r:installd:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir
<4>[  169.090024] type=1400 audit(1400289813.480:10): avc:  denied  { unlink } for  pid=143 comm="installd" name="lib" dev=mmcblk0p9 ino=112721 scontext=u:r:installd:s0 tcontext=u:object_r:unlabeled:s0 tclass=lnk_file
<4>[  169.090350] type=1400 audit(1400289813.480:11): avc:  denied  { rmdir } for  pid=143 comm="installd" name="com.android.renderscript.cache" dev=mmcblk0p9 ino=112902 scontext=u:r:installd:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir
<4>[  171.875822] type=1400 audit(1400289816.260:12): avc:  denied  { unlink } for  pid=143 comm="installd" name="8882B60ADE91B9E4.toc" dev=mmcblk0p9 ino=112903 scontext=u:r:installd:s0 tcontext=u:object_r:unlabeled:s0 tclass=file
<4>[  180.615263] type=1400 audit(1400289825.000:13): avc:  denied  { rename } for  pid=143 comm="installd" name="BackupTransport.backupScheduler.xml" dev=mmcblk0p9 ino=112852 scontext=u:r:installd:s0 tcontext=u:object_r:unlabeled:s0 tclass=file
<4>[  180.615578] type=1400 audit(1400289825.000:14): avc:  denied  { setattr } for  pid=143 comm="installd" name="BackupTransport.backupScheduler.xml" dev=mmcblk0p9 ino=112852 scontext=u:r:installd:s0 tcontext=u:object_r:unlabeled:s0 tclass=file
<4>[  393.934310] type=1400 audit(1400290038.320:15): avc:  denied  { read } for  pid=2410 comm="d.process.acore" name="0" dev=mmcblk0p9 ino=32194 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:unlabeled:s0 tclass=lnk_file
<4>[  399.370936] type=1400 audit(1400290043.760:16): avc:  denied  { read } for  pid=2998 comm="SharedPreferenc" name="BackupTransport.backupScheduler.xml" dev=mmcblk0p9 ino=112852 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:unlabeled:s0 tclass=file
<4>[  399.371792] type=1400 audit(1400290043.760:17): avc:  denied  { getattr } for  pid=2998 comm="SharedPreferenc" path="/data/data/com.google.android.backuptransport/shared_prefs/BackupTransport.backupScheduler.xml" dev=mmcblk0p9 ino=112852 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:unlabeled:s0 tclass=file
<4>[  399.372219] type=1400 audit(1400290043.760:18): avc:  denied  { open } for  pid=2998 comm="SharedPreferenc" name="BackupTransport.backupScheduler.xml" dev=mmcblk0p9 ino=112852 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:unlabeled:s0 tclass=file

Change-Id: I65dcfa8e77a63cb61551a1010358f0e45956dbbf
2014-05-17 08:42:16 -07:00
Elliott Hughes
676679b1e6 am 7d755eb2: Merge "Allow readlink(2) of /proc from debuggerd."
* commit '7d755eb290494655dc477ff5a5b7bb8958c5ce8c':
  Allow readlink(2) of /proc from debuggerd.
2014-05-17 02:48:16 +00:00
Elliott Hughes
7d755eb290 Merge "Allow readlink(2) of /proc from debuggerd." 2014-05-17 02:45:43 +00:00
Elliott Hughes
38138c245a Allow readlink(2) of /proc from debuggerd.
Bug: 15021938
Change-Id: Id815640302efde3ae089da33ff8e2cb7daee8bfd
2014-05-16 19:14:13 -07:00
Stephen Smalley
115eeaa336 am ef28e767: Make the surfaceflinger domain enforcing.
* commit 'ef28e767036baac3228cdb5060a36a9ff27468d6':
  Make the surfaceflinger domain enforcing.
2014-05-16 18:31:59 +00:00
Stephen Smalley
ef28e76703 Make the surfaceflinger domain enforcing.
Change-Id: Id6d9a7cabc2fe9c18de10c6e9bc0080cdcd7033d
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-05-16 18:27:24 +00:00
dcashman
fe7aba6519 am 2d9e22f9: Merge "Remove duplicate neverallow rule."
* commit '2d9e22f9fb8629e3d5b501cc0390a7bf67b3013a':
  Remove duplicate neverallow rule.
2014-05-16 04:40:13 +00:00
dcashman
2d9e22f9fb Merge "Remove duplicate neverallow rule." 2014-05-16 04:38:37 +00:00
Nick Kralevich
92de005ca3 am cba45592: Merge "Drop unused rules for raw I/O and mknod."
* commit 'cba45592eadd54979729a997e60888ff038d063a':
  Drop unused rules for raw I/O and mknod.
2014-05-15 22:33:38 +00:00
Nick Kralevich
cba45592ea Merge "Drop unused rules for raw I/O and mknod." 2014-05-15 22:30:28 +00:00
Mark Salyzyn
04cb83fc50 am 21e6b4d9: Merge "Allow Developer settings to change runtime size of logd"
* commit '21e6b4d928d94fe2a1dea5de8ea08096e2f2baeb':
  Allow Developer settings to change runtime size of logd
2014-05-15 18:33:01 +00:00
Mark Salyzyn
21e6b4d928 Merge "Allow Developer settings to change runtime size of logd" 2014-05-15 18:12:09 +00:00