Commit graph

3352 commits

Author SHA1 Message Date
Christopher Ferris
88d1cfebe5 resolved conflicts for merge of 313e4056 to lmp-dev-plus-aosp
Change-Id: I2f41cef9b3203117e24f8dba7000d8f4c564dcb8
2014-09-13 16:11:33 -07:00
Christopher Ferris
313e40564a Merge "Allow dumpstate to read /system/bin executables." into lmp-dev 2014-09-13 22:31:44 +00:00
Tyler Gunn
486d66a0d2 am 69cdca91: Renaming Telecomm to Telecom.
* commit '69cdca91e7ff36ad425b9f15b602d44ce374c738':
  Renaming Telecomm to Telecom.
2014-09-13 18:03:10 +00:00
Christopher Ferris
04f3d79077 Allow dumpstate to read /system/bin executables.
On 64 bit systems, it's necessary to read the /system/bin executables
elf header to determine if it's a 32 bit or 64 bit executable to
contact the correct debuggerd service.

Bug: 17487122
Change-Id: Ica78aa54e5abbb051924166c6808b79b516274fe
2014-09-12 22:39:39 -07:00
dcashman
3bf7caed23 am 089d5fb7: Allow appdomain read perms on apk_data_files.
* commit '089d5fb7e9087a7ac28ba65f883ad91613adaec3':
  Allow appdomain read perms on apk_data_files.
2014-09-12 05:59:23 +00:00
Robert Sesek
89db177f20 am 7f4a8a72: isolated_app: Do not allow access to the gpu_device.
* commit '7f4a8a7291ab17385c86fe768b7e0912068ed7d5':
  isolated_app: Do not allow access to the gpu_device.
2014-09-12 05:59:23 +00:00
dcashman
089d5fb7e9 Allow appdomain read perms on apk_data_files.
Address:
type=1400 audit(0.0:103): avc: denied { read } for name="arm" dev="mmcblk0p28" ino=195471 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=dir

(cherrypick of commit 711895db28)

Bug: 16204150
Change-Id: I8bf0172b26b780c110c0d95c691785143acd7dd2
2014-09-11 20:38:44 +00:00
Robert Sesek
7f4a8a7291 isolated_app: Do not allow access to the gpu_device.
Bug: 17471434
Change-Id: I6fd1079be29a454f46ab84f0c43fcf816e679c98
2014-09-11 15:42:15 -04:00
Robin Lee
f67092fb7d am 72acd6bb: Allow system reset_uid, sync_uid, password_uid
* commit '72acd6bbbe65f8d776028a4097c427fd1dad235b':
  Allow system reset_uid, sync_uid, password_uid
2014-09-11 18:54:16 +00:00
Robin Lee
72acd6bbbe Allow system reset_uid, sync_uid, password_uid
Permits the system server to change keystore passwords for users other
than primary.

(cherrypicked from commit de08be8aa0)

Bug: 16233206
Change-Id: I7941707ca66ac25bd122fd22e5e0f639e7af697e
2014-09-11 11:21:56 -07:00
Stephen Smalley
ee6b8da8e9 am 45731c70: Annotate MLS trusted subjects and objects.
* commit '45731c70ef446b5981697b9675b2d738da09a23d':
  Annotate MLS trusted subjects and objects.
2014-09-11 18:08:40 +00:00
Tyler Gunn
69cdca91e7 Renaming Telecomm to Telecom.
- Changing package from android.telecomm to android.telecom
- Changing package from com.android.telecomm to
com.android.server.telecomm.
- Renaming TelecommManager to TelecomManager.

Bug: 17364651
Change-Id: I70e9ecdab7482327f25387ecc6223f46e9cbe10e
2014-09-10 15:17:57 -07:00
dcashman
f49e622dc1 resolved conflicts for merge of 0406189c to lmp-dev-plus-aosp
Change-Id: Ic7d1d55cfb7e2391eef1b6ad216b74b723c53f96
2014-09-09 17:43:10 -07:00
Nick Kralevich
7026b8a86c am b0a99513: Allow kernel thread to read app data files
* commit 'b0a99513b299b59094577c01b5fe42f52def7de7':
  Allow kernel thread to read app data files
