Commit graph

3605 commits

Author SHA1 Message Date
Nick Kralevich
06985b1d50 Merge "Allow adbd to write to /data/adb" 2014-10-21 17:02:07 +00:00
Nick Kralevich
973877dbc1 Allow adbd to write to /data/adb
adbd writes debugging information to /data/adb
when persist.adb.trace_mask is set. Allow it.

Bug: https://code.google.com/p/android/issues/detail?id=72895
Change-Id: Ia5af09045e9f72a95325b429c30a5ae78e104bdc
2014-10-21 16:15:52 +00:00
Stephen Smalley
3da1ffbad0 Remove block_device:blk_file access from fsck.
Now that we have assigned specific types to userdata and cache
block devices, we can remove the ability of fsck to run on other
block devices.

Change-Id: I8cfb3dc0e4ebe6b73346ff291ecb11397bb0c2d0
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-10-21 01:56:37 +00:00
Nick Kralevich
d0b1a44e5f am beb279c7: allow init swapon()
* commit 'beb279c7ea23abc77641e891a76e9bceb6f38883':
  allow init swapon()
2014-10-20 19:58:50 +00:00
Nick Kralevich
beb279c7ea allow init swapon()
swapon(2) requires write access to the underlying block device.
Allow it.

Addresses the following denial:

   avc:  denied  { write } for  pid=1 comm="init" name="zram0" dev="tmpfs" ino=6267 scontext=u:r:init:s0 tcontext=u:object_r:swap_block_device:s0 tclass=blk_file permissive=0

Change-Id: Id1a4f51038d0b6ce7351294698a0ff146d6e4643
2014-10-20 11:52:19 -07:00
Nick Kralevich
61027bc5ef am 57a17d14: add support for fsck.f2fs
* commit '57a17d143405c400bc03b134af5af10959c53d76':
  add support for fsck.f2fs
2014-10-20 18:52:04 +00:00
Nick Kralevich
57a17d1434 add support for fsck.f2fs
The Nexus 9 uses f2fs for /data. Make sure to properly label
/system/bin/fsck.f2fs so that the appropriate domain transition occurs.
Add support for getattr on devpts, required for fsck.f2fs.

Addresses the following denials:

  avc:  denied  { execute_no_trans } for  pid=172 comm="init" path="/system/bin/fsck.f2fs" dev="dm-0" ino=272 scontext=u:r:init:s0 tcontext=u:object_r:system_file:s0 tclass=file permissive=0
  avc:  denied  { getattr } for  pid=170 comm="fsck.f2fs" path="/dev/pts/0" dev="devpts" ino=3 scontext=u:r:fsck:s0 tcontext=u:object_r:devpts:s0 tclass=chr_file permissive=1

Change-Id: I34b3f91374d1eb3fb4ba76abce14ff67db259f96
2014-10-20 10:42:19 -07:00
Nick Kralevich
5f12c83d04 am ad151a23: Merge "Label block devices created or accessed by vold with specific types."
* commit 'ad151a233a51a76f5d3c1a6289daa8a03025b8ab':
  Label block devices created or accessed by vold with specific types.
2014-10-18 23:09:11 +00:00
Nick Kralevich
f146ff1ee8 am 44cb98a7: Revert "Do not allow isolated_app to directly open app data files."
* commit '44cb98a7647303aedc9f89ef9a14937f59bec6ed':
  Revert "Do not allow isolated_app to directly open app data files."
2014-10-18 23:09:10 +00:00
Nick Kralevich
ad151a233a Merge "Label block devices created or accessed by vold with specific types." 2014-10-18 23:01:39 +00:00
Nick Kralevich
44cb98a764 Revert "Do not allow isolated_app to directly open app data files."
This is causing the version of Chrome in Android's tree to crash. The
version of Chrome in Android's tree does not have the following patch:
https://codereview.chromium.org/630123003

Until Chrome updates the version in Android's tree, we need to revert.

Works around the following denials:

audit(0.0:19): avc: denied { search } for name="com.android.chrome" dev="mmcblk0p28" ino=1474658 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir
audit(0.0:20): avc: denied { getattr } for path="/data/data/com.android.chrome" dev="mmcblk0p28" ino=1474658 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir
audit(0.0:21): avc: denied { getattr } for path="/data/data/com.android.chrome" dev="mmcblk0p28" ino=1474658 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir

This reverts commit 669a977303.

Bug: 18006219
Change-Id: Id44137ec6a0dfe4a597b34ab3dad9e3feecc2a5e
2014-10-17 18:30:18 +00:00
Stephen Smalley
382895d839 am e9623d8f: Exclude isolated_app from ptrace self.
* commit 'e9623d8fe698c4600660ec4a7598f0d6cf083e3a':
  Exclude isolated_app from ptrace self.
