Commit graph

18041 commits

Author SHA1 Message Date
Treehugger Robot
76a1a76b35 Merge "Revert "Temporarily hide denial to fix tests."" 2019-03-27 16:54:12 +00:00
Nick Kralevich
9097360049 Revert "Temporarily hide denial to fix tests."
This reverts commit 94b5fe4af5.

Reason for revert: Obsoleted by https://android-review.googlesource.com/933916

Bug: 129298168
Change-Id: I6b34cfdf76b5094db17ee06831d8a662ea360956
Test: Build.
2019-03-27 13:56:20 +00:00
Yifan Hong
40f1682ba6 Merge changes from topic "lpdumpd"
* changes:
  Add rules for lpdump and lpdumpd
  Allow to getattr kmsg_device
2019-03-26 20:35:36 +00:00
Nick Kralevich
a2b90b5efc Merge "Temporarily hide denial to fix tests." 2019-03-26 20:06:49 +00:00
Nick Kralevich
f3e8dce5d4 Merge "Don't audit audit_access denials to /dev/binder" 2019-03-26 19:51:01 +00:00
Yifan Hong
b9be03d63a Merge "Add super_block_device_type" 2019-03-26 19:30:12 +00:00
Joel Galenson
94b5fe4af5 Temporarily hide denial to fix tests.
This shoud be removed once the offending code is fixed.

Bug: 129298168
Test: Build.
Change-Id: Ie94a626be777a094fb587f72b3987994e085a23e
2019-03-25 17:37:51 -07:00
Tri Vo
786b973c96 Don't audit audit_access denials to /dev/binder
Without VNDK, libcutils has to probe for /dev/binder access before
reaching to ashmemd via binder. Ignore denials generated when probing
/dev/binder.

Bug: 129073672
Test: boot sailfish without denials to /dev/binder
Change-Id: I07ba2e094586df353d54507458e891a3d14c1ca6
2019-03-25 17:23:36 -07:00
Tri Vo
a109fa645c Merge "Allow system_suspend access to /sys/power/wake_[un]lock." 2019-03-25 23:38:09 +00:00
Yifan Hong
e3ee390c6b Add super_block_device_type
This is the type used on super partition block devices.
- On devices launch with DAP, super is already marked
as super_block_device_type.
- On retrofit devices, appropriate block devices must
be marked as super_block_device_type, for example:

    typeattribute system_block_device super_block_device_type;

Bug: 128991918
Test: builds
Change-Id: I7e26d85b577ce08d8dc1574ddc43146d65843d9c
2019-03-25 17:58:10 +00:00
Yifan Hong
18ade868ff Add rules for lpdump and lpdumpd
- lpdump is a binary on the device that talks to lpdumpd
  via binder.

- lpdumpd is a daemon on the device that actually reads
  dynamic partition metadata. Only lpdump can talk to it.

Bug: 126233777
Test: boots (sanity)
Test: lpdump

Change-Id: I0e21f35ac136bcbb0603940364e8117f2d6ac438
2019-03-25 10:14:20 -07:00
Yifan Hong
5d89abde99 Allow to getattr kmsg_device
These denials occur on boot when android_get_control_file also
changes from readlink() to realpath(), because realpath() will
lstat() the given path.

Some other domains (fastbootd, update_engine, etc.) also uses
libcutils to write to kernel log, where android_get_control_file()
is invoked, hence getattr is added to them as well.

04-28 06:15:22.290   618   618 I auditd  : type=1400 audit(0.0:4): avc: denied { getattr } for comm="logd" path="/dev/kmsg" dev="tmpfs" ino=20917 scontext=u:r:logd:s0 tcontext=u:object_r:kmsg_device:s0 tclass=chr_file permissive=0
03-20 19:52:23.431   900   900 I auditd  : type=1400 audit(0.0:7): avc: denied { getattr } for comm="android.hardwar" path="/dev/kmsg" dev="tmpfs" ino=20917 scontext=u:r:hal_health_default:s0 tcontext=u:object_r:kmsg_device:s0 tclass=chr_file permissive=0
...
03-20 22:40:42.316     1     1 W init    : type=1400 audit(0.0:33): avc: denied { getattr } for path="/dev/kmsg" dev="tmpfs" ino=21999 scontext=u:r:init:s0 tcontext=u:object_r:kmsg_device:s0 tclass=chr_file permissive=0

