Commit graph

32884 commits

Author SHA1 Message Date
Yifan Hong
4238b0e15d Add charger_type.
This is the common type for domains that executes charger's
functionalities, including setting and getting necessary properties,
permissions to maintain the health loop, writing to kernel log, handling
inputs and drawing screens, etc.

Permissions specific to the system charger is not moved.

Also enforce stricter neverallow rules on charger_{status,config}_prop.

For charger_config_prop, only init / vendor_init can set.
For charger_status_prop, only init / vendor_init / charger / health HAL
  can set.
For both, only init / vendor_init / charger / dumpstate / health HAL
  can get.

(Health HAL is determined by the intersection of charger_type and
hal_health_server.)

A follow up CL will be added to add charger_type to hal_health_default,
the default domain for health HAL servers. Vendors may add charger_type
to their domains that serves the health AIDL HAL as well.

Test: manual
Bug: 203246116
Change-Id: I0e99b6b68d381b7f73306d93ee4f8c5c8abdf026
2021-11-05 18:44:04 -07:00
Yifan Hong
48732e041c Merge "Remove healthd." 2021-10-22 00:06:39 +00:00
Treehugger Robot
5b1dc1693a Merge "Move mediatranscoding type to public" 2021-10-21 11:06:22 +00:00
Bowgo Tsai
ef1f630c69 Set context for partition.odm.verified[.*] properties.
Some devices might have the ODM partition so set those properties
as well.

Bug: 203720638
Test: Presubmit
Change-Id: I50ee65e21c471f0691f4c1dfc93be8eb1677ad1b
2021-10-21 16:38:06 +08:00
Jeff Vander Stoep
1b2a0b4dab Move mediatranscoding type to public
Move type to public so that it can be vendor customized. This
can be necessary if (for example) the gralloc/gpu same-process-HAL
requires additional permissions.

Bug: 199581284
Test: build
Change-Id: I61a5a3ad96112d4293fd4bf6d55f939c974643ce
2021-10-21 09:10:45 +02:00
Yifan Hong
aabea20d89 Remove healthd.
Test: pass
Bug: 203245871
Change-Id: I4eb0b4333d7fde2096c4c75b7655baf897900005
2021-10-20 18:47:41 -07:00
Treehugger Robot
c0cd637049 Merge "Label /dev/hvcN paths" 2021-10-20 08:17:15 +00:00
Treehugger Robot
028e88f578 Merge "microdroid: Remove microdroid_app dontaudit" 2021-10-20 07:10:32 +00:00
Ady Abraham
7ed18e6d66 Composer stable AIDL HAL sepolicy
Test: build + presubmit
Bug: 198690444
Change-Id: I6a26823c4ad363d137526c96580b05363d0ac894
2021-10-20 02:58:20 +00:00
Ady Abraham
df28371462 Remove vrflinger
Not used anymore.

Test: build + presubmit
Bug: 170681929
Change-Id: I3ac9b842f89acf620e9f08516e44977d83064f2f
2021-10-20 02:02:57 +00:00
Jiyong Park
f264d79bf8 Label /dev/hvcN paths
They are virtual console devices. Label them as serial_devices.

Bug: 200914564
Test: m
Change-Id: I6a178360fa9977e9b50b0c07da2a506114369189
2021-10-19 22:43:45 +09:00
Michał Brzeziński
04e3a05fde Merge "Revert "Remove the bdev_type and sysfs_block_type SELinux attributes"" 2021-10-19 13:03:18 +00:00
Michał Brzeziński
e8739ba23a Revert "Remove the bdev_type and sysfs_block_type SELinux attributes"
Revert "Remove the bdev_type and sysfs_block_type SELinux attributes"

Revert "Remove the bdev_type and sysfs_block_type SELinux attributes"

Revert submission 1850578-remove-selinux-bdev-type

Reason for revert: DroidMonitor-triggered revert due to breakage, bug b/203480787

BUG: 203480787

