Commit Graph

19072 Commits

Author SHA1 Message Date
Nick Kralevich
c4ab8edf74 global_macros: trim back various watch* permissions
Commit dddbaaf1e8 ("update sepolicy
for fs notification hooks") updated global macros, and added
watch, watch_mount, watch_sb, watch_with_perm, and watch_reads
to r_file_perms and r_dir_perms.

In retrospect, the commit was overly permissive and some of the
permissions shouldn't be granted by default. In particular:

1) watch_with_perm: This is only used with fanotify and requires
CAP_SYS_ADMIN. fanotify has limited use cases, including virus scanning
and hierarchical storage management. Granting this by default makes it
harder to audit and understand this powerful capability. In particular,
anti-virus file like monitoring is something which inherently conflicts
with Android app privacy guarantees and would need to be carefully
reviewed.

2) watch_mount & watch_sb: Setting a watch on a mount (FAN_MARK_MOUNT)
or superblock (FAN_MARK_FILESYSTEM) should be extremely unusual.
Granting this by default makes it harder to audit and understand.

Both "watch" and "watch_reads" are retained for now.

References:
* https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ac5656d8a4cdd93cd2c74355ed12e5617817e0e7
* dddbaaf1e8

Test: compiles
Change-Id: Ib74e7119853eb991e0e9828645c7f9e076b919c4
2019-08-28 12:36:58 -07:00
Steven Moreland
961bf003d6 Merge "Clarify vendor_service/vintf_service." 2019-08-28 17:50:41 +00:00
Treehugger Robot
ac74f62cd5 Merge "Give map permission to viewcompiler" 2019-08-28 14:27:36 +00:00
Treehugger Robot
7981b230b0 Merge "update sepolicy for fs notification hooks" 2019-08-28 10:41:40 +00:00
Steven Moreland
517d7f0db6 Merge "System service neverallow, make full_treble_only." 2019-08-28 01:15:21 +00:00
Treehugger Robot
2d572464af Merge "Rename dumpstate service to include '.example'." 2019-08-27 22:57:45 +00:00
Steven Moreland
df0a65785c Clarify vendor_service/vintf_service.
These attributes are intended to be used w/ services using the system
copy of libbinder (for vendor, this is libbinder_ndk).

Switching vndservicemanager users using the libbinder copy of vendor to
be able to use the system copy of libbinder for registration is an open
problem.

Bug: 136027762
Test: N/A
Change-Id: I1d70380edcb39ca8ef2cb98c25617701b67ba7e1
2019-08-27 15:37:11 -07:00
Nick Kralevich
dddbaaf1e8 update sepolicy for fs notification hooks
Update access_vectors and global_macros to account for the changes in
kernel commit
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ac5656d8a4cdd93cd2c74355ed12e5617817e0e7

This change is needed to allow Android to boot on linux-next

Test: compiles
Change-Id: I35c59fc50fa9c94ab94399ce74d637e49d38129d
2019-08-27 15:31:59 -07:00
Treehugger Robot
83b28e267e Merge "Allow remounting /mnt/user/0 as slave mount" 2019-08-27 22:03:00 +00:00
Steven Moreland
10d260950d Rename dumpstate service to include '.example'.
Since this was an example service providing no real functionality and
accidentally got installed on a device.

Bug: 140115084
Test: install on test device and see that it runs
Change-Id: I553da8e1f4da7d6a9f0c3e7d4a3561f0b22321dc
2019-08-27 11:07:51 -07:00
Steven Moreland
25871e7f2f System service neverallow, make full_treble_only.
Since non-full-Treble devices aren't guaranteed to have coredomain
applied to all system processes, this is breaking some downstream
non-Treble devices.

Bug: 140076135
Test: N/A
Change-Id: I2942506cb0cfd8096c631281389a16aa48b4da08
2019-08-27 10:47:11 -07:00
Eric Holk
04ee9fb1b2 Give map permission to viewcompiler
On cuttlefish devices, the resource loading code apparently maps the file rather
than just reading it.

Denial log:

viewcompiler: type=1400 audit(0.0:308): avc: denied { map } for
path="/data/app/android.startop.test-Z2JxVhtKPw2wx4o-nmo5NA==/base.apk"
dev="vdb" ino=139269 scontext=u:r:viewcompiler:s0
tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0
app=android.startop.test

Bug: 139018973
Change-Id: I4bbbc44abc3c4315137f76a0be737236cf10f4ef
2019-08-27 10:43:55 -07:00
Paul Lawrence
4d40aefa4b Merge "Fix ext4/metadata/udc problem" 2019-08-27 15:21:58 +00:00
Treehugger Robot
c7b1be7d4c Merge "Remove mediacodec_service." 2019-08-26 21:32:47 +00:00
Treehugger Robot
accc143126 Merge "Add file-contexts for statsd apex" 2019-08-23 21:53:32 +00:00
Jon Spivack
018f745b90 Merge "Allow vndservicemanager to start processes" 2019-08-23 01:29:06 +00:00
Steven Moreland
aa6793febd Merge "Reland "Re-open /dev/binder access to all."" 2019-08-22 22:55:04 +00:00
Treehugger Robot
444b5483a2 Merge "Allow drmserver to communicate with mediametrics" 2019-08-22 21:51:24 +00:00
Tri Vo
9203c0009d Merge "selinux: tag gpu_service as app_api_service" 2019-08-22 19:57:04 +00:00
Tri Vo
dc887eeb7a Merge "Expand typattribute declarations into older maps" 2019-08-22 19:33:26 +00:00
Tri Vo
5511676b31 selinux: tag gpu_service as app_api_service
gpu_service is already accessible to untrusted 3p apps aosp/898376.
Otherwise, vendor apps can't access gpu_service.