2014-10-17 07:44:15 +00:00
Nick Kralevich
eb40dfb214 am 38936af0: Fix compile time / CTS gps_data_files neverallow assertion
* commit '38936af0f5273980679fcb2c6d641768da82068a':
  Fix compile time / CTS gps_data_files neverallow assertion
2014-10-17 07:44:15 +00:00
Nick Kralevich
3d223bbdea am 480374e4: Fix compile time / CTS gps_data_files neverallow assertion
* commit '480374e4d082238a71773f29483c5d24ad8b3f6d':
  Fix compile time / CTS gps_data_files neverallow assertion
2014-10-17 07:25:17 +00:00
Stephen Smalley
e9623d8fe6 Exclude isolated_app from ptrace self.
Change-Id: I29136a805d2329806afc9d5d81af934a1803d8e0
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-10-16 23:42:03 +00:00
Nick Kralevich
38936af0f5 Fix compile time / CTS gps_data_files neverallow assertion
Currently, zygote spawned apps are prohibited from modifying GPS
data files. If someone tries to allow GPS access to any app domain,
it generates a compile time / CTS exception.

Relax the rules slightly for system_app. These apps run with UID=system,
and shouldn't be banned from handling gps data files.

This change doesn't add or remove any SELinux rules. Rather, it just
relaxes a compile time assertion, allow partners to create SELinux
rules allowing the access if they desire.

(cherrypick from commit 480374e4d0)

Bug: 18021422
Change-Id: Iad0c6a3627efe129246e2c817f6f71d2735eba93
2014-10-16 15:45:25 -07:00
Nick Kralevich
480374e4d0 Fix compile time / CTS gps_data_files neverallow assertion
Currently, zygote spawned apps are prohibited from modifying GPS
data files. If someone tries to allow GPS access to any app domain,
it generates a compile time / CTS exception.

Relax the rules slightly for system_app. These apps run with UID=system,
and shouldn't be banned from handling gps data files.

This change doesn't add or remove any SELinux rules. Rather, it just
relaxes a compile time assertion, allow partners to create SELinux
rules allowing the access if they desire.

Bug: 18021422
Change-Id: Iad0c6a3627efe129246e2c817f6f71d2735eba93
2014-10-16 22:31:39 +00:00
Mark Salyzyn
a8be885375 am 664ef57b: logd: Add klogd
* commit '664ef57be49889a329c599655f6be7a188c404d3':
  logd: Add klogd
2014-10-16 21:45:37 +00:00
Mark Salyzyn
664ef57be4 logd: Add klogd
Change-Id: Ib9bc89b05771a12c6bb9a25cf59ea51afd22ae15
2014-10-16 12:02:33 -07:00
Robin Lee
5871d1bc18 resolved conflicts for merge of 51bfecf4 to lmp-dev-plus-aosp
Change-Id: I8ea400354e33a01d3223b4efced6db76ba00aed6
2014-10-15 23:11:59 +01:00
Robin Lee
51bfecf49d Pull keychain-data policy out of system-data
Migrators should be allowed to write to /data/misc/keychain in order
to remove it. Similarly /data/misc/user should be writable by system
apps.

TODO: Revoke zygote's rights to read from /data/misc/keychain on
behalf of some preloaded security classes.

Bug: 17811821
Change-Id: I9e9c6883cff1dca3755732225404909c16a0e547
2014-10-15 18:02:03 +00:00
Nick Kralevich
ca582ac9a4 am 74bbf703: maybe fix mac build.
* commit '74bbf703df6ddedbd7aab9ae099fd7c90dc04048':
  maybe fix mac build.
2014-10-15 03:48:32 +00:00
Nick Kralevich
74bbf703df maybe fix mac build.
1 warning generated.
  external/sepolicy/tools/sepolicy-analyze.c:446:27: error: implicit declaration of function 'isspace' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          while (p < end && isspace(*p))
                          ^
  1 error generated.
  make: *** [out/host/darwin-x86/obj32/EXECUTABLES/sepolicy-analyze_intermediates/sepolicy-analyze.o] Error 1
  make: *** Waiting for unfinished jobs....

Change-Id: I250dcef7c726d5b66835dc51c057e472b801aa2c
2014-10-14 20:35:23 -07:00
Daniel Cashman
446724bfa2 am ddd47b0b: Merge "Add neverallow checking to sepolicy-analyze."
* commit 'ddd47b0b5288c4860100ff722844b30f882d50d0':
  Add neverallow checking to sepolicy-analyze.
