Commit graph

39019 commits

Author SHA1 Message Date
Devin Moore
e714ba95ed Add sepolicy for new AIDL sensorservice
Test: boot cuttlefish and check for avc denials
Bug: 205764765
Change-Id: Ie9d02b43250ca3c5f642b2d87d2a5b532a9b5195
2022-11-14 17:26:24 +00:00
Lakshman Annadorai
f4ab6c9f3c Add sepolicies for CPU HAL.
Change-Id: Ia091bf8f597a25351b5ee33b2c2afc982f175d51
Test: Ran `m; emulator; adb logcat -b all -d > logcat.txt;`
      and verified CPU HAL is running without any sepolicy violation.
Bug: 252883241
2022-11-04 18:13:00 +00:00
Sandro
080c579d47 Move get_prop rules from public/app.te to private/app.te
This way we can prevent private types (e.g., sdk_sandbox) from accessing
those properties.

Bug: 210811873
Test: m -j, boot device
Change-Id: I55e3a4b76cabb6f47cee0972e6bad30565f0db7a
2022-11-04 09:34:22 +00:00
Alfred Piccioni
8a909eb966 Merge "Add NTFS support in sepolicy." 2022-11-04 09:22:51 +00:00
Yi-yo Chiang
b888a092b5 Merge "remount: Allow 'shell' to run 'remount_exec' domain" 2022-11-04 04:44:00 +00:00
Steven Moreland
f12e949b6c Merge "Use EXCEPTION_NO_FUZZER as default in fuzzer bindings" 2022-11-03 23:29:47 +00:00
Treehugger Robot
63f8d969a9 Merge "sepolicy: Allow fd propagation from camera to display" 2022-11-03 23:12:43 +00:00
Pawan Wagh
704df9c0e5 Use EXCEPTION_NO_FUZZER as default in fuzzer bindings
Bug: 257294037
Test: m
Change-Id: Iadc5cb3dde2a2b990e028e63a0cac8c5bdf6a0e4
2022-11-03 20:54:33 +00:00
Seth Moore
2a7198811a Merge "Limit special file permissions to the keymint server domain" 2022-11-03 18:39:50 +00:00
Alfred Piccioni
3e1dc57bf4 Add NTFS support in sepolicy.
This CR, when paired with a functional NTFS implementation and the
corresponding vold updates, will allow NTFS USB drives to be mounted
on Android.

Bug: 254407246

Test: Extensive testing with NTFS USB drives.
Change-Id: I259882854ac40783f6d1cf511e8313b1d5a04eef
2022-11-03 16:02:51 +01:00
Seth Moore
970cfa5674 Limit special file permissions to the keymint server domain
There are still some paths (potentially obsolete) on non-treble devices
where hal_keymint_client domains have the hal_keymint typeattribute
applied. In these cases, those domains also pick up the file access
permissions currently granted to hal_keymint.

Clean this up by limiting the permissions to hal_keymint_server only.

Test: VtsAidlKeyMintTargetTest
Change-Id: If1a437636824df254da245e7587df825b6963ed9
2022-11-03 05:30:01 +00:00
Steven Moreland
e5ff93de78 Merge "Adding trusty-confirmationui service fuzzer binding." 2022-11-01 17:04:48 +00:00
Andrew Scull
2c818d9b32 Merge "Revert "Allow vendors to set remote_prov_prop properties"" 2022-11-01 13:11:03 +00:00
Treehugger Robot
7b988006d1 Merge "Allow system_server to measure fs-verity" 2022-11-01 08:58:34 +00:00
Yi-Yo Chiang
686d77913d remount: Allow 'shell' to run 'remount_exec' domain
The domain of 'remount' used to be 'system_file', which is
read-executable by 'shell'. However when I submitted aosp/1878144, the
domain of 'remount' became 'remount_exec', and I forgot to allow
'shell' to read-execute the new 'remount_exec' domain.
This makes `adb remount` w/o root to produce sub-par error message:
  $ adb remount [-h]
  /system/bin/sh: remount: inaccessible or not found

