Commit graph

5100 commits

Author SHA1 Message Date
Bruce Beare
59019fd72a Define the i2C device policy
Change-Id: I93d9cfea2f2148bb042d1cb8af3649524ad31034
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2015-10-27 16:40:54 -07:00
Jeff Vander Stoep
9ba8ade5d2 Fix MTP sync
Address the following denial:
avc: denied { use } for path="/storage/emulated/0/305512.pdf" dev="fuse"
ino=239 scontext=u:r:kernel:s0 tcontext=u:r:priv_app:s0:c512,c768 tclass=fd
permissive=0

Bug: 25068662
Change-Id: Ic29d9569ff387dfd411363db751c3642572c8e85
2015-10-26 20:32:49 -07:00
Jeff Vander Stoep
7b8f9f153e audit untrusted_app access to mtp_device
android.process.media moved to priv_app. Add audit rule to test if
untrusted_app still requires access or if some/all permissions may
be removed.

Bug: 25085347
Change-Id: I13bae9c09bd1627b2c06ae84b069778984f9bd5d
2015-10-23 18:03:01 +00:00
Jeff Vander Stoep
0fc831c3b0 Temporarily downgrade to policy version number
Temporarily move from policy version 30 to 29 until device kernels
and prebuilts are all upgraded to the accepted upstream version of
the selinux ioctl command whitelisting code.

(cherry picked from commit 89765083f7)

Bug: 22846070

Change-Id: I31d1e80aaee164cf41a2f01c6ca846a000898ef4
2015-10-23 10:16:00 -07:00
Jeffrey Vander Stoep
1b52ad6be1 Merge "grant priv_app access to /dev/mtp_usb" 2015-10-19 21:31:05 +00:00
Jeff Vander Stoep
bcbb32e763 grant priv_app access to /dev/mtp_usb
android.process.media needs access to mtp_usb when MTP is enabled.

Bug: 25074672
Change-Id: Ic48a3ba8e4395104b0b957f7a9bad69f0e5ee38e
2015-10-19 13:07:15 -07:00
Jeff Vander Stoep
a910a287d8 Remove untrusted_app access to tmp apk files
Verifier has moved to the priv_app domain. Neverallow app domain
access to tmp apk files with exceptions for platform and priv app
domains.

Change-Id: I68a2fa39ebc7dc0bfa278fe7d092655f21a5225d
2015-10-19 18:19:31 +00:00
Jeffrey Vander Stoep
f1203bf05f Merge "Remove untrusted_app access to cache" 2015-10-19 18:06:38 +00:00
Jeff Vander Stoep
7f09a94596 Policy for priv_app domain
Verifier needs access to apk files.
avc: denied { search } for pid=11905 comm="ackageinstaller" name="vmdl2040420713.tmp" dev="dm-2" ino=13647 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:apk_tmp_file:s0 tclass=dir permissive=0

Give bluetooth_manager_service and trust_service the app_api_service
attribute.
avc:  denied  { find } for service=bluetooth_manager pid=7916 uid=10058 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:bluetooth_manager_service:s0 tclass=service_manager permissive=0
avc:  denied  { find } for service=trust pid=25664 uid=10069 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:trust_service:s0 tclass=service_manager permissive=0

Bug: 25066911
Change-Id: I6be695546f8a951e3329c1ec412936b8637e5835
2015-10-19 10:35:20 -07:00
Jeff Vander Stoep
734e4d7c50 Give services app_api_service attribute
avc:  denied  { find } for service=network_management pid=4503 uid=10070 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:network_management_service:s0 tclass=service_manager
avc:  denied  { find } for service=netstats pid=4503 uid=10070 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:netstats_service:s0 tclass=service_manager permissive=0

Bug: 25022496
Change-Id: Ib6eac76b680fed3eca7e4942c6b0e375f12b6496
2015-10-17 19:24:11 +00:00
Jeffrey Vander Stoep
b1eced68d2 Merge "grant webviewupdate_service app_api_service attribute" 2015-10-16 21:56:59 +00:00
Jeff Vander Stoep
7813cc8de0 grant webviewupdate_service app_api_service attribute
avc:  denied  { find } for service=webviewupdate pid=11399 uid=10070 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:webviewupdate_service:s0 tclass=service_manager permissive=0