2014-10-14 22:54:56 +00:00
Daniel Cashman
ddd47b0b52 Merge "Add neverallow checking to sepolicy-analyze." 2014-10-14 22:45:42 +00:00
Nick Kralevich
8e4754e42f am 8c6dba90: fix whitespace
* commit '8c6dba90a570608a600184741a4a59bf4db1230d':
  fix whitespace
2014-10-14 22:21:14 +00:00
Nick Kralevich
8c6dba90a5 fix whitespace
Change-Id: I2911d2b5d1931c6f6245cc54465458a8a3c2b2bb
2014-10-14 15:07:49 -07:00
Stephen Smalley
59906bf893 Add neverallow checking to sepolicy-analyze.
See NEVERALLOW CHECKING in tools/README for documentation.

Depends on change I45b3502ff96b1d093574e1fecff93a582f8d00bd
for libsepol to support reporting all neverallow failures.

Change-Id: I47c16ccb910ac730c092cb3ab977c59cb8197ce0
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-10-14 10:17:40 -04:00
Stephen Smalley
575c4654dd am 669a9773: Do not allow isolated_app to directly open app data files.
* commit '669a97730376e919813411fcfdddac35bd7236ae':
  Do not allow isolated_app to directly open app data files.
2014-10-12 00:38:24 +00:00
Nick Kralevich
4d23729275 am ebfd9f87: allow oemfs:dir search
* commit 'ebfd9f87197f4a39bbc2a5e4f6c6dffc28be36d7':
  allow oemfs:dir search
2014-10-10 23:18:56 +00:00
Nick Kralevich
ebfd9f8719 allow oemfs:dir search
mediaserver and drmserver both have permission to read oemfs
related files. However, there are no search permissions on the
directory, so the files would be unreachable.

Grant search permissions on the oemfs directory, so that the files
within that directory can be read.

Bug: 17954291
Change-Id: I9e36dc7b940bd46774753c1fa07b0f47c36ff0db
2014-10-10 16:11:03 -07:00
Nick Kralevich
7fe94a1c79 am 2380d05f: allow system_server oemfs read access
* commit '2380d05f9791b6789b81e28ca8841df1b8b62c6d':
  allow system_server oemfs read access
2014-10-10 23:09:21 +00:00
Nick Kralevich
2380d05f97 allow system_server oemfs read access
Bug: 17954291
Change-Id: Ia904fff65df5142732928561d81ea0ece0c52a8d
2014-10-10 22:59:16 +00:00
Stephen Smalley
956c042239 am 59bc00ab: Remove net_domain() from isolated_app.
* commit '59bc00ab898bc4d06593051b0fe4e702ca2569e2':
  Remove net_domain() from isolated_app.
2014-10-06 23:39:13 +00:00
Stephen Smalley
669a977303 Do not allow isolated_app to directly open app data files.
Only allow it to read/write/stat already open app data files
received via Binder or local socket IPC.

Change-Id: I3c096607a74fd0f360d41f3e6f06535ca00c58ec
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-10-06 23:31:18 +00:00
Mike Lockwood
2043a28e5b resolved conflicts for merge of 0a52df50 to lmp-dev-plus-aosp
Change-Id: I3c6af086fc8ca3e9600c2267c439718c9a572dfb
2014-10-06 11:56:31 -07:00
Stephen Smalley
59bc00ab89 Remove net_domain() from isolated_app.
isolated_app performs no direct network socket communication, so
we can remove net_domain() from it.

Change-Id: I112aa4140fd577a5ea28f7a3d62567ebabcdb48d
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-10-03 11:50:29 -04:00
Mike Lockwood
0a52df5020 Give bootanimation access to /dev/snd files so it can use tinyalsa
Bug: 17674304

Change-Id: Ide32833809bca8d3ed8ddc898748e25d7a692319
2014-10-02 16:26:59 -07:00
Nick Kralevich
11488fa322 am c6cb6ac4: Merge "isolated_app: remove app_data_file execute"
* commit 'c6cb6ac451b0faf6e9344282a909e910f819a296':
  isolated_app: remove app_data_file execute
2014-10-02 16:08:33 +00:00
Stephen Smalley
e923f65a80 am 206b1a6c: Define specific block device types for system and recovery partitions.
* commit '206b1a6c45f1bae25906018d9c5d968330106826':
  Define specific block device types for system and recovery partitions.
2014-10-02 16:08:33 +00:00
Stephen Smalley
273d7ea4ca Label block devices created or accessed by vold with specific types.
Assign a more specific type than block_device to all
block devices created or accessed by vold.   Allow vold
to set the context on the device nodes it creates.