2014-09-09 22:04:03 +00:00
dcashman
0406189c5c Merge "Enable selinux read_policy for adb pull." into lmp-dev 2014-09-09 21:46:13 +00:00
dcashman
309cc668f9 Enable selinux read_policy for adb pull.
Remove permission from appdomain.

Bug: 16866291

Change-Id: I37936fed33c337e1ab2816258c2aff52700af116
2014-09-09 14:28:25 -07:00
Nick Kralevich
b0a99513b2 Allow kernel thread to read app data files
When vold mounts an OBB on behalf of another application, the kernel
spins up the "loop0" thread to perform the mount operation. Grant
the kernel thread the ability to read app data files, so the mount
operation can succeed.

Steps to reproduce:

  1) Run: runtest --path cts/tests/tests/os/src/android/os/storage/cts/StorageManagerTest.java

Expected:

  1) All tests pass

Actual:

  Test failure, with the following error message:

  loop0   : type=1400 audit(0.0:46): avc: denied { read } for path="/data/data/com.android.cts.stub/files/test1.obb" dev="mmcblk0p16" ino=115465 scontext=u:r:kernel:s0 tcontext=u:object_r:app_data_file:s0 tclass=file permissive=0
  Vold    : Image mount failed (I/O error)
  MountService: Couldn't mount OBB file: -1
  StorageManager: Received message.  path=/data/data/com.android.cts.stub/files/test1.obb, state=21
  TestRunner: failed: testMountAndUnmountObbNormal(android.os.storage.cts.StorageManagerTest)
  TestRunner: ----- begin exception -----
  TestRunner: junit.framework.AssertionFailedError: OBB should be mounted
  TestRunner:    at junit.framework.Assert.fail(Assert.java:50)
  TestRunner:    at junit.framework.Assert.assertTrue(Assert.java:20)
  TestRunner:    at android.os.storage.cts.StorageManagerTest.mountObb(StorageManagerTest.java:235)

Bug: 17428116
Change-Id: Id1a39a809b6c3942ff7e08884b40e3e4eec73b6a
2014-09-09 14:12:18 -07:00
dcashman
43b8bc53ab resolved conflicts for merge of 47bd7300 to lmp-dev-plus-aosp
Change-Id: I9631fb1774893d2eeccd7f1f5a867cb5dd98d53d
2014-09-09 13:56:05 -07:00
dcashman
47bd7300a5 Add support for factory reset protection.
Address the following denials:
<12>[  417.732129] type=1400 audit(365340.189:47): avc: denied { read } for pid=1737 comm="Binder_2" name="mmcblk0p18" dev="tmpfs" ino=12406 scontext=u:r:system_server:s0 tcontext=u:object_r:block_device:s0 tclass=blk_file permissive=0
<12>[  417.882126] type=1400 audit(365340.339:48): avc: denied { read } for pid=1737 comm="Binder_2" name="mmcblk0p18" dev="tmpfs" ino=12406 scontext=u:r:system_server:s0 tcontext=u:object_r:block_device:s0 tclass=blk_file permissive=0

Bug: 16710840
Change-Id: I8cb5b4b17dffe14f0bf05d63eb8f6ab8d5c09f53
2014-09-08 14:27:45 -07:00
Stephen Smalley
45731c70ef Annotate MLS trusted subjects and objects.
When using MLS (i.e. enabling levelFrom= in seapp_contexts),
certain domains and types must be exempted from the normal
constraints defined in the mls file.  Beyond the current
set, adbd, logd, mdnsd, netd, and servicemanager need to
be able to read/write to any level in order to communicate
with apps running with any level, and the logdr and logdw
sockets need to be writable by apps running with any level.

This change has no impact unless levelFrom= is specified in
seapp_contexts, so by itself it is a no-op.

