Commit graph

14884 commits

Author SHA1 Message Date
TreeHugger Robot
28faedb4c4 Merge "Allow system server to access bpf fs" into pi-dev 2018-03-26 19:26:35 +00:00
Primiano Tucci
e9b8bff6c6 perfetto: allow traced to write into FDs received by the client
This allows an optimization that consists in the "perfetto" cmdline
client passing directly the file descriptor for the output trace
to traced (as opposite to having traced streaming back the trace
data to "perfetto" and having that one doing the write() into file).
This reduces sensibly the memory traffic and CPU overhead of traces
with a minor change.

Bug: 73625179
Test: builds + perfetto_integrationtests w/ long_trace.cfg
Change-Id: I81f5a230338ced20dc543fd91c5a0bd0e58725f2
Merged-In: I81f5a230338ced20dc543fd91c5a0bd0e58725f2
(cherry picked from aosp/648831)
2018-03-26 01:01:36 +00:00
Chenbo Feng
88ef20aa71 Allow system server to access bpf fs
The permission to allow system_server to access sys/fs/bpf/ directory
is missing. Add it back so it can get the bpf maps from the bpf_fs.

Test: device boot and no more denial information of system_server try to
searcg in fs_bpf
      atest android.net.cts.TrafficStatsTest
Bug: 75285088

Change-Id: I1040cde6c038eccc4e91c69a10b20aa7a18b19f6
(cherry picked from aosp commit f83bbd17b2)
2018-03-23 18:45:28 -07:00
Tri Vo
e55424941e modprobe: shouldn't load kernel modules from /system
Kernel modules are not permitted to be on /system partition.
That was one of Treble requirements in O:
https://source.android.com/devices/architecture/kernel/modular-kernels#file-locations

Bug: 74069409
Test: pixel/nexus devices don't have LKMs in /system, so this change
shoudl be harmless.
Test: walleye boots without issues from modprobe.
Merged-In: I8b3aeb55aacb3c99e0486224161d09a64bb52cd1
Change-Id: I8b3aeb55aacb3c99e0486224161d09a64bb52cd1

(cherry picked from commit 6ef9f5232e)
2018-03-23 14:16:25 -07:00
TreeHugger Robot
e2b8881fc0 Merge "Allow vendor-init-settable and public-readable to ro.config.low_ram" into pi-dev 2018-03-23 06:32:42 +00:00
Jaekyun Seok
2c6cacf45f Allow vendor-init-settable and public-readable to ro.config.low_ram
ro.config.low_ram should be set on Android Go devices by SoC vendors,
and the value can be read by vendor components.

Bug: 76132948
Bug: 75987246
Test: succeeded building and tested with taimen
Change-Id: I6ac98fa58cf641da4565d6277898fc5e5e6ceca1
Merged-In: I6ac98fa58cf641da4565d6277898fc5e5e6ceca1
(cherry picked from commit 7dd2e025d8)
2018-03-23 13:15:13 +09:00
Andreas Gampe
0193620bec Sepolicy: Give system server fd rights to perfprofd
So that perfprofd can send larger packets to dropbox.

Follow-up of commit 3fa95acb1e.

(cherry picked from commit c9df843773)

Bug: 73175642
Test: m
Test: manual
Merged-In: I88d1f83962243589909ff1ce3d02195e7c494256
Change-Id: I88d1f83962243589909ff1ce3d02195e7c494256
2018-03-22 21:10:39 -07:00
TreeHugger Robot
cb9ac32bed Merge "Allow system_server to update timerslack_ns for hal_audio_default" into pi-dev 2018-03-23 00:02:32 +00:00
Primiano Tucci
ad60c564e5 Merge "Reland: perfetto: allow traced_probes to execute atrace" into pi-dev 2018-03-22 22:53:06 +00:00
Mikhail Naganov
b506a352e8 Allow system_server to update timerslack_ns for hal_audio_default
Based on the following audit message:

type=1400 audit(1521738979.005:385): avc: denied { write } for pid=1269
comm="Binder:1269_B" name="timerslack_ns" dev="proc" ino=254190
scontext=u:r:system_server:s0 tcontext=u:r:hal_audio_default:s0
tclass=file permissive=1

Bug: 74110604
Test: adb shell dmesg | grep hal_audio_default
Change-Id: I4c2e787588eb9d223d5e50e1bc8f67876de97c2e
2018-03-22 14:11:37 -07:00
Jong Wook Kim
d6d16489f2 Wifi HAL SIOCSIFHWADDR sepolicy
Add sepolicy rule to grant Wifi HAL permission to use SIOCSIFHWADDR
ioctl. This permission is needed to dynamically change MAC address of
the device.

We are moving the implementation of setting the MAC address from
WifiCond to Vendor HAL to give vendors flexibility in supporting
Connected MAC Randomization. Will clean up WifiCond sepolicy afterwards.

Bug: 74347653
Test: Verified manually
Change-Id: I334cefddf385ecb1ee169eb692c4e0060c26d6d9
2018-03-22 13:18:31 -07:00
Primiano Tucci
f3fd4d6bf8 Reland: perfetto: allow traced_probes to execute atrace
This CL adds the SELinux permissions required to execute
atrace and get userspace tracing events from system services.
This is to enable tracing of events coming from surfaceflinger,
audio HAL, etc.
atrace, when executed, sets a bunch of debug.atrace. properties
and sends an IPC via binder/hwbinder to tell the services to
reload that property.

This CL does NOT affect systrace. In that case (i.e. when
atrace is executed from adb/shell) atrace still runs in
the shell domain and none of those changes apply.

Change-Id: I11b096d5c5c5593f18bce87f06c1a7b1ffa7910e
Merged-In: I11b096d5c5c5593f18bce87f06c1a7b1ffa7910e
Merged-In: Iba195d571aec9579195d79d4970f760e417608c6
Bug: b/73340039
2018-03-22 11:00:49 +00:00
TreeHugger Robot
16d28d0fb0 Merge "Allow netd to setup xt_bpf iptable rules" into pi-dev 2018-03-22 06:25:21 +00:00
TreeHugger Robot
bfee690152 Merge "Revert "Allow dexopt to follow /odm/lib(64) symlinks."" into pi-dev 2018-03-22 01:55:34 +00:00
Fyodor Kupolov
c5b15872ac Merge "Added SELinux policy for BinderCallsStatsService" into pi-dev 2018-03-21 23:02:58 +00:00
Chenbo Feng
68ef8c070e Allow netd to setup xt_bpf iptable rules
To better record the network traffic stats for each network interface.
We use xt_bpf netfilter module to do the iface stats accounting instead
of the cgroup bpf filter we currently use for per uid stats accounting.
The xt_bpf module will take pinned eBPF program as iptables rule and run
the program when packet pass through the netfilter hook. To setup the
iptables rules. netd need to be able to access bpf filesystem and run the
bpf program at boot time. The program used will still be created and
pinned by the bpfloader process.

Test: With selinux enforced, run "iptables -L -t raw" should show the
xt_bpf related rule present in bw_raw_PREROUTING chain.
Bug: 72111305

Change-Id: I11efe158d6bd5499df6adf15e8123a76cd67de04
(cherry picked from aosp commit 5c95c16841)
2018-03-21 14:37:37 -07:00
TreeHugger Robot
f11b164ac9 Merge changes from topic "odm-sepolicy" into pi-dev
* changes:
  Add /odm/etc/selinux/odm_mac_permissions.xml
  Add /odm/etc/selinux/odm_hwservice_contexts
  Add /odm/etc/selinux/odm_property_contexts
  Add /odm/etc/selinux/odm_seapp_contexts
  Add /odm/etc/selinux/odm_file_contexts
  Add /odm/etc/selinux/odm_sepolicy.cil