Test: no denials related to these
Change-Id: I5263dd6b64c06fb092f3461858f57a1a09107429
2019-03-25 10:14:20 -07:00
Przemyslaw Szczepaniak
37f5cb2db0 Merge "Make package_native_serice an (ephemeral_)?app_api_service." 2019-03-25 15:49:57 +00:00
Treehugger Robot
db4ac6f02c Merge "Fix mediaserver meets the void fd use denied" 2019-03-24 23:25:19 +00:00
Joe Onorato
d7148b99cb Merge "Allow incidentd to communicate with clients over pipes." 2019-03-24 22:41:01 +00:00
Joe Onorato
9cc5c09be5 Allow incidentd to communicate with clients over pipes.
Previously we dumped the data into dropbox.  This improves a couple
things:
  - We write into dropbox via the fd, so dropbox doesn't pull from the
    incidentd directory anymore.
  - There is a new API to for priv apps to explicitly read incident
    reports. That gives incidentd finer grained control over who can
    read it (specifically, it only allows apps to access the incident
    reports they requested, or were requested for them via statsd,
    instead of getting DUMP and reading whatever they want from
    dropbox).

Test: bit incident_test:* GtsIncidentManagerTestCases:*
Bug: 123543706
Change-Id: I9a323e372c4ff95d91419a61e8a20ea5a3a860a5
2019-03-22 17:04:49 -07:00
Andreas Gampe
30186cf611 Sepolicy: Allow otapreopt access to vendor overlay files
A handful of APKs are vendor overlay files. Allow access.

Test: m
Change-Id: I791fa37a3bcb07729386047f0cda178753af9de5
2019-03-22 12:13:53 -07:00
Andreas Gampe
1a5db599ce Sepolicy: Allow otapreopt to mount logical partitions
Logical partitions are handled through libdm. Allow access to
device-mapper.

Bug: 128867786
Test: m
Change-Id: I6979487b91d24b7309c876f2bdc26a827e2fcd1e
2019-03-22 12:13:05 -07:00
Felka Chang
1eb2669218 Fix mediaserver meets the void fd use denied
scenario: droid.apps.docs: type=1400 audit(0.0:77): avc: denied {
use } for path="/mnt/appfuse/10028_6/9" dev="fuse" ino=9
scontext=u:r:mediaserver:s0 tcontext=u:r:vold:s0 tclass=fd permissive=0

root cause: DocumentsUI provides ArchiveProvider to browse the entries
in archive files by using StorageManager.openProxyFileDescriptor.
i.e. the file descriptor comes from the archive entries is belong to
the void fd.  The file descriptor is used by mediaserver but
mediaserver doesn't have the permission to use the file descriptor.