Change-Id: I36ed382b04a60a472e245a77055db294d3e708c3
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-09-08 16:06:40 -04:00
Nick Kralevich
1ed3ec8596 am 5fc825c9: sdcardd: grant unmount
* commit '5fc825c91715ad0b983b42986e93070eb7ce333d':
  sdcardd: grant unmount
2014-09-04 22:20:49 +00:00
Nick Kralevich
5fc825c917 sdcardd: grant unmount
If the sdcard daemon is restarted (crash or otherwise), one of the first
things it attempts to do is umount the previously mounted /mnt/shell/emulated
fuse filesystem, which is denied by SELinux with the following denial:

  sdcard  : type=1400 audit(0.0:6997): avc: denied { unmount } for scontext=u:r:sdcardd:s0 tcontext=u:object_r:fuse:s0 tclass=filesystem permissive=0

Allow the operation.

Steps to reproduce:

  1) adb shell into the device and su to root
  2) run "kill -9 [PID OF SDCARD]

Expected:

  sdcard daemon successfully restarts without error message.

Actual:

  SELinux denial above, plus attempts to mount a new filesystem
  on top of the existing filesystem.

(cherrypicked from commit abfd427a32)

Bug: 17383009
Change-Id: I386bfc98e2b5b32b1d11408f7cfbd6e3c1af68f4
2014-09-04 13:40:06 -07:00
Nick Kralevich
59755451b6 am abfd427a: sdcardd: grant unmount
* commit 'abfd427a3226a8bb696e5e5b9239f5445a680f6c':
  sdcardd: grant unmount
2014-09-04 20:12:33 +00:00
Nick Kralevich
abfd427a32 sdcardd: grant unmount
If the sdcard daemon is restarted (crash or otherwise), one of the first
things it attempts to do is umount the previously mounted /mnt/shell/emulated
fuse filesystem, which is denied by SELinux with the following denial:

  sdcard  : type=1400 audit(0.0:6997): avc: denied { unmount } for scontext=u:r:sdcardd:s0 tcontext=u:object_r:fuse:s0 tclass=filesystem permissive=0

Allow the operation.

Steps to reproduce:

  1) adb shell into the device and su to root
  2) run "kill -9 [PID OF SDCARD]

Expected:

  sdcard daemon successfully restarts without error message.

Actual:

  SELinux denial above, plus attempts to mount a new filesystem
  on top of the existing filesystem.

Bug: 17383009
Change-Id: I386bfc98e2b5b32b1d11408f7cfbd6e3c1af68f4
2014-09-04 11:04:23 -07:00
Mark Salyzyn
3d879d4872 am bcdff890: logd: permit app access to clear logs
* commit 'bcdff890304e694c09bf0a4a90fb76a82434fa57':
  logd: permit app access to clear logs
2014-09-03 05:07:37 +00:00
Stephen Smalley
3f0ce9e096 am 018e9402: Prohibit reading of untrusted symlinks via neverallow.
* commit '018e9402c656c20289ea382dc72f958aa7e054d1':
  Prohibit reading of untrusted symlinks via neverallow.
2014-09-02 21:26:08 +00:00
Stephen Smalley
018e9402c6 Prohibit reading of untrusted symlinks via neverallow.
Change-Id: Id669fa1850edf2adee230e71bca2278f215e39f4
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-09-02 17:05:44 -04:00
Mark Salyzyn
e6c865e1b6 am 60f0be84: logd: permit app access to clear logs
* commit '60f0be84c0cf3a895c6b95ee8387b71e1b0c6d83':
  logd: permit app access to clear logs
2014-09-01 18:52:16 +00:00
Mark Salyzyn
bcdff89030 logd: permit app access to clear logs
I/auditd(19949): type=1400 audit(0.0:71): avc:  denied  { write } for  comm="logcat" name="logd" dev="tmpfs" ino=5924 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:logd_socket:s0 tclass=sock_file

(cherry picked from 60f0be84c0)