2018-03-21 00:59:23 +00:00
Fyodor Kupolov
624dc30de4 Added SELinux policy for BinderCallsStatsService
Test: manual
Bug: 75318418
Merged-In: I700c1b8b613dba1c99f4fbffdd905c0052c1b2e7
Change-Id: I700c1b8b613dba1c99f4fbffdd905c0052c1b2e7
2018-03-21 00:50:33 +00:00
Tri Vo
0746a306ee Merge changes from topic "dontaudit_proc_sys" into pi-dev
* changes:
  silence innocuous denials to /proc and /sys
  proc_type attribute for files under /proc.
2018-03-20 23:48:47 +00:00
Tri Vo
f170dfb789 silence innocuous denials to /proc and /sys
Bug: 74182216
Test: build policy
Change-Id: Idf90c1a96943266d52508ce72b8554d8b5c594c9
(cherry picked from commit 09b1d962ef)
2018-03-20 14:22:16 -07:00
Tri Vo
62e6850a2b proc_type attribute for files under /proc.
With this attribute it will be easier to reference /proc files.

Bug: 74182216
Test: policy builds
Change-Id: I5b7da508d821e45f122832261a742a201e8fdf2c
(cherry picked from commit 41bf08e592)
2018-03-20 14:21:36 -07:00
TreeHugger Robot
2867f5c3fa Merge "Add alanstokes as an owner." into pi-dev 2018-03-20 19:56:40 +00:00
Joel Galenson
b54d87f8f7 Allow audioserver to access audio_device on non-Treble devices.
This should fix audio on non-Treble devices.

Bug: 75949883
Test: Built policy.
Merged-In: I90a4648aaf975d59be36afd5f62c88a015af10f7
Change-Id: I90a4648aaf975d59be36afd5f62c88a015af10f7
(cherry picked from commit 6e8bfa2d3e)
2018-03-20 09:32:42 -07:00
Alan Stokes
f95e44df91 Add alanstokes as an owner.
Bug: 72643420
Test: n/a
Change-Id: Iba86b7d77582e85de7469bedaf31465205e42433
2018-03-20 16:17:08 +00:00
Bowgo Tsai
1067bffabe Add /odm/etc/selinux/odm_mac_permissions.xml
Bug: 64240127
Test: normal boot a device
Change-Id: I276ba6bc88eabb0d5562e4e96d3860eedb76aed5
Merged-In: I276ba6bc88eabb0d5562e4e96d3860eedb76aed5
(cherry picked from commit af7d85f83f)
2018-03-20 17:34:27 +08:00
Bowgo Tsai
13e5d757e8 Add /odm/etc/selinux/odm_hwservice_contexts
Bug: 64240127
Test: normal boot and recovery boot a device
Change-Id: I22d29e8476380d19aca1be359e0228ab6bbc3b0f
Merged-In: I22d29e8476380d19aca1be359e0228ab6bbc3b0f
(cherry picked from commit ad6231f546)
2018-03-20 17:34:13 +08:00
Bowgo Tsai
6d3822d4fe Add /odm/etc/selinux/odm_property_contexts
Bug: 64240127
Test: normal boot and recovery boot a device
Change-Id: Ibd71219f60644e57370c0293decf11d82f1cb35c
Merged-In: Ibd71219f60644e57370c0293decf11d82f1cb35c
(cherry picked from commit 1f717b1001)
2018-03-20 17:33:59 +08:00
Bowgo Tsai
82444056d7 Add /odm/etc/selinux/odm_seapp_contexts
Bug: 64240127
Test: normal boot a device
Change-Id: I3626357237cc18a99511f1ebd9dd3ff5a7655963
Merged-In: I3626357237cc18a99511f1ebd9dd3ff5a7655963
(cherry picked from commit ecf656b06f)
2018-03-20 17:33:44 +08:00
Bowgo Tsai
d3e94f26fa Add /odm/etc/selinux/odm_file_contexts
Bug: 64240127
Test: normal boot and recovery boot a device
Change-Id: I087292fb23d05fc17272778d668ac78a721b2593
Merged-In: I087292fb23d05fc17272778d668ac78a721b2593
(cherry picked from commit bae1517a58)
2018-03-20 17:33:27 +08:00
Bowgo Tsai
95fbf4516c Add /odm/etc/selinux/odm_sepolicy.cil
This change adds the support of odm sepolicy customization, which can
be configured through the newly added build varaible:
    - BOARD_ODM_SEPOLICY_DIRS += device/${ODM_NAME}/${BOM_NAME}/sepolicy

Also moving precompiled sepolicy to /odm when BOARD_ODM_SEPOLICY_DIRS
is set. On a DUT, precompiled sepolicy on /odm will override the one in
/vendor. This is intentional because /odm is the hardware customization
for /vendor and both should be updated together if desired.

Bug: 64240127
Test: boot a device with /odm partition
Change-Id: Ia8f81a78c88cbfefb3ff19e2ccd2648da6284d09
Merged-In: Ia8f81a78c88cbfefb3ff19e2ccd2648da6284d09
(cherry picked from commit 45457e3a2b)
2018-03-20 17:33:11 +08:00
Bowgo Tsai
ab981811f2 Revert "Allow dexopt to follow /odm/lib(64) symlinks."
This reverts commit 88cd813fe2.

Bug: 75287236
Test: boot a device
Change-Id: Id1bc324e7bd0722065d8a410af31fd6b7aaa9d1c
Merged-In: Id1bc324e7bd0722065d8a410af31fd6b7aaa9d1c
(cherry picked from commit 942500b910)
2018-03-20 17:31:35 +08:00
TreeHugger Robot
5fbec4b679 Merge "Allow vendor_init_readable to persist.sys.usb.usbradio.config" into pi-dev 2018-03-20 03:46:42 +00:00
Chong Zhang
3cc567ddf0 Merge "allow mediaprovider to use media extractor" into pi-dev 2018-03-19 22:47:39 +00:00
Chong Zhang
9161b992bc allow mediaprovider to use media extractor
When extraction exif info, certain file formats may requires
parsing the container. Allow mediaprovider to use extractor
to do the parsing.

bug: 73978990
Test: manually test the scenario in b/73978990 and verify
      the Exif is extracted correctly.

Change-Id: I1cd46d793ebc9c38b816a3b63f361967e551d046
(cherry picked from commit 8e3fef3d2c)
2018-03-19 22:46:16 +00:00
Jaekyun Seok
f1eb382ac7 Allow vendor_init_readable to persist.sys.usb.usbradio.config
persist.sys.usb.usbradio.config can be read in vendor init scripts.

Bug: 75202311
Bug: 74266614
Test: succeeded building and tested on pixels
Change-Id: Ib07a436dd22b4b445fd114cc1d0df7c3e7a21527
2018-03-20 07:39:31 +09:00
TreeHugger Robot
820558a08c Merge "Allow only public-readable to ro.secure and ro.adb.secure" into pi-dev 2018-03-19 22:22:02 +00:00
Bowgo Tsai
e3972606e4 Allow dexopt to follow /odm/lib(64) symlinks.
Several /odm/* symlinks are added in the following change, to fallback
to /vendor/odm/* when there is no /odm partition on the device.

  https://android-review.googlesource.com/#/c/platform/system/sepolicy/+/638159/

This change allows dexopt operations to 'getattr' those symlinks during
OTA.

Bug: 75287236
Test: boot a device
Change-Id: I2710ce5e2c47eb1a3432123ab49f1b6f3dcb4ffe
Merged-In: I2710ce5e2c47eb1a3432123ab49f1b6f3dcb4ffe
(cherry picked from commit 88cd813fe2)
2018-03-19 15:56:18 +08:00
Jaekyun Seok
6f3e73db05 Allow only public-readable to ro.secure and ro.adb.secure
Bug: 74866333
Test: succeeded building and tested with taimen
Change-Id: Id19fec168ab266e386ea4c710a4c5cedfc4df33c
Merged-In: Id19fec168ab266e386ea4c710a4c5cedfc4df33c
(cherry picked from commit 62acbce4a2)
2018-03-19 08:35:39 +09:00
TreeHugger Robot
dddda727c4 Merge "Init: Enable init to relabel symlinks for recovery_block_device." into pi-dev 2018-03-18 05:56:13 +00:00
TreeHugger Robot
0773d17fd3 Merge "Mark some odm properties as vendor-init-settable" into pi-dev 2018-03-16 16:54:29 +00:00
padarshr
ecab401087 Init: Enable init to relabel symlinks for recovery_block_device.
Allow init the ability to relabel recovery block devices. In the case
where we have recovery as a chain partition, due to its presence in
early mount node, init, in first stage itself would require relabel
permissions for the restorecon operation on recovery block device.

Bug: 73642793
Test: On bootup, recovery partition gets the appropriate se-label.
      Perform OTA on non-A/B device with recovery as chain partition,
      now the recovery partition gets upgraded successfully, now that
      it has the correct se-label.

Change-Id: I370c510320e78ab78c9c55573073415b4983d0f6
Merged-In: I370c510320e78ab78c9c55573073415b4983d0f6
(cherry picked from commit bc14ee3cd7)
2018-03-16 15:10:27 +08:00
Bowgo Tsai
98d5c1f52a Mark some odm properties as vendor-init-settable
Bug: 64195575
Test: boot a device

Change-Id: I7f7deb5e2c5c6e0a75cf22eb610a7973b5be0d7e
Merged-In: I7f7deb5e2c5c6e0a75cf22eb610a7973b5be0d7e
(cherry picked from commit a47a1c25af)
2018-03-16 15:02:30 +08:00
Jaekyun Seok
0630c7d966 Allow vendor-init-settable to ro.enable_boot_charger_mode
vendor-init-settable should be allowed to ro.enable_boot_charger_mode so
that SoC vendors can set its default value.

Bug: 74421250
Test: succeeded building and tested with taimen
Change-Id: I2859aab29fefb7882989413a089b0de55142d2f1
Merged-In: I2859aab29fefb7882989413a089b0de55142d2f1
(cherry picked from commit 46bc518c69)
2018-03-14 07:21:02 +09:00
TreeHugger Robot
9579ff4185 Merge "Add ro.hardware.audio.hearing_aid" into pi-dev 2018-03-13 18:21:58 +00:00
Jakub Pawlowski
f91c9b454f Add ro.hardware.audio.hearing_aid
Bug: 69623109
Change-Id: I7d194a3489fc5ff278cef7bebe9bfe6c39d3b2b8
(cherry-picked from 4a40c592404bdc2032067f4a3fac2f33b9246aa0)
2018-03-13 18:20:41 +00:00
Petri Gynther
f03f7c8688 Merge "sepolicy: Read access to audioserver for Bluetooth properties" into pi-dev 2018-03-13 02:00:33 +00:00
Petri Gynther
37d15150d3 Merge "Bluetooth A2DP offload: Binder call to audio HAL" into pi-dev 2018-03-13 02:00:33 +00:00
TreeHugger Robot
13c46ef54c Merge "Hide denial for wpa_supplicant writing to /data/misc/wifi." into pi-dev 2018-03-12 22:35:29 +00:00
Joel Galenson
e7cad6cdc2 Hide denial for wpa_supplicant writing to /data/misc/wifi.
It should instead write to /data/vendor/wifi.

Bug: 36645291
Test: Built policy.
Change-Id: Ib7ba3477fbc03ebf07b886c60bcf4a64b954934a
(cherry picked from commit cc9b30a1cd)
2018-03-12 13:24:52 -07:00
TreeHugger Robot
7cfabb12be Merge "Ensure taking a bugreport generates no denials." into pi-dev 2018-03-12 20:19:01 +00:00