Commit graph

4057 commits

Author SHA1 Message Date
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
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
Treehugger Robot
d125ab8f21 Merge "Allow dumpstate to dump wlan hal log on userbuild" 2019-03-22 07:15:13 +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
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
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
45963b59ae Allow init to set dalvik.vm.boot-image.
Test: m
Bug: 119800099
Change-Id: Idb4d4c6005e4ff271c1b5940bd39b655b674a0bb
2019-03-18 21:40:19 +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
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
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
Florian Mayer
4db9df1a92 Merge "Allow traced to lazily start heapprofd." 2019-03-15 18:17:52 +00:00
Jiyong Park
5a74473d1b No need to bind-mount bionic libraries
This is a partial revert of https://android-review.googlesource.com/c/platform/system/sepolicy/+/891474

The mount points at /bionic are gone. Therefore, init and
otapreopt_chroot do not need to bionic-mount bionic libraries.
Corresponding policies are removed.

Bug: 125549215
Bug: 113373927
Bug: 120266448
Test: m; device boots
Change-Id: I9d9d7ec204315fb5b66beec4e6a3c529bd827590
2019-03-15 14:28:27 +09:00
Treehugger Robot
005f019e04 Merge "Allow camera hal to read serialno." 2019-03-15 01:18:45 +00:00
Treehugger Robot
3637592a2d Merge "add label for /proc/sys/fs/verity/require_signatures" 2019-03-14 23:10:39 +00:00
Jayant Chowdhary
f7b53209a4 Allow camera hal to read serialno.
Bug: 128037879

Test: Camera HAL is able to read ro.serialno

Change-Id: I904c852a7100bc65456ee63ffb31d70681293d7d
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2019-03-14 14:36:41 -07:00
Jack Yu
be93704fc5 Merge "Changed IWLAN operation mode system properties to enum" 2019-03-14 20:49:08 +00:00
Florian Mayer
a769f0fd43 Allow traced to lazily start heapprofd.
Bug: 126724929

Change-Id: I15f0ae10d5e45fc65850635230e377b6f77ad4d7
2019-03-14 20:42:29 +00:00
Xiaoyong Zhou
a711d375ab add label for /proc/sys/fs/verity/require_signatures
This CL add new label for files created by fsverity.

Bug: 112038861
Test: ls -Z /proc/sys/fs/verity/require_signatures.
Change-Id: I8e49ad9a43282bc608449eb0db4ea78617c4ee9a
2019-03-14 12:44:31 -07:00
Tao Bao
ecc7e8cacb Move /sbin/charger to /system/bin/charger.
With the CLs in the same topic, it's being built as a dynamically linked
executable. And this applies to normal boot (including charger mode) and
recovery mode both.

/system/bin/charger under normal boot will be labeled as charger_exec,
which has the attribute of system_file_type.

The file in recovery image will still be labeled as rootfs. So we keep
the domain_trans rule for rootfs file, but allowing for recovery mode
only.

Bug: 73660730
Test: Boot into charger mode on taimen. Check that charger UI works.
Test: Boot into recovery mode. Check that charger process works.
Change-Id: I062d81c346578cdfce1cc2dce18c829387a1fdbc
2019-03-14 09:44:03 -07:00
Gavin Corkery
64b812c27e Rename data/pkg_staging to data/app-staging
Test: n/a
Bug: 126330086

Change-Id: I34d5085d8e6546d77cc854e27ca849462d482396
Merged-In: I34d5085d8e6546d77cc854e27ca849462d482396
2019-03-14 14:00:53 +00:00
Martijn Coenen
1f1c4c3fa5 Allow apexd to talk to vold.
To query filesystem checkpointing state.

Bug: 126740531
Test: no denials
Change-Id: I28a68b9899d7cb42d7e557fb904a2bf8fa4ecf66
2019-03-14 07:23:40 +00:00
Tri Vo
d6c5ff5f72 Allow global read access to /sys/kernel/mm/transparent_hugepage/
If kernel is built with CONFIG_TRANSPARENT_HUGEPAGE optimization,
libjemalloc5 will attempt to read
/sys/kernel/mm/transparent_hugepage/enabled and hit an SELinux denial.