Reverted Changes:
I263bce9c4:Remove the bdev_type and sysfs_block_type SELinux ...
Ibc9039f96:Revert "Add the 'bdev_type' attribute to all block...
Ic6ae83576:Remove the bdev_type and sysfs_block_type SELinux ...
Ie493022a8:Remove the bdev_type and sysfs_block_type SELinux ...
I1f1ca439b:Revert "Add the 'bdev_type' attribute to all block...
I283f8676b:Revert "Add the 'bdev_type' attribute to all block...
I7c5c242c5:Revert "Add the 'bdev_type' attribute to all block...
Id78d8f7dc:Remove the bdev_type and sysfs_block_type SELinux ...
I9c4b2c48b:Remove the bdev_type and sysfs_block_type SELinux ...
I51e9d384a:Remove the bdev_type and sysfs_block_type SELinux ...
I2c414de3b:Remove the sysfs_block_type SELinux attribute

Change-Id: I55609803d530772d507d9dca8ba202a96daf24b7
2021-10-19 10:57:42 +00:00
Inseob Kim
e4ef85e65a microdroid: Remove microdroid_app dontaudit
Some permissions used to make denials, but it seems that it's not the
case anymore.

Bug: 195751698
Test: atest MicrodroidHostTestCases
Change-Id: I3329bb9a6d4d17dc49a2469bae2cf17e6f0e49a9
2021-10-19 10:46:17 +00:00
Treehugger Robot
eaa9fa390b Merge "Allow test apps to use the virtualizationservice" 2021-10-19 10:33:23 +00:00
Jiyong Park
47d4b1ffdc Allow test apps to use the virtualizationservice
The existing host-side tests for virtualizationservice will be migrated
to device tests. In order for the self-instrumented test apks be able to
talk to the service, re-introduce the allow rule only for the
non-production builds.

Note that the access to the service is still guarded with the app
permission whose protection level now has the 'development' bit. So,
ordinary apks that are not testing-purpose (i.e. no
android:testOnly="true") can't use the service.

Bug: 203483081
Test: run MicrodroidDemoApp
Change-Id: Ia441fc5ca0a1f076d2e267a26e0df7c11730ec94
2021-10-19 17:18:42 +09:00
Treehugger Robot
0503ed283e Merge "Remove the bdev_type and sysfs_block_type SELinux attributes" 2021-10-19 01:05:55 +00:00
Maurice Lam
cde20c1fc6 Merge "SELinux rules for virtual device" 2021-10-18 20:13:42 +00:00
Daniel Norman
19d367c41a Merge "Allow zygote to canonicalize vendor apex paths." 2021-10-18 19:03:33 +00:00
Bart Van Assche
c50f66900f Remove the bdev_type and sysfs_block_type SELinux attributes
Remove these SELinux attributes since adding these attributes introduces
a depencency from vendor SELinux policies on the generic SELinux policy,
something that is not allowed. This patch includes a revert of commit
8b2b951349 ("Restore permission for shell to list /sys/class/block").
That commit is no longer necessary since it was a bug fix for the
introduction of the sysfs_block type.

Bug: 202520796
Test: source build/envsetup.sh && lunch aosp_x86_64 && m && launch_cvd
Change-Id: Ic6ae835768212648ca09fd5c83c39180103c3b1b
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-10-18 11:37:09 -07:00
Daniel Norman
cf2499a0ba Allow zygote to canonicalize vendor apex paths.
Bug: 199200417
Test: Build cuttlefish with an 'android'-targeting RRO in a
      vendor APEX. Observe no SELinux errors.