Bug: 17323719
Change-Id: Id8399195196ffad884eef98030d544c68ed0596f
2014-09-01 18:39:26 +00:00
Mark Salyzyn
60f0be84c0 logd: permit app access to clear logs
I/auditd(19949): type=1400 audit(0.0:71): avc:  denied  { write } for  comm="logcat" name="logd" dev="tmpfs" ino=5924 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:logd_socket:s0 tclass=sock_file

Bug: 17323719
Change-Id: Id8399195196ffad884eef98030d544c68ed0596f
2014-09-01 18:33:29 +00:00
Robin Lee
f9ea564a9e am de08be8a: Allow system reset_uid, sync_uid, password_uid
* commit 'de08be8aa006c313e5025ba5f032abf786a39f71':
  Allow system reset_uid, sync_uid, password_uid
2014-08-29 23:55:15 +00:00
Robin Lee
de08be8aa0 Allow system reset_uid, sync_uid, password_uid
Permits the system server to change keystore passwords for users other
than primary.

Bug: 16233206
Change-Id: I7941707ca66ac25bd122fd22e5e0f639e7af697e
2014-08-29 23:48:07 +01:00
Brian Carlstrom
35651b33ae am 372d0df7: Remove system_server create access from /data/dalvik-cache
* commit '372d0df796389e2f6295a394492585ed64f0ceca':
  Remove system_server create access from /data/dalvik-cache
2014-08-29 18:49:03 +00:00
Brian Carlstrom
bd6d1f385b am 09eae908: Remove system_server create access from /data/dalvik-cache
* commit '09eae90890d4a2545358b8ba104e1f2a46df1408':
  Remove system_server create access from /data/dalvik-cache
2014-08-29 11:39:57 +00:00
Brian Carlstrom
09eae90890 Remove system_server create access from /data/dalvik-cache
Bug: 16875245

(cherry picked from commit 372d0df796)

Change-Id: I38fa14226ab94df2029ca60d3c8898f46c1824c7
2014-08-28 21:36:27 -07:00
Brian Carlstrom
372d0df796 Remove system_server create access from /data/dalvik-cache
Bug: 16875245
Change-Id: I2487a80896a4a923fb1fa606f537df9f6ad4220a
2014-08-28 21:15:38 -07:00
dcashman
2fd17bc8c1 am 67d58acb: Merge "Add permissive domains check to sepolicy-analyze." into lmp-dev
* commit '67d58acb9b8d28dddeb9670e9801962b6fd7dcfd':
  Add permissive domains check to sepolicy-analyze.
2014-08-28 03:37:40 +00:00
dcashman
67d58acb9b Merge "Add permissive domains check to sepolicy-analyze." into lmp-dev 2014-08-27 23:56:55 +00:00
Nick Kralevich
5a4e67c6ef am 28b26bcf: support kernel writes to external SDcards
* commit '28b26bcf42e12add8a3f431555ea9c1005216357':
  support kernel writes to external SDcards
2014-08-27 22:42:09 +00:00
dcashman
c30dd63f56 Add permissive domains check to sepolicy-analyze.
Also enable global reading of kernel policy file. Motivation for this is to
allow read access to the kernel version of the binary selinux policy.

Bug: 17288791

Change-Id: I1eefb457cea1164a8aa9eeb7683b3d99ee56ca99
2014-08-27 14:54:48 -07:00
Nick Kralevich
e829ec3da0 am 4c6b1350: support kernel writes to external SDcards
* commit '4c6b13508d1786a3a835ba5427f37e963c2c7506':
  support kernel writes to external SDcards
2014-08-27 19:54:24 +00:00
Nick Kralevich
28b26bcf42 support kernel writes to external SDcards
The kernel, when it creates a loop block device, starts a new
kernel thread "loop0" (drivers/block/loop.c). This kernel thread,
which performs writes on behalf of other processes, needs read/write
privileges to the sdcard. Allow it.

Steps to reproduce:
0) Get device with external, removable sdcard
1) Run: "adb install -s foo.apk"

Expected:

  APK installs successfully.