Bug: 25018574
Change-Id: I26a7846d1c80c1ab3842813f4148528030b1106a
2015-10-16 14:53:11 -07:00
Jeff Vander Stoep
68748c2166 Remove untrusted_app access to cache
neverallow access to untrusted_app and isolated app

Access to cache is a system|signature permission. Only
priv/system/platform apps should be allowed access.

Change-Id: I7ebd38ce6d39950e74c0a164479bc59e694c852d
2015-10-16 14:51:55 -07:00
Jeffrey Vander Stoep
636138054c Merge "Privileged apps require access to cache" 2015-10-16 00:05:26 +00:00
Jeff Vander Stoep
879df83384 Privileged apps require access to cache
gmscore uses cache for updates

Bug: 24977552
Change-Id: I45a713fcfc70b71a2de712e77b64fb9feab67dd7
2015-10-15 15:17:01 -07:00
Nick Kralevich
745b440641 bluetooth.te: Relax bluetooth neverallow rule.
Bug: 24866874

(cherry picked from commit 33a779fecb)

Change-Id: I0a9d4a30859b384cb3621c80568ef9da06ad44f6
2015-10-15 14:18:52 -07:00
Nick Kralevich
43cd0ccefc allow shell self:process ptrace;
Allow the non-privileged adb shell user to run strace. Without
this patch, the command "strace /system/bin/ls" fails with the
following error:

  shell@android:/ $ strace /system/bin/ls
  strace: ptrace(PTRACE_TRACEME, ...): Permission denied
  +++ exited with 1 +++

Change-Id: I207fe0f71941bff55dbeb6fe130e636418f333ee
2015-10-15 13:38:12 -07:00
Jeffrey Vander Stoep
1d2eaf92c3 Merge "Allow bluetooth to find the drmservice" 2015-10-15 17:08:45 +00:00
Jeffrey Vander Stoep
d62fac7d09 Merge "Remove permissions for untrusted_app" 2015-10-14 21:34:00 +00:00
Jeff Vander Stoep
0d186fcf89 Remove permissions for untrusted_app
Privileged apps now run in the priv_app domain. Remove permissions
from untrusted_app that were originaly added for GMS core, Finsky, and
Play store.

Bug: 22033466
Change-Id: Ibdce72ad629bfab47de92ac19542e8902e02c8be
2015-10-14 14:29:30 -07:00
Jeff Vander Stoep
ee9c0b5fb6 Add priv_app domain to global seapp_context
Assign priviliged apps not signed with the platform key to the priv_app
domain.

Bug: 22033466
Change-Id: Idf7fbe7adbdc326835a179b554f96951b69395bc
2015-10-14 21:23:54 +00:00
Nick Kralevich
26cdf1e090 Merge "neverallow: domain:file execute and entrypoint" 2015-10-14 20:23:39 +00:00
Nick Kralevich
82bdd796e1 system_server: (eng builds) remove JIT capabilities
23cde8776b removed JIT capabilities
from system_server for user and userdebug builds. Remove the capability
from eng builds to be consistent across build types.

Add a neverallow rule (compile time assertion + CTS test) to verify
this doesn't regress on our devices or partner devices.

Bug: 23468805
Bug: 24915206
Change-Id: Ib2154255c611b8812aa1092631a89bc59a27514b
2015-10-14 09:41:47 -07:00
William Roberts
f25304ee84 neverallow: domain:file execute and entrypoint
Occasionally, files get labeled with the domain type rather
than the executable file type. This can work if the author
uses domain_auto_trans() versus init_daemon_domain(). This
will cause a lot of issues and is typically not what the
author intended.

Another case where exec on domain type might occur, is if
someone attempts to execute a /proc/pid file, this also
does not make sense.

To prevent this, we add a neverallow.

Change-Id: I39aff58c8f5a2f17bafcd2be33ed387199963b5f
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2015-10-13 20:15:38 -07:00
Nick Kralevich
de11f5017c Remove ptrace from app.te
Remove ptrace from app.te, and only add it to the app domains
which explicitly require it.

Change-Id: I327aabd154ae07ce90e3529dee2b324ca125dd16
2015-10-13 16:21:16 -07:00
William Roberts
59c23d78c8 neverallow: non-property types property_service set
To prevent assigning non property types to properties, introduce
a neverallow to prevent non property_type types from being  set.