Change-Id: I4c73cb6d98b70282e10354d2596b261bd7c409db
2021-10-18 16:25:14 +00:00
Yi-Yo Chiang
43352fab2d Merge "Dist userdebug_plat_sepolicy.cil to facilitate VTS testing" 2021-10-18 06:32:36 +00:00
Maurice Lam
1517644d4d SELinux rules for virtual device
Bug: 194949534
Test: Manual
Change-Id: I5fcc83e313ce464e4a855b24d32fc2d82ee0b07e
2021-10-15 18:16:01 -07:00
Tianjie Xu
9cd93e48da Merge "Add context for checkin directory" 2021-10-15 21:19:26 +00:00
Yi-Yo Chiang
68478b1f1a Dist userdebug_plat_sepolicy.cil to facilitate VTS testing
repack_bootimg can use the userdebug_plat_sepolicy.cil artifact to
prepare a debuggable boot image for VTS testing.

(TODO in follow-up) The eliminates the need for GSI
boot-with-debug-ramdisk-*.img, and we can skip building them to
conserve build resources.

Bug: 202129499
Test: m out/target/product/generic_arm64/userdebug_plat_sepolicy.cil
Test: Check presubmit artifacts include userdebug_plat_sepolicy.cil
Change-Id: I7629e462d4febd05ebe8a89a7bc00e8724dcb4a4
2021-10-16 03:23:05 +08:00
Arthur Ishiguro
29dc02c044 Sensors stable AIDL HAL sepolicy
Bug: 195593357
Test: TreeHugger
Change-Id: I02b88a93d829654a1ce946681b59e648b2cd7550
2021-10-15 17:39:56 +00:00
Treehugger Robot
c080cea0a6 Merge "Microdroid: Allow apexd again to access block device information" 2021-10-15 14:37:55 +00:00
Zimuzo Ezeozue
dcb9369554 Merge "Allow MediaProvider to access the media metrics service" 2021-10-15 13:32:12 +00:00
Zim
26d73ceb6e Allow MediaProvider to access the media metrics service
This allows MediaProvider call certain MediaCodec APIs

Test: atest TranscodeTest
Bug: 190422448
Change-Id: Ied609152e6a9ba6d17b70db325ca33f1cb345eb8
2021-10-15 08:39:30 +00:00
Tianjie
b729aa6c5e Add context for checkin directory
Checkin apps use /data/misc_ce/<id>/checkin to backup the checkin
metadata. So users won't lose the checkin tokens when they clear
the app's storage.

One example is when GMScore is used for checkin, users may clear
GMScore data via "settings". If the device accidentally loses the
token without backup, it won't be able to checkin again until
factory reset.

The contents in checkin dir will be cleaned up when a user is removed
from the device. We also plan to add Gmscore test to ensure the dir
is cleaned up at checkin time, thus prevent other Gmscore modules
from using this storage by mistake.

Bug: 197636740
Test: boot device, check selinux label, check gmscore writes to the new dir
Change-Id: If3ff5e0fb75b4d49ce80d91b0086b58db002e4fb
2021-10-14 16:21:10 -07:00
Bart Van Assche
e475c8f1b5 Microdroid: Allow apexd again to access block device information
This patch is the Microdroid equivalent of
https://android-review.googlesource.com/c/platform/system/sepolicy/+/1850655

Bug: 202520796
Tests: Treehugger
Change-Id: I3428934115a62f64390738b144fbb801fc595561
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-10-14 15:38:28 -07:00
Treehugger Robot
7609e175c5 Merge "Stop using the bdev_type and sysfs_block_type SELinux attributes" 2021-10-14 17:58:57 +00:00
Bart Van Assche
398b0af20f Stop using the bdev_type and sysfs_block_type SELinux attributes
Stop using these attributes since these will be removed soon.