Fixes: 120491318
Test: build, flash, manual test
Change-Id: Ibaf9a625c7b68c3f1977fcaddd6c7d5419352f93
2019-03-22 22:41:49 +08:00
David Brazdil
c848dee19c Merge "dexoptanalyzer: Allow writing into installd's pipe" 2019-03-22 13:48:58 +00:00
Florian Mayer
3b641a60a2 Merge "Give heapprofd dac_read_search on userdebug." 2019-03-22 10:37:05 +00:00
Treehugger Robot
d125ab8f21 Merge "Allow dumpstate to dump wlan hal log on userbuild" 2019-03-22 07:15:13 +00:00
Alan Stokes
5c378a5374 Clarify priv_app.te.
No semantic changes. Just trying to make this easier to understand:
- Separate out common bundles of services from individual services
  (the naming doesn't make this obvious).
- Comment the common ones.
- Put related binder_call and service_manager:find rules together.

Test: Builds
Change-Id: Iba4a85a464da032e35450abff0febcdcf433df48
2019-03-21 23:52:30 +00:00
Florian Mayer
e922aa38bf Give heapprofd dac_read_search on userdebug.
This is needed because some oat dex files are generated without world
readable permissions. See the bug for details.

We are still constrained by the SELinux rules above.

Bug: 129048073

Change-Id: I84e34f83ceb299ff16b29a78f16c620fc0aa5d68
2019-03-21 17:22:09 +00:00
Treehugger Robot
75e7d2886c Merge "Allow lmkd to setched kernel threads" 2019-03-21 10:39:36 +00:00
Roger Wang
49f2954275 Allow dumpstate to dump wlan hal log on userbuild
To check issue on userbuild, wlan hal log
is helpful.

Bug: 122265104
Test: Manully, log collected on user build
Change-Id: I5aa96aa796ca7dfb92e97df3e7be054ff79f6e3d
2019-03-21 12:27:44 +08:00
Wei Wang
eff6ddf668 Allow lmkd to setched kernel threads
psi monitor sched_setscheduler(kworker->task, SCHED_FIFO, &param) was added into pa/1282597

Bug: 127637796
Test: build
Change-Id: I8f2470fc40bc8d02a7fbbbe186afe580c5f53aa4
2019-03-20 23:06:32 +00:00
David Brazdil
246efa2a24 dexoptanalyzer: Allow writing into installd's pipe
Dexoptanalyzer is getting a new mode to instruct installd on which dex
files it needs to open for itself and dex2oat from class loader context.
The file list is communicated by a pipe from a forked dexoptanalyzer
process to the installd parent. Give dexoptanalyzer permission to write
to installd's pipes.

Bug; 126674985
Test: atest installd_dexopt_test
Change-Id: Ic415e2dc543099d26681103c9d368c941d21b49a
2019-03-20 15:37:12 +00:00
Roland Levillain
f52fefe5ee Merge "Allow otapreopt_chroot to use a flattened Runtime APEX package." 2019-03-20 10:38:57 +00:00
Tri Vo
8730aeb2e9 Allow system_suspend access to /sys/power/wake_[un]lock.
Bug: 128923994
Test: boot taimen, no denials when writing to /sys/power/wake_[un]lock
Change-Id: Ib9ade5e532f906d2228642dfa5f52f609e559199
2019-03-19 21:34:49 -07:00
Cheney Ni
e55a74bdff Add rules for accessing the related bluetooth_audio_hal_prop
This change allows those daemons of the audio and Bluetooth which
include HALs to access the bluetooth_audio_hal_prop. This property is
used to force disable the new BluetoothAudio HAL.
  - persist.bluetooth.bluetooth_audio_hal.disabled

Bug: 128825244
Test: audio HAL can access the property
Change-Id: I87a8ba57cfbcd7d3e4548aa96bc915d0cc6b2b74
2019-03-20 03:12:25 +00:00
Treehugger Robot
2456c37021 Merge "Fix memory leaks" 2019-03-20 01:14:58 +00:00
Jeffrey Vander Stoep
9331374113 Merge "Android.bp: set sepolicy version for use by init" 2019-03-19 21:44:59 +00:00
George Burgess IV
bf2f927019 Fix memory leaks
This CL fixes leaks of the policy that we're building up. The analyzer
only caught the leaks on the error path, but I assume that
`check_assertions` does nothing to free the object that it's handed.

Analyzer warnings:

system/sepolicy/tools/sepolicy-analyze/neverallow.c:439:9: warning:
Potential leak of memory pointed to by 'avrule'
[clang-analyzer-unix.Malloc]

system/sepolicy/tools/sepolicy-analyze/neverallow.c:439:9: warning:
Potential leak of memory pointed to by 'neverallows'
[clang-analyzer-unix.Malloc]

Bug: None
Test: Treehugger; reran the analyzer
Change-Id: I79a0c34e8b53d33a1f01497337590eab660ad3ec
2019-03-19 12:10:51 -07:00
Andreas Gampe
08450264ae Sepolicy: Allow zygote to pick up dalvikcache artifacts
Allow the zygote to pick up integrity-checked boot classpath
artifacts from the dalvik cache.

Bug: 125474642
Test: m
Test: manual
Merged-In: I45d760c981c55a52bd0b22c79a9cba4868a09528
Change-Id: I45d760c981c55a52bd0b22c79a9cba4868a09528
2019-03-19 10:36:12 -07:00
Andreas Gampe
e72ec6bfd3 Sepolicy: Allow system_server_startup to load dalvikcache artifacts
Allow the startup domain to pick up integrity-checked artifacts
from the dalvik-cache. The corresponding framework code will
only load the system server classpath.

Bug: 128688902
Test: m
Test: manual
Merged-In: Ib37f8d7c39431e2792eeb4dac1cd732307519827
Change-Id: Ib37f8d7c39431e2792eeb4dac1cd732307519827
2019-03-19 10:36:03 -07:00
Przemyslaw Szczepaniak
8b2ad2c978 Make package_native_serice an (ephemeral_)?app_api_service.
This is required for accessing package_native_service
in libneuralnetworks.so for NNAPI Vendor Extension checks.

package_service is (ephemeral_)?app_api_service, native
one is a subset of it.

Bug: 120483623
Test: NeuralNetworksTest_FibonacciExtension
Change-Id: I9fa2c9aa263724d2256bbf26de19d6b357c82f9b
2019-03-19 16:37:45 +00:00
Nicolas Geoffray
e668732936 Merge "Allow init to set dalvik.vm.boot-image." 2019-03-19 15:00:41 +00:00
Roland Levillain
66f40a8b2d Allow otapreopt_chroot to use a flattened Runtime APEX package.
- Allow (again) `otapreopt` (running as `postinstall_dexopt`) to
  execute `dex2oat` from `/postinstall` -- this is for the case where
  it is located in a flattened Runtime APEX in
  `/postinstall/system/apex`.
- Allow `dex2oat` to read directories under `/postinstall`.
- Allow `otapreopt_chroot` to unmount flattened APEX packages under
  `/postinstall/system/apex` (which are bind-mounted in
  `/postinstall/apex`).

Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 127543974
Bug: 123684826
Bug: 113373927
Change-Id: Ie023ee5c64989ea071e1683f31073a70c93cac18
2019-03-19 14:44:22 +00:00
Xiao Ma
87b6d4018d Merge "Allow the netowrk stack to access its own data files." 2019-03-19 13:21:12 +00:00
Jeff Vander Stoep
60bb29fcdf crash_dump: suppress devpts denials
The following denial caused a presubmit failure:
06-15 15:16:24.176   956   956 I auditd  : type=1400 audit(0.0:4): avc:
denied { read write } for comm="crash_dump64" path="/dev/pts/3"
dev="devpts" ino=6 scontext=u:r:crash_dump:s0
tcontext=u:object_r:devpts:s0 tclass=chr_file permissive=0

Suppress these denials. They are not needed by crash_dump and are only
caused by the default behavior of sharing FDs across exec.

Test: build
Change-Id: I183f7a54e6b807fdf46b04d67dd4b819d4f0e507
2019-03-19 04:05:51 +00:00
Xiao Ma
c06f0f602a Allow the netowrk stack to access its own data files.
After moving IpMemoryStore service to network stack module(aosp/906907),
the following untracked SELinux denials are observed on boot.

W id.networkstack: type=1400 audit(0.0:63): avc: denied { write } for
name="com.android.networkstack" dev="sda13" ino=704810
scontext=u:r:network_stack:s0:c49,c260,c512,c768
tcontext=u:object_r:system_data_file:s0 tclass=dir permissive=0

Add radio_data_file type for network stack user configuration and
relevant permission to allow access to its data, as the network stack
is a privileged app.

Test: m -j passed
Change-Id: I6eab528714df6a17aae0cb546dcc3ad4bb21deea
2019-03-19 11:42:11 +09:00
Nicolas Geoffray
45963b59ae Allow init to set dalvik.vm.boot-image.
Test: m
Bug: 119800099
Change-Id: Idb4d4c6005e4ff271c1b5940bd39b655b674a0bb
2019-03-18 21:40:19 +00:00
Alex Salo
a1ce292dbb Add selinux setting for attention
Bug: 126472144
Test: adb shell dumpsys attention
Change-Id: Ie421b719c8fc0414ee664055aa5d007c081edf17
2019-03-18 21:00:35 +00:00
Andreas Gampe
2db55f184e Merge changes I15bd76e5,I5572c3b0
* changes:
  Sepolicy: Allow otapreopt_chroot to find linker
  Sepolicy: Move otapreopt_chroot to private
2019-03-18 21:00:04 +00:00
Treehugger Robot
118f0bf1fb Merge "fastboot: fs_mgr: overlay: suppress noise" 2019-03-18 20:51:59 +00:00
Andreas Gampe
3c581e2064 Sepolicy: Allow otapreopt_chroot to find linker
The linker is behind a symlink. Allow to read and follow.

Bug: 128840749
Test: m
Test: manual a/b ota
Test: DexoptOtaTests
Change-Id: I15bd76e517ab3cebf13ebd42ff6e5dae42364c83
2019-03-18 10:55:32 -07:00
Andreas Gampe
d6fdcefaa8 Sepolicy: Move otapreopt_chroot to private
Move complete domain to private/. Move referencing parts in domain
and kernel to private.

Bug: 128840749
Test: m
Change-Id: I5572c3b04e41141c8f4db62b1361e2b392a5e2da
2019-03-18 10:54:42 -07:00
Treehugger Robot
ac9cd71fed Merge "Sepolicy: Fix comment on apexd:fd use" 2019-03-16 23:50:32 +00:00
Mark Salyzyn
86f0e54dfa fastboot: fs_mgr: overlay: suppress noise
Suppress noise associated with test mounting scratch partition.

Add internal fs_mgr_is_ext4 and fs_mgr_is_f2fs to get heads up on
mount failures and thus bypass trying.  Resolve all the avc
complaints associated with overlay handling including these new
operations.

Test: adb-remount-test.sh
Bug: 109821005
Change-Id: Ieb1f8c19ced930b6fe2d1791ef710ce528da7e37
2019-03-15 13:25:11 -07:00