Change-Id: Iba9b5988fe0b6fca4a79ca1d467ec50539479fd5
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2015-10-10 20:18:52 +00:00
Johan Redestig
32e5e31a63 Allow bluetooth to find the drmservice
Address the following denial:
  SELinux  E  avc:  denied  { find } for service=drm.drmManager scontext=u:r:bluetooth:s0 tcontext=u:object_r:drmserver_service:s0

This denial is triggered by Bluetooth when MmsFileProvider.java is
using the PduPersister which in turn is using DRM.

Change-Id: I4c077635f8afa39e6bc5e10178c3a7ae3cb6a9ea
2015-10-08 17:18:00 +00:00
Nick Kralevich
9e6effa15f delete procrank SELinux domain.
Simplify SELinux policy by deleting the procrank SELinux domain.
procrank only exists on userdebug/eng builds, and anyone wanting
to run procrank can just su to root.

Bug: 18342188
Change-Id: I71adc86a137c21f170d983e320ab55be79457c16
2015-10-07 16:44:15 -07:00
Jeff Vander Stoep
de53051a82 Do not allow untrusted_app to open tun_device
Third party vpn apps must receive open tun fd from the framework
for device traffic.

neverallow untrusted_app open perm and auditallow bluetooth
access to see if the neverallow rule can be expanded to include
all of appdomain.

Bug: 24677682
Change-Id: I68685587228a1044fe1e0f96d4dc08c2adbebe78
2015-10-07 20:40:24 +00:00
David Zeuthen
a10f789d28 Move update_engine policy to AOSP.
The update_engine daemon from Brillo is expected to be used also in
Android so move its selinux policy to AOSP.

Put update_engine in the whitelist (currently only has the recovery
there) allowing it to bypass the notallow for writing to partititions
labeled as system_block_device.

Also introduce the misc_block_device dev_type as update_engine in some
configurations may need to read/write the misc partition. Start
migrating uncrypt to use this instead of overly broad
block_device:blk_file access.

Bug: 23186405
Test: Manually tested with Brillo build.

Change-Id: Icf8cdb4133d4bbdf14bacc6c0fa7418810ac307a
2015-10-07 15:43:20 -04:00
Nick Kralevich
7e86e19d58 remove "allow vold block_device:blk_file create_file_perms;"
vold hasn't use the generic "block_device" label since
commit 273d7ea4ca (Sept 2014), and
the auditallow statement in vold hasn't triggered since that time.

Remove the rule which allows vold access to the generic block_device
label, and remove the vold exception.

Thanks to jorgelo for reminding me about this.

Change-Id: Idd6cdc20f5be9a40c5c8f6d43bbf902a475ba1c9
2015-10-06 16:05:27 -07:00
Jeffrey Vander Stoep
a1d78ff788 am b01a18b9: Merge "grant installd rx perms on toybox"
* commit 'b01a18b99e775f81e01a0f873e37301b82f8519e':
  grant installd rx perms on toybox
2015-10-03 02:22:57 +00:00
Jeffrey Vander Stoep
b01a18b99e Merge "grant installd rx perms on toybox" 2015-10-03 02:17:50 +00:00
Jeff Vander Stoep
628e7f7c50 grant installd rx perms on toybox
Installd uses cp when relocating apps to sdcard.

avc: denied { execute } for name="toybox" dev="mmcblk0p10" ino=315 scontext=u:r:installd:s0 tcontext=u:object_r:toolbox_exec:s0 tclass=file

Bug: 24617685
Change-Id: Id1a3039bbfc187c074aa50d426278964c40e4bde
2015-10-02 17:01:00 -07:00
William Roberts
f88e31ea90 am 7fc865a4: service_contexts: don\'t delete intermediate on failure
* commit '7fc865a4caec1a2ced41918449e34596f50f8c43':
  service_contexts: don't delete intermediate on failure
2015-10-01 22:24:59 +00:00
William Roberts
630fd5d80c am dcffd2b4: property_contexts: don\'t delete intermediate on failure
* commit 'dcffd2b482a625a99233d82019d7b96919c41600':
  property_contexts: don't delete intermediate on failure