Bug: 202520796
Test: (AOSP) source build/envsetup.sh && lunch aosp_x86_64 && m && launch_cvd && adb -e shell dmesg | grep avc
Test: (sc-v2-dev) source build/envsetup.sh && lunch ...-userdebug && m && install-images-on-phone && adb root && adb dmesg | grep 'avc.*comm=.init'
Change-Id: I9f5a4c5c4d6c44fefa8e66c69fec62c99f9a728d
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-10-14 09:13:58 -07:00
Treehugger Robot
b732951030 Merge "Add ComposHostTestCases to system/sepolicy/TEST_MAPPING" 2021-10-14 01:03:18 +00:00
Dave McCloskey
74fd233c29 Merge "SEPolicy changes to support Attestation Verification Service" 2021-10-14 00:12:50 +00:00
Victor Hsieh
5844adf113 Add ComposHostTestCases to system/sepolicy/TEST_MAPPING
Bug: 195752513
Test: TH
Change-Id: I0e61e8cc46c248847a529ddc32f2636e97422b23
2021-10-13 16:42:27 -07:00
Steven Moreland
0c1991eee4 Merge "authfs - remove getattr perm for fd pass" 2021-10-13 17:30:11 +00:00
Bart Van Assche
41b61b7772 Merge "Revert "Stop granting init access to block device properties"" 2021-10-13 17:11:01 +00:00
Bart Van Assche
60b7d9a36e Revert "Stop granting init access to block device properties"
This reverts commit f20fea50f1.

Reason for revert: unbreak the git_sc-v2-dev-plus-aosp tests
Bug: 202879263

Change-Id: I79245afb4ba7f5be8ee46f2e91921a7327b650c5
2021-10-13 16:21:54 +00:00
Nicolas Geoffray
47a5f31980 Merge "Allow incidentd to read apex-info-list.xml." 2021-10-13 09:32:08 +00:00
Steven Moreland
2868112dff authfs - remove getattr perm for fd pass
We are no longer reading the ashmem size on every transaction.

Fixes: 195752513
Test: atest ComposHostTestCases (no denial logs)
Change-Id: If27c2b1d0efdccf30bc8c09e1004feb789e2425d
2021-10-12 21:54:42 +00:00
Treehugger Robot
b664b0ac79 Merge "Stop using the bdev_type and sysfs_block_type SELinux attributes" 2021-10-12 18:26:02 +00:00
Bart Van Assche
f4a1c36369 Merge "Stop granting init access to block device properties" 2021-10-12 17:37:59 +00:00
Bart Van Assche
6b53d731fd Stop using the bdev_type and sysfs_block_type SELinux attributes
Stop using these attributes since these will be removed soon.

Bug: 202520796
Test: source build/envsetup.sh && lunch aosp_x86_64 && m && launch_cvd
Change-Id: I61dffb482f4e952299156f34be642ae52fcbfeb3
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-10-12 09:45:11 -07:00
Bart Van Assche
f20fea50f1 Stop granting init access to block device properties
Although there has been a plan to add code to the init process that
requires access to block device properties, that plan has not been
realized. Hence stop granting the init process access to block device
properties

Bug: 202520796
Test: source build/envsetup.sh && lunch aosp_x86_64 && m && launch_cvd
Change-Id: I0ed83bd533a901f85986d15f636c9b3f39fec271
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-10-12 09:20:03 -07:00
Ian Hua
91d153e9b5 Update sepolicy for adding nnapi_native namespace.
Test: mm
Bug: 201399117
Change-Id: I40a2431b6f5a54deae27fe68f503aff9b99e2793
2021-10-12 11:50:26 +01:00
Nicolas Geoffray
7a2693b61e Allow incidentd to read apex-info-list.xml.
Spotted looking at a bugreport.

Test: m
Change-Id: I034099e5899b4fd75ec58f16f0fa49a3bdc079e1
2021-10-09 15:46:44 +01:00
Dave McCloskey
a7e47db710 SEPolicy changes to support Attestation Verification Service
Bug: 201696614
Change-Id: I4a7a830ba809ed59a030a87c4f479199685d8a42
Test: Verify device boots
2021-10-08 14:53:24 -07:00
Andrew Scull
aedd65ac20 Allow vendor_init to read AVF device configs
Bug: 192819132
Test: build
Change-Id: Iefa4d2d2dc0a13a9a6c95779d6ebde5cb2834295
2021-10-08 14:51:30 +00:00
Treehugger Robot
a5d1958d3e Merge "Add sepolicy for com.android.car.framework module" 2021-10-08 06:29:28 +00:00