Various denials similiar to the following are seen on cuttlefish:
avc: denied { open } for comm="surfaceflinger"
path="/sys/kernel/mm/transparent_hugepage/enabled" dev="sysfs" ino=776
scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:sysfs:s0 tclass=file
permissive=1

Bug: 28053261
Test: boot cuttlefish without above denials.
Change-Id: Ic33f12d31aacc42d662a8c5c297fbb5f84d4deea
2019-03-13 23:47:25 +00:00
Treehugger Robot
058f7f4add Merge "ODM updates the recovery partition through vendor's materials" 2019-03-13 21:36:50 +00:00
Suren Baghdasaryan
9902c67cfa Merge "sepolicy: Allow lmkd access to psi procfs nodes" 2019-03-13 20:51:31 +00:00
Tri Vo
3a463e108d Merge "vold: write permission to sysfs_devices_block" 2019-03-13 20:36:30 +00:00
Jack Yu
d8514fb33e Changed IWLAN operation mode system properties to enum
Changed the system properties to enum. The valid modes
are "default", "legacy", and "AP-assisted".

Test: Manual
Bug: 126218288

Change-Id: Ib70ed8606e845ca29453013a400b377647e15490
2019-03-13 10:15:39 -07:00
Suren Baghdasaryan
53065d6aa8 sepolicy: Allow lmkd access to psi procfs nodes
Lmkd needs read access to /proc/pressure/memory, proc/pressure/cpu
and proc/pressure/io nodes to read current psi levels.
Lmkd needs write access to /proc/pressure/memory to set psi monitor
triggers.

Bug: 111308141
Test: modified lmkd to use PSI and tested using lmkd_unit_test

Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Merged-In: I9efd60c7fbb89cc08938fa5119b13d794813b52b
Change-Id: I9efd60c7fbb89cc08938fa5119b13d794813b52b
2019-03-13 10:00:37 -07:00
wenquan.zhang
182d50d10b ODM updates the recovery partition through vendor's materials
This is for Non-AB ota update recovery partition on GMS Express 2.0 project.
recovery partition update via /vendor/bin/install-recovery.sh from /vendor/etc/recovery.img

Bug: 124277294
Test: builds and test GOTA.
Change-Id: I97521c03a881bd0427e5d02836220ee2c0db7650
2019-03-13 03:24:55 -07:00
Treehugger Robot
7a70210a47 Merge "Fix surface flinger property types" 2019-03-12 23:58:52 +00:00
Inseob Kim
8669f52f79 Fix surface flinger property types
Third parameter of a property_context entry should be "exact" if the
entry is for a single property, not a prefix.

And the type of each entry should be the fourth parameter.

Bug: 112386364
Test: m -j
Change-Id: I2ed31c9fd7c7424e3a6a51d44b4e85413ae316b7
2019-03-12 22:38:36 +00:00
Treehugger Robot
460efa2a01 Merge "Add policy for /metadata/apex." 2019-03-12 20:48:49 +00:00
Martijn Coenen
5fbbf2613c Add policy for /metadata/apex.
This is an area that apexd can use to store session metadata, which
won't be rolled back with filesystem checkpointing.