2015-10-01 22:11:37 +00:00
Colin Cross
0f1b1f353b am 9eb6c874: Revert "property_contexts: don\'t delete intermediate on failure"
* commit '9eb6c87439da2b00699f644a8b8c335bf8cd9680':
  Revert "property_contexts: don't delete intermediate on failure"
2015-10-01 22:11:33 +00:00
Colin Cross
2a41cb70a7 am efcaecab: Revert "service_contexts: don\'t delete intermediate on failure"
* commit 'efcaecab4eb075fdc69942e6915999458fb5f88b':
  Revert "service_contexts: don't delete intermediate on failure"
2015-10-01 22:11:32 +00:00
Jeffrey Vander Stoep
4f821319f7 am 23c42c38: Merge "service_contexts: don\'t delete intermediate on failure"
* commit '23c42c389b07f6ebda69ca8e834c27b27460879a':
  service_contexts: don't delete intermediate on failure
2015-10-01 22:11:25 +00:00
Jeffrey Vander Stoep
89c1fd2582 am e6e94762: Merge "property_contexts: don\'t delete intermediate on failure"
* commit 'e6e947622514bdf0b80bf093c0df1a7d9ae12c37':
  property_contexts: don't delete intermediate on failure
2015-10-01 22:11:24 +00:00
William Roberts
7fc865a4ca service_contexts: don't delete intermediate on failure
When service_contexts fails to build, the file is deleted
leaving only the error message for debugging. Build
service_contexts and general variant as a temporary
intermediate before running checkfc.

Change-Id: Ib9dcbf21d0a28700d500cf0ea4e412b009758d5d
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2015-10-01 22:01:50 +00:00
William Roberts
dcffd2b482 property_contexts: don't delete intermediate on failure
When property_contexts fails to build, the file is deleted
leaving only the error message for debugging. Build
property_contexts and general variant as a temporary
intermediate before running checkfc.

Change-Id: Ia86eb0480c9493ceab36fed779b2fe6ab85d2b3d
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2015-10-01 14:56:19 -07:00
Colin Cross
9eb6c87439 Revert "property_contexts: don't delete intermediate on failure"
This reverts commit 7f81b337bc.

Change-Id: I79834d0ef3adbf2eed53b07d17160876e2a999c6
2015-10-01 21:25:55 +00:00
Colin Cross
efcaecab4e Revert "service_contexts: don't delete intermediate on failure"
This reverts commit f6ee7a5219.

Change-Id: I4f1396e6e4aeecd1109f9c24494c6e82645c0663
2015-10-01 21:25:25 +00:00
Jeffrey Vander Stoep
23c42c389b Merge "service_contexts: don't delete intermediate on failure" 2015-10-01 21:02:09 +00:00
Jeffrey Vander Stoep
e6e9476225 Merge "property_contexts: don't delete intermediate on failure" 2015-10-01 21:02:01 +00:00
Nick Kralevich
ef908d6139 am 331c2e96: Merge "Add audit_read permission to capability2"
* commit '331c2e9602be6039640f3a5c0138406dbf849528':
  Add audit_read permission to capability2
2015-10-01 13:03:47 +00:00
Nick Kralevich
331c2e9602 Merge "Add audit_read permission to capability2" 2015-10-01 12:59:41 +00:00
Woojung Min
3198cb5100 Add audit_read permission to capability2
In kernel 3.18 following error message is seen
since audit_read is added to capability2 at classmap.h
So add audit_read permission to capability2.

SELinux:  Permission audit_read in class capability2 not defined in policy.
SELinux: the above unknown classes and permissions will be denied

The kernel change from AOSP is:
3a101b8de0%5E%21/security/selinux/include/classmap.h

Change-Id: I236fbb8ac575c5cb8df097014da6395e20378175
Signed-off-by: Woojung Min <wmin@nvidia.com>
2015-10-01 17:37:23 +09:00
William Roberts
f6ee7a5219 service_contexts: don't delete intermediate on failure
When service_contexts fails to build, the file is deleted
leaving only the error message for debugging. Build
service_contexts and general variant as a temporary
intermediate before running checkfc.

Change-Id: Ib9c9247d36e6a6406b4df84d10e982921c07d492
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2015-09-29 14:25:01 -07:00