Allow 'shell' to read-execute 'remount_exec', so that the user can get a
proper error message when not running as root, and help (-h) message can
be displayed:
  $ adb remount
  Not running as root. Try "adb root" first.
  $ adb remount -h
  Usage: remount ...

Bug: 241688845
Test: adb unroot && adb remount [-h]
Change-Id: I5c105eaffa7abddaf14a9d0120fd6b71749c7977
2022-11-01 15:39:49 +08:00
Seigo Nonaka
2b4bcf73e0 Allow system_server to measure fs-verity
Bug: 242892591
Test: atest GtsFontHostTestCases
Test: Manually verified the font files can be updated
Change-Id: Ic72fcca734dc7bd20352d760ec43002707e4c47d
2022-11-01 16:21:20 +09:00
Syed Haq
ed5ecbbda2 sepolicy: Allow fd propagation from camera to display
This is required to pass release fence FDs from camera to display

Test: Camera CTS
CRs-Fixed: 3184666
Bug: 234636443
Change-Id: I77884b37e254a9d56b8ec7b2e6dd71718f52d573
2022-10-31 15:48:54 -07:00
Andrew Scull
edba76d514 Revert "Allow vendors to set remote_prov_prop properties"
This reverts commit a87c7be419.

Reason for revert: I was mistaken and this isn't a property that the vendor should set, but the OEM should override from the product partition. That doesn't require sepolicy changes.

Bug: 256109167
Change-Id: Idebfb623dce960b2b595386ade1e4c4b92a6e402
2022-10-31 18:27:29 +00:00
Katherine Lai
803f4e86c4 Add bluetooth disable enhanced SCO connection
Bug: 255202220
Tag: #floss
Test: Manual
Change-Id: I79d8168e39e0e72335389ef5ba93e6c5ddf5a0af
2022-10-31 17:52:52 +00:00
Andrew Scull
c347dc28fa Merge "Allow vendors to set remote_prov_prop properties" 2022-10-28 11:35:49 +00:00
Andrew Scull
a87c7be419 Allow vendors to set remote_prov_prop properties
Vendors should be able to set the `remote_provisioning.tee.rkp_only` and
`remote_provisioning.strongbox.rkp_only` properties via
PRODUCT_VENDOR_PROPERTIES so grant `vendor_init` the permission to set
them.

The property wasn't able to use `system_vendor_config_prop()` as
`remote_prov_app` has tests which override the properties.

Bug: 256109167
Test: manual test setting the property from device.mk for cuttlefish
Change-Id: I174315b9c0b53929f6a11849efd20bf846f8ca29
2022-10-28 10:07:54 +00:00
Treehugger Robot
7bff1e56bb Merge "Don't allow payload to connect to host" 2022-10-28 08:13:13 +00:00
Treehugger Robot
8718b20689 Merge "Grant dumpstate access to update engine prefs" 2022-10-28 07:54:29 +00:00
Thiébaud Weksteen
0596a47aae Grant dumpstate access to update engine prefs
aosp/2215361 added the collection of update_engine preferences by
dumpstate. Add the corresponding policy. The /data/misc/update_engine
directory only contains the prefs/ subdirectory (see
DaemonStateAndroid::Initialize in update_engine).

Bug: 255917707
Test: m selinux_policy
Change-Id: I8c80f319d97f22f29158dd67352c3429d3222a35
2022-10-28 14:36:31 +11:00
Treehugger Robot
e6a43ec4c9 Merge "Add selinux rules for android.hardware.usb.gadget.IUsbGadget AIDL migration" 2022-10-27 14:03:48 +00:00
Ricky Niu
fc1463c164 Add selinux rules for android.hardware.usb.gadget.IUsbGadget AIDL migration
Covers the rules needed for the default AIDL implementation.