Actual:

  APK fails to install. Error message:

    Vold  E  Failed to write superblock (I/O error)
    loop0  W  type=1400 audit(0.0:3123): avc: denied { read } for path="/mnt/secure/asec/smdl1645334795.tmp.asec" dev="mmcblk1p1" ino=528 scontext=u:r:kernel:s0 tcontext=u:object_r:vfat:s0 tclass=file permissive=0
    PackageHelper  E  Failed to create secure container smdl1645334795.tmp
    DefContainer  E  Failed to create container smdl1645334795.tmp

Bug: 17158723

(cherry picked from commit 4c6b13508d)

Change-Id: Iea727ac7958fc31d85a037ac79badbe9c85693bd
2014-08-27 12:38:27 -07:00
Nick Kralevich
4c6b13508d support kernel writes to external SDcards
The kernel, when it creates a loop block device, starts a new
kernel thread "loop0" (drivers/block/loop.c). This kernel thread,
which performs writes on behalf of other processes, needs read/write
privileges to the sdcard. Allow it.

Steps to reproduce:
0) Get device with external, removable sdcard
1) Run: "adb install -s foo.apk"

Expected:

  APK installs successfully.

Actual:

  APK fails to install. Error message:

    Vold  E  Failed to write superblock (I/O error)
    loop0  W  type=1400 audit(0.0:3123): avc: denied { read } for path="/mnt/secure/asec/smdl1645334795.tmp.asec" dev="mmcblk1p1" ino=528 scontext=u:r:kernel:s0 tcontext=u:object_r:vfat:s0 tclass=file permissive=0
    PackageHelper  E  Failed to create secure container smdl1645334795.tmp
    DefContainer  E  Failed to create container smdl1645334795.tmp

Bug: 17158723
Change-Id: I4aa86e372cc55348f6b8becfa17bd4da583925d4
2014-08-27 12:13:28 -07:00
dcashman
c6f9d44ddf am 711895db: Allow appdomain read perms on apk_data_files.
* commit '711895db2897bc5d001899eb5e0f931c79a1ad3f':
  Allow appdomain read perms on apk_data_files.
2014-08-27 18:17:10 +00:00
dcashman
711895db28 Allow appdomain read perms on apk_data_files.
Address:
type=1400 audit(0.0:103): avc: denied { read } for name="arm" dev="mmcblk0p28" ino=195471 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=dir

Bug: 16204150
Change-Id: I8bf0172b26b780c110c0d95c691785143acd7dd2
2014-08-27 10:22:02 -07:00
dcashman
0812ac4891 am 85f255b8: DO NOT MERGE. Allow debuggerd read access to shared_relro files.
* commit '85f255b8e6a30f7e40fd70bccf51d8138be5d0ba':
  DO NOT MERGE. Allow debuggerd read access to shared_relro files.
2014-08-26 15:39:01 +00:00
Nick Kralevich
106050f8e8 am 0d3f7ddc: remove appdomain\'s ability to examine all of /proc
* commit '0d3f7ddc70572382edec58841b3d6262abf49f49':
  remove appdomain's ability to examine all of /proc
2014-08-25 20:44:04 +00:00
Nick Kralevich
0d3f7ddc70 remove appdomain's ability to examine all of /proc
Remove the CTS specific rule which allows appdomain processes
to view /proc entries for the rest of the system. With this change,
an SELinux domain will only be able to view it's own /proc
entries, e.g. untrusted_app can only view /proc entries for other
untrusted_app, system_app can only view /proc entries for other
system_apps, etc.

/proc contains sensitive information, and we want to avoid
leaking this information between app security domains.

Bug: 17254920
Change-Id: I59da37dde00107a5ab123df3b79a84afa855339f
2014-08-25 12:55:19 -07:00
Nick Kralevich
eb8e3d60c9 am 92d1aa19: Merge "assert that no domain can set default properties"
* commit '92d1aa1982a05a370ec15edbf61f4b7c257df18c':
  assert that no domain can set default properties
2014-08-25 18:03:24 +00:00
Nick Kralevich
92d1aa1982 Merge "assert that no domain can set default properties" 2014-08-25 15:40:47 +00:00