Bug: 139685237
Test: m selinux_policy
Change-Id: I30a951cd712b0ae4aacd2c4d6d42e74fac5c0707
Merged-In: I30a951cd712b0ae4aacd2c4d6d42e74fac5c0707
(cherry picked from commit 32f279c096)
2019-08-22 11:38:08 -07:00
Robert Shih
353c4ab3a4 Allow drmserver to communicate with mediametrics
Bug: 134789967
Test: dumpsys media.metrics
Change-Id: I550e328dac9592f66ea589eacfb2d349a8666878
2019-08-22 11:31:03 -07:00
Treehugger Robot
1751aa5b80 Merge "gralloc: add IAllocator/IMapper 4.0 sepolicy" 2019-08-22 17:20:45 +00:00
Tri Vo
f1e71dc75c selinux: remove sysfs_mac_address
Nothing is actually labeled as 'sysfs_mac_address'.

Bug: 137816564
Test: m selinux_policy
Change-Id: I2d7e71ecb3a2b4ed76c13eb05ecac3064c1bc469
2019-08-21 13:07:09 -07:00
Steven Moreland
8a7bed9e1e Remove mediacodec_service.
Since this service no longer exists.

Fix: 80317992
Test: TH, codesearch.
Merged-In: I257c8cc3dba657d98f19eb61b36aae147afea393
Change-Id: I257c8cc3dba657d98f19eb61b36aae147afea393
2019-08-21 01:14:15 +00:00
Maciej Żenczykowski
804d99ac76 Do not allow untrusted apps to read sysfs_net files
(this includes /sys/class/net/*/address device mac addresses)

Test: builds
Bug: 137816564
Change-Id: I84268b2e0207559ed00baafb8a3f231c676f8df1
Signed-off-by: Maciej Żenczykowski <maze@google.com>
2019-08-20 16:09:46 -07:00
Tri Vo
7bfd7303b3 Expand typattribute declarations into older maps
Say, foo_attribute is removed in 30 API. We need to preserve
typeattribute declaration in 29.0.cil, 28.0.cil, etc for backwards
compatibility.
(typeattribute binder_in_vendor_violators)

Automatically expand these typeattribute declaration into older map
files, so that we only need to update 29.0.cil.

Test: remove binder_in_vendor_violators; only 29.0.cil map needs to be
updated
Change-Id: Ifa7767d771f802e122b2f1ff6faf198ba2afa42e
2019-08-20 16:07:29 -07:00
Steven Moreland
b75b047f44 Reland "Re-open /dev/binder access to all."
This reverts commit 6b2eaade82.

Reason for revert: reland original CL

Separate runtime infrastructure now makes sure that only Stable AIDL
interfaces are used system<->vendor.

Bug: 136027762
Change-Id: Id5ba44c36a724e2721617de721f7cffbd3b1d7b6
Test: boot device, use /dev/binder from vendor
2019-08-20 16:03:37 -07:00
Steven Moreland
6b2eaade82 Revert "Re-open /dev/binder access to all."
This reverts commit 94ff361501.

Fix: 139759536
Test: marlin build fixed

Change-Id: I3ea2e29896722a80b22f09c405be205ffb7de6b2
2019-08-20 22:39:43 +00:00
Steven Moreland
30a06d278f Merge changes Icdf207c5,I20aa48ef
* changes:
  Re-open /dev/binder access to all.
  mediacodec: remove non-Treble allows
2019-08-20 19:50:24 +00:00
Steven Moreland
94ff361501 Re-open /dev/binder access to all.
Separate runtime infrastructure now makes sure that only Stable AIDL
interfaces are used system<->vendor.

Bug: 136027762
Test: boot device, use /dev/binder from vendor
Change-Id: Icdf207c5d5a4ef769c0ca6582dc58306f65be67e
2019-08-20 00:03:34 +00:00
Steven Moreland
641c45e258 mediacodec: remove non-Treble allows
Since mediacodec system services have been entirely deleted.

Bug: 80317992
Test: TH
Change-Id: I20aa48ef57474df000279a487f6b077790d273c1
2019-08-20 00:03:24 +00:00
Jon Spivack
b58c4c2a62 Allow vndservicemanager to start processes
Used to lazily start AIDL services.

Bug: 138756857
Test: Manual
Change-Id: I890ca70e654f8e8bb795189abb4018c0d5d05865
2019-08-19 16:05:13 -07:00
Muhammad Qureshi
71a051af5a Add file-contexts for statsd apex
Bug: 139549262
Test: build, install, and verify statsd module is mounted
Change-Id: Iabfb4d5bf5c7f06ed6c3d06f2dd9ec8b382f5688
2019-08-19 15:27:38 -07:00
Steven Moreland
20414effb6 Add uce service to core policy.
This service is requested by AOSP framework, but there is no context for
it defined.

Bug: 136023468
Test: N/A
Change-Id: Ibc5b048aaa1c9eda7b9180caca92cb876c3f6b28
Merged-In: Ibc5b048aaa1c9eda7b9180caca92cb876c3f6b28
(cherry picked from commit 67cb30fabf)
2019-08-19 12:42:56 -07:00
Roland Levillain
c72b7d1731 Allow dexoptanalyzer to mmap files with Linux 4.14+ that it can already access.
SELinux has a separate file mmap permission in 4.14+ kernels. Add this
to dexoptanalyzer(d) in cases where it could already access files (in
particular, secondary dex files).

Addresses denials of the form:

  avc: denied { map } for […] path="/data/data/[…]" […]
  scontext=u:r:dexoptanalyzer:s0 tcontext=u:object_r:app_data_file:s0

Test: Reproduce steps in bug 138683603 on a device with a 4.14+ kernel
      and check the absence of SELinux denials
Bug: 138683603

Change-Id: Ieba53eb431c0ba3914dcb5e5abdae667bd063555
2019-08-16 20:02:32 +01:00
Amy Zhang
3e7429359f Merge "Tuner Hal 1.0 Enable ITuner service" 2019-08-15 18:04:05 +00:00
Treehugger Robot
1fc3f318bf Merge "Add MAINLINE_SEPOLICY_DEV_CERTIFICATES to keys.conf" 2019-08-15 07:43:46 +00:00
Amy
89b4bbd4d8 Tuner Hal 1.0 Enable ITuner service
Test: cuttlefish
Bug: 135708935
Change-Id: Ica063458860df45f0e2ab640a2ab35cd4da3da8e
2019-08-14 11:22:09 -07:00
Kiyoung Kim
aff00188eb Merge changes from topic "use_generated_linkerconfig"
* changes:
  Define sepolicy with property for linker
  Add more permission for linkerconfig
2019-08-14 09:28:23 +00:00
Kiyoung Kim
82c87ede24 Define sepolicy with property for linker
To support linker-specific property, sys.linker.* has been defined as
linker_prop. This will have get_prop access from domain so all binaries
can start with linker using proper property access level.

Bug: 138920271
Test: m -j && Confirmed from cuttlefish that get_prop errors are no longer found
Change-Id: Iaf584e0cbdd5bca3d5667e93cf9a6401e757a314
2019-08-14 12:35:15 +09:00
Tri Vo
58188e5f42 Merge "sepolicy: public links in error messages" 2019-08-13 23:09:33 +00:00
Zim
4e100f2704 Allow remounting /mnt/user/0 as slave mount
This is required for Idf851b3a42910e0ce8fdd75daea1cce91dd1aa98
And is part of enabling upcoming platform changes that are
described in the bug linked below.

Bug: 135341433
Test: m
Change-Id: I1d842fcfae3740d51e7cb2050decf1f83543af7e
2019-08-13 10:45:10 +01:00
Carmen Jackson
1e414b5355 Allow Traceur to record the suspend_resume trace event
This should be available in user and userdebug builds.

Bug: 137289935
Test: Alongside atrace changes, recorded a trace using Traceur and
verified that the tracepoints were included in the recorded trace in
both user and userdebug builds.

Change-Id: I6131557bdd0a298be9e75b39759599b189b9b988
2019-08-09 10:56:15 -07:00
Tri Vo
462c9c4382 sepolicy: public links in error messages
Bug: n/a
Test: n/a
Change-Id: Id449fe115fac8bf99c33bf4455a23dd29448f93d
2019-08-09 10:27:48 -07:00
Paul Lawrence
37739146b6 Fix ext4/metadata/udc problem
Test: Cannot currently test since no device supports this combo
Bug: 137924328
Change-Id: Ie59e6c37e293c983e99618eacda9fd09c2ce01ed
2019-08-08 08:55:29 -07:00
vichang
35108c95f5 Merge "Add sepolicy for com.android.i18n module" 2019-08-08 11:06:53 +00:00
Kiyoung Kim
70e931caba Add more permission for linkerconfig
Additional permission is required for linkerconfig from domain to get
access to ld.config.txt file from linker. This change allows linker to
get /dev/linkerconfig/ld.config.txt

Bug: 138920271
Test: m -j && confirmed from cuttlefish
Change-Id: Id130a072add8ae82840b0b4d9e997e146f502124
2019-08-08 17:18:21 +09:00
Zim
b56cc6fb1f Allow MediaProvider to host FUSE devices.
This change is part of enabling upcoming platform changes that are
described in the bug linked below.

Bug: 135341433
Test: m
Change-Id: I6ef499b0d5aa403f8eb6699649a201d8cc004bc5
2019-08-07 19:00:15 +01:00
Roland Levillain
d1936ac945 Merge "Fix lock logspam for dexoptanalyzer." 2019-08-07 10:35:39 +00:00