10-26 10:22:42.408   448   448 I auditd  : type=1400 audit(0.0:95): avc: denied { read } for comm="android.hardwar" name="interrupts" dev="proc" ino=4026531995 scontext=u:r:hal_usb_gadget_default:s0 tcontext=u:object_r:proc_interrupts:s0 tclass=file permissive=0

Bug: 218791946
Test: reboot and check if AIDL service is running.

Signed-off-by: Ricky Niu <rickyniu@google.com>
Change-Id: I8bdab3a682398f3c7e825a8894f45af2a9b6c199
2022-10-27 15:42:56 +08:00
Thiébaud Weksteen
685cc43e62 Merge "Ignore access to /proc/zoneinfo for apps" 2022-10-26 22:52:22 +00:00
Alan Stokes
c69ad27186 Fix VS denials on fifo_file
While running the MicrodroidTests I noticed denials like these:
 avc: denied { getattr } for comm="virtualizations" path="pipe:[86794]"
 dev="pipefs" ino=86794 scontext=u:r:virtualizationservice:s0
 tcontext=u:r:untrusted_app:s0:c122,c256,c512,c768 tclass=fifo_file
 permissive=0

These are harmless, so we could dontaudit them, but it is also fine
to simply allow getattr.

Test: atest MicrodroidTests, no denials seen
Change-Id: I53a2967eb6e396979a86715b3d5a7681f48dcb63
2022-10-26 11:26:58 +01:00
Alan Stokes
960e186823 Don't allow payload to connect to host
The payload can listen for inbound connections from the host (routed
via Virtualization Service), but should not be connecting out to the
host - by doing so a VM could connect to an unrelated host process.

(authfs still connects outbound, but has its own domain.)

Bug: 243647186
Test: atest MicrodroidTests ComposHostTestCases
Change-Id: I16d225975d6bcbe647c5fbff21b10465eacd9cb6
2022-10-26 11:23:07 +01:00
Thiébaud Weksteen
d601699002 Ignore access to /proc/zoneinfo for apps
Similarly to /proc/vmstat, apps are not allowed to access this file.
Ignore the audit message, as this is the most reported denial in our
droidfood population.

Test: m selinux_policy
Change-Id: I88ed1aa1bfad33b462d971e739ca65791cb0227b
2022-10-26 19:44:27 +11:00
Treehugger Robot
b65de6ed0a Merge "Add odm_service_contexts module" 2022-10-26 02:46:45 +00:00
Rajesh Nyamagoud
f9fed0102e Adding trusty-confirmationui service fuzzer binding.
Bug: b/205760172
Test: m
Change-Id: I448fcaf2c9440689312e273c608b44f415ccf1f4
2022-10-25 17:11:05 +00:00
Gabriel Biren
b7e21bcfe7 Merge "Add SeLinux policy for WiFi Vendor HAL AIDL service." 2022-10-25 17:03:10 +00:00
Henry Fang
0c3f615602 Merge "Allow CAS AIDL sample HAL" 2022-10-25 16:38:20 +00:00
Jiakai Zhang
1b89f6370a Merge "Update SELinux policy to allow artd to perform secondary dex compilation" 2022-10-25 13:12:16 +00:00
Treehugger Robot
6a80e5c6fd Merge "Allow priv apps to use virtualizationservice" 2022-10-25 09:04:08 +00:00
Nikita Ioffe
dd32f3bfbc Merge "Switch to tombstoned.microdroid" 2022-10-24 23:25:43 +00:00
Treehugger Robot
878ac541e7 Merge "Add sepolicy for background_install_control service" 2022-10-24 21:18:14 +00:00
Wenhao Wang
e825ad2a62 Add sepolicy for background_install_control service
The background_install_control service is going to detect
background installed apps and provide the list of such apps.