Bug: 126740531
Test: builds
Change-Id: I5abbc500dc1b92aa46830829be76e7a4381eef91
2019-03-12 18:31:07 +01:00
Tri Vo
5b60eb6397 vold: write permission to sysfs_devices_block
vold needs write permissions for /sys/block/*/uevent to perform a
coldboot.
https://android.googlesource.com/platform/system/vold/+/refs/heads/master/main.cpp#139

This denial is seen on cuttlefish:
avc: denied { write } for name=uevent dev=sysfs ino=11649
scontext=u:r:vold:s0 tcontext=u:object_r:sysfs_devices_block:s0
tclass=file permissive=1

Pixel devices resolve this denial in device policy, but since coldboot
is performed from platform code, the corresponding permission should be
in /system/sepolicy

Bug: 28053261
Test: boot cuttlefish without above denial
Change-Id: I2de08db603e2d287e8021af70ee8e69266d7736f
2019-03-11 13:36:56 -07:00
Steven Moreland
475f6d143f Merge "Clarify comment on tombstoned exception." 2019-03-08 20:19:43 +00:00
Steven Moreland
981f6c2d5e Clarify comment on tombstoned exception.
The OMX comment here seems unrelated. The linker (system) uses it to
talk to tombstoned.

Fixes: 112606643
Test: N/A
Change-Id: Ib3da832f120d3cc244aa22de5d4d655b874db38b
2019-03-07 15:24:07 -08:00
Jack Yu
bd534ed52b Fixed the inaccessable system properties
Moved the system properties from exported3_default
to exported_radio so that the service from vendor
partition can access that.

Test: Manual
Bug: 126218288
Change-Id: I055c1c26d1e25f5d12f2593b96eecf57be62d871
2019-03-07 21:36:47 +00:00
Tri Vo
131fa73add Restrict access to suspend control
Test: m selinux_policy
Change-Id: Ieccfd2aa059da065ace4f2db1b9634c52dd2cb24
2019-03-07 18:31:58 +00:00
David Anderson
d99b7fd3f9 Add sepolicy for /metadata/password_slots.
The device OS and an installed GSI will both attempt to write
authentication data to the same weaver slots. To prevent this, we can
use the /metadata partition (required for GSI support) to communicate
which slots are in use between OS images.

To do this we define a new /metadata/password_slots directory and define
sepolicy to allow system_server (see PasswordSlotManager) to access it.

Bug: 123716647
Test: no denials on crosshatch
Change-Id: I8e3679d332503b5fb8a8eb6455de068c22eba30b
2019-03-07 16:19:15 +00:00
Luke Huang
a116e1afe5 Merge "Add sepolicy for resolver service" 2019-03-07 05:35:12 +00:00
Treehugger Robot
c67985a067 Merge "Sepolicy: Allow crash_dump to ptrace apexd in userdebug" 2019-03-06 22:12:11 +00:00
Treehugger Robot
a5f5fc5afd Merge "health: allow wake_alarm capability." 2019-03-06 21:41:25 +00:00
Yifan Hong
2d0979268f health: allow wake_alarm capability.
CAP_WAKE_ALARM was required for timerfd_create since 4.10 kernel upstream.
Add capability to platform policy for healthd and health HAL.

Fixes: 124210362
Test: boots (sanity)
Change-Id: I8ebb383608eedd59beddec3f476b071e81b80871
2019-03-06 19:10:09 +00:00
Treehugger Robot
452d6a5faa Merge "Add a new system-to-vendor sysprop ro.apex.updatable" 2019-03-06 17:38:46 +00:00
David Anderson
731e104acc Merge "Allow gatekeeperd to read ro.gsid.image_running." 2019-03-06 02:40:03 +00:00
Andreas Gampe
efece54e06 Sepolicy: Allow crash_dump to ptrace apexd in userdebug
In userdebug, for better diagnostics, allow crash_dump to "connect
to" apexd.

Considering apexd is quite powerful, user devices remain restricted.

Bug: 118771487
Test: m
Change-Id: Id42bd2ad7505cd5578138bfccd8840acba9a334d
2019-03-05 09:59:50 -08:00
Treehugger Robot
51f6075f73 Merge "Fix denials during bugreport." 2019-03-05 17:27:58 +00:00
Luke Huang
524f25ebb0 Add sepolicy for resolver service
Bug: 126141549
Test: built, flashed, booted
Change-Id: I34260e1e5cc238fbe92574f928252680c1e6b417
2019-03-05 15:49:33 +00:00