vold can create extra loop devices (/dev/block/loopN) and
block devices for volumes it manages (/dev/block/vold/M:N).

vold can read/write device mapper block devices (/dev/block/dm-N)
created for encrypted volumes.

vold can read/write metadata partitions used to store encryption metadata.
The metadata_block_device type should be assigned in device-specific
policy to the partition specified by the encryptable= mount option
for the userata entry in the fstab.<board> file.

This change does not remove the ability to create or read/write
generic block_device devices by vold, so it should not break anything.
It does add an auditallow statement on such accesses so that we can track
remaining cases where we need to label such device nodes so that we can
ultimately remove this access.

Change-Id: Id3bea28f5958086716cd3db055bea309b3b5fa5a
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-10-02 13:29:25 +00:00
Nick Kralevich
c6cb6ac451 Merge "isolated_app: remove app_data_file execute" 2014-10-02 13:14:48 +00:00
Stephen Smalley
206b1a6c45 Define specific block device types for system and recovery partitions.
Define a specific block device type for system so that we can
prevent raw writes to the system partition by anything other than
recovery.

Define a specific block device type for recovery so that we
can prevent raw writes to the recovery partition by anything
other than install_recovery or recovery.

These types must be assigned to specific block device nodes
via device-specific policy.  This change merely defines the types,
adds allow rules so that nothing will break when the types are assigned,
and adds neverallow rules to prevent adding further allow rules
on these types.

This change does not remove access to the generic block_device type
from any domain so nothing should break even on devices without these
type assignments.

Change-Id: Ie9c1f6d632f6e9e8cbba106f07f6b1979d2a3c4a
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-10-02 09:00:41 -04:00
Nick Kralevich
94f9ff8750 isolated_app: remove app_data_file execute
In commit ad891591e6, we allowed
isolated processes to execute files from /data/data/APPNAME.

I'm pretty sure all the necessary linker changes have been made
so that this functionality isn't required anymore. Remove the
allow rule.

This is essentially a revert of ad891591e6.

Change-Id: I1b073916f66f4965dfc53c0ea2b624bbb2fe8816
2014-10-01 16:03:27 -07:00
Nick Kralevich
f6a0ca25da am eb5b76aa: Merge "Mark asec_apk_file as mlstrustedobject."
* commit 'eb5b76aa904db6fe5210f1aa4e051016a077ed42':
  Mark asec_apk_file as mlstrustedobject.
2014-09-30 23:52:03 +00:00
Stephen Smalley
6435c10a23 am cedee697: Fix fsck-related denials with encrypted userdata.
* commit 'cedee697c3683ac267c0933200e6727f0910d2e6':
  Fix fsck-related denials with encrypted userdata.
2014-09-30 23:51:58 +00:00
Nick Kralevich
eb5b76aa90 Merge "Mark asec_apk_file as mlstrustedobject." 2014-09-30 19:34:55 +00:00
Stephen Smalley
cedee697c3 Fix fsck-related denials with encrypted userdata.
Allow error reporting via the pty supplied by init.
Allow vold to invoke fsck for checking volumes.

Addresses denials such as:
avc:  denied  { ioctl } for  pid=133 comm="e2fsck" path="/dev/pts/0" dev="devpts" ino=3 scontext=u:r:fsck:s0 tcontext=u:object_r:devpts:s0 tclass=chr_file

avc: denied { execute } for pid=201 comm="vold" name="e2fsck" dev="mmcblk0p25" ino=98 scontext=u:r:vold:s0 tcontext=u:object_r:fsck_exec:s0 tclass=file

These denials show up if you have encrypted userdata.

Change-Id: Idc8e6f83a0751f17cde0ee5e4b1fbd6efe164e4c
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-09-30 13:49:58 -04:00
Stephen Smalley
476c207840 Mark asec_apk_file as mlstrustedobject.
Resolves denials such as:
avc:  denied  { write } for  pid=1546 comm="Binder_1" name="/" dev="dm-0" ino=2 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:asec_apk_file:s0 tclass=dir

This is required to install a forward-locked app.

Change-Id: I2b37a56d087bff7baf82c738896d9563f0ab4fc4
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-09-30 11:12:55 -04:00
William Roberts
d9fab4f7e2 am 92dfa31f: seinfo for platform based domains should be stated explicitly.
* commit '92dfa31f7800ff9184e8525dfd471211c90b9d31':
  seinfo for platform based domains should be stated explicitly.
2014-09-30 04:46:29 +00:00