Bug: 244216300
Test: manual
Change-Id: I6500f29ee063da4a3bc18e109260de419dd39218
2022-10-24 11:26:35 -07:00
Jiakai Zhang
2ffeca72a6 Update SELinux policy to allow artd to perform secondary dex compilation
Secondary dex files are in app data directories. In order to perform
secondary dex compilation, artd needs permissions to:
- Read secondary dex files
- Create "oat" dir
- Create a reference profile in "oat" dir
- Rename the reference profile
- Delete the reference profile
- Read the current profile in "oat" dir
- Delete the current profile
- Create compilation artifacts in "oat" dir
- Rename compilation artifacts
- Delete compilation artifacts

Bug: 249984283
Test: -
  1. adb shell pm art optimize-package --secondary-dex -m speed-profile -f com.google.android.gms
  2. See no SELinux denial.
Change-Id: I19a0ea7895a54c67959b22085de27d1d0ccc1efc
2022-10-24 16:07:01 +01:00
Nikita Ioffe
d0fb527326 Switch to tombstoned.microdroid
Bug: 239367015
Test: microdroid presubmits
Change-Id: I01b4cc90425d79c5b33b8e17bf9fe942c3d6233b
2022-10-24 15:36:19 +01:00
Alan Stokes
30608520bf Allow priv apps to use virtualizationservice
And allow VS and crosvm access to privapp_data_file, to the same
extent as app_data_file.

Update some comments, move a neverallow to the bottom of the file with
the others.

Bug: 255286871
Test: Install demo app to system/priv-app, see it work without explicit grant.
Change-Id: Ic763c3fbfdfe9b7a7ee6f1fe76d2a74281b69f4f
2022-10-24 15:33:02 +01:00
Inseob Kim
3bb2033eb1 Add odm_service_contexts module
Bug: 240609481
Test: build and boot
Change-Id: I5412b4a190d30490cad1bf2b9de1afd16085eb26
2022-10-24 20:41:45 +09:00
Reema Bajwa
7e707248b2 Merge "Add app_api_service and ephemeral_app_api to credential_service selinux policy to allow regular apps and instant apps to access credential manager Test: Built & deployed locally Bug: 253155284 Feature Bug: 241268646" 2022-10-22 00:41:37 +00:00
Arthur Ishiguro
3002f1afe2 Merge "Add sepolicy for default Context Hub HAL access to stats service" 2022-10-20 16:29:32 +00:00
Treehugger Robot
8cd5d0b899 Merge changes I9deb367b,I8c88622e,I18747dc6,I4e94db4a
* changes:
  Generate compat files and modules with scripts
  Fix wrongly hardcoded version
  Remove deprecated distutils dependency
  Remove redundant comments
2022-10-20 04:12:45 +00:00
Arthur Ishiguro
ca5474c5cf Add sepolicy for default Context Hub HAL access to stats service
Bug: 254328944
Test: Verify no selinux error through logcat
Change-Id: Iebc7e6c42a99d091dd1afcc5ff0204bd6f3c71e7
2022-10-19 16:49:01 +00:00
Gabriel Biren
e310ef8163 Add SeLinux policy for WiFi Vendor HAL AIDL service.
Bug: 205044134
Test: Manual - reboot phone and check if AIDL
      service is running.
Change-Id: I242e6ef860d2defdb0ab0a3d649b2a4e3f0de5a6
2022-10-19 16:34:56 +00:00
Reema Bajwa
d151d63fa0 Add app_api_service and ephemeral_app_api to credential_service selinux policy to allow regular apps and instant apps to access credential manager
Test: Built & deployed locally
Bug: 253155284
Feature Bug: 241268646

Change-Id: I6cf6738858bccfbb07f0cf2e92fcbd472b4c56ce
2022-10-19 14:50:46 +00:00
Inseob Kim
f87eb38696 Generate compat files and modules with scripts
The steps have been done by hand, which is highly errorprone.

Bug: 207344718
Test: run the script manually
Change-Id: I9deb367b0cbd8d357147f83964bc214cd00266f7
2022-10-19 18:32:01 +09:00