Commit graph

9038 commits

Author SHA1 Message Date
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
Treehugger Robot
63f8d969a9 Merge "sepolicy: Allow fd propagation from camera to display" 2022-11-03 23:12:43 +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
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
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
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
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
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
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
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
Treehugger Robot
4a5c2dee68 Merge "Add policies for new services HDMI and HDMICEC" 2022-10-19 02:58:03 +00:00
Hunsuk Choi
0c00096874 Merge "Add IRadioIms and IImsMedia context" 2022-10-17 06:13:01 +00:00
Rob Seymour
9833c60b35 Merge "Allow service managers access to apex data." 2022-10-14 18:04:46 +00:00
Hunsuk Choi
24abed20f5 Add IRadioIms and IImsMedia context
Bug: 216387835
Test: build & flash
Change-Id: I7eb3a45e1b13ca702e6bab7e152c4b4722ceccdd
(cherry picked from commit 26a4cc08701586459e1042604a204f6485c27d08)
Merged-In: I7eb3a45e1b13ca702e6bab7e152c4b4722ceccdd
2022-10-13 06:17:30 +00:00
Shraddha Basantwani
bacf949002 Allow CAS AIDL sample HAL
Bug: 230377377, 227673974
Test: manual
Change-Id: Ied6822d8114404b85dbed56ae4806de1bfb43e54
2022-10-12 19:42:20 +05:30
Sandro Montanari
9a8980aed5 Merge "Add auditallow for system properties access from the sdk sandbox" 2022-10-12 09:27:01 +00:00
Steven Moreland
dda67f95f0 Merge "crosvm: socket getopt" 2022-10-11 23:57:52 +00:00
Sandro
d0553529bb Add auditallow for system properties access from the sdk sandbox
We want to more closely monitor the system properties that the
sdk_sandbox has access to.

Bug: 210811873
Test: adb logcat | grep "r:sdk_sandbox"
Change-Id: I0d590374e931ca41d5451cd7c2de5b02fee619e9
2022-10-11 15:21:08 +00:00
Steven Moreland
34f6b26719 crosvm: socket getopt
Required in latest merge.

Bug: 250998415
Test: atest MicrodroidTestApp
Change-Id: I2888636bc5ed69c7908862cdb2ff48da37231a51
2022-10-11 01:13:29 +00:00
Akilesh Kailash
1044702704 Supress permissive audit messages post OTA reboot
For post-OTA boot, we run a userspace block device daemon to mount /system.
However if we let the daemon run while loading sepolicy, it would spam permissive audits.
Since sepolicy is still not enforced yet, we can supress these
audit messages.

Bug: 240321741
Test: Full OTA on pixel
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I0af484f95b6a1deb41498d67de82afd3c6bb29b6
2022-10-10 21:58:41 +00:00
Venkatarama Avadhani
38ff3b4115 Add policies for new services HDMI and HDMICEC
Test: atest vts_treble_vintf_framework_test
      atest vts_treble_vintf_vendor_test
Change-Id: Ic2c0525368218e207be236d073a3fe736151c43f
2022-10-10 15:40:42 +05:30
Peiyong Lin
33e03e09b4 Merge "Update SEPolicy for Thermal AIDL" 2022-10-07 04:00:17 +00:00
Keir Fraser
ad58b8d38a Allow virtualizationservice to create and manage socket files in its data folder
...and crosvm to access a listener socket when passed to it by file
descriptor from virtualizationservice.

Bug: 235579465
Test: Start a VM
Change-Id: I7e89cfb4fb8a1ce845eaea64a33dbaad6bff9969
2022-10-05 08:36:15 +00:00
Peiyong Lin
4a5d0f13c4 Update SEPolicy for Thermal AIDL
Bug: b/205762943
Test: build and boot
Change-Id: I301b85dafbf8fbb1c4be388aa0291e22f4717c99
2022-10-05 00:55:20 +00:00
Vikram Gaur
7bc1648f4a Merge "Add SELinux policies for remote_key_provisioning_native namespace." 2022-10-05 00:47:30 +00:00
Pete Bentley
ff0cf6f2a8 Update sepolicy prebuilts for PRNG seeder changes.
Cherry-pick note: This contains the original AOSP change plus
an addition to private/compat/32.0/32.0.ignore.cil which
does not _appear_ to be required on AOSP and future releases
but is required for tm-dev.  If needed we can add this to
AOSP later.

Bug: 243933553
Test: m sepolicy_freeze_test
Change-Id: Idc011c66dfe71aa6c8dfdbc0b0377d2957571b83
Merged-In: Idc011c66dfe71aa6c8dfdbc0b0377d2957571b83
(cherry picked from commit 96268c6622)
2022-10-04 15:02:53 +01:00
Steven Moreland
07c5387324 Merge "hidl2aidl: sepolicy changes for confirmationui aidl" 2022-10-03 19:10:31 +00:00
Florian Mayer
565653a0c4 Merge "[MTE] ignore mtectrl selinux error for device tree." 2022-10-03 16:23:19 +00:00
Pete Bentley
efa9e1111a Add SEPolicy for PRNG seeder daemon.
Manual testing protocol:
* Verify prng_seeder daemon is running and has the
  correct label (via ps -Z)
* Verify prng_seeder socket present and has correct
  label (via ls -Z)
* Verify no SELinux denials
* strace a libcrypto process and verify it reads seeding
  data from prng_seeder (e.g. strace bssl rand -hex 1024)
* strace seeder daemon to observe incoming connections
  (e.g. strace -f -p `pgrep prng_seeder`)
* Kill daemon, observe that init restarts it
* strace again and observe clients now seed from new instance

Bug: 243933553
Test: Manual - see above
Change-Id: I0a7e339115a2cf6b819730dcf5f8b189a339c57d
Merged-In: I0a7e339115a2cf6b819730dcf5f8b189a339c57d
(cherry picked from commit e6da3b80d1)
2022-09-30 17:26:22 +01:00
Florian Mayer
09f14e9c12 [MTE] ignore mtectrl selinux error for device tree.
Bug: 245624194
Test: adb logcat | grep sysfs_dt_firmware_android
Change-Id: Ia51def3dcc27b6d91cc10733b741186b3bd460c5
2022-09-29 22:53:58 +00:00
Vikram Gaur
e1c49f5524 Add SELinux policies for remote_key_provisioning_native namespace.
We need to separate out the feature flags in use by remote key
provisioning daemon (RKPD). For this, I have set up a new namespace
remote_key_provisioning_native. This change adds the SELinux policies to
make sure appropriate permissions are present when accessing the feature
flag for read/write.

Change-Id: I9e73a623f847a058b6236dd0aa370a7f9a9e6da7
Test: TreeHugger
2022-09-29 21:32:58 +00:00
Treehugger Robot
b44cb478d4 Merge "Grant appdomain remove_name permission on user_profile_data_file." 2022-09-29 11:46:41 +00:00
Jiakai Zhang
3c614b2ee1 Grant appdomain remove_name permission on user_profile_data_file.
To prevent race condition on a profile, the app holds a flock when writing the profile, and profman needs to hold a flock to read it. This
is not ideal because either side can get blocked by the flock.

We want to avoid using flock and do it in a move-based way: instead of
mutating the profile in place, the app creates a temp file next to it,
works on the temp file, and replaces the original file after it's done
(or deletes the temp file if it fails).

To achieve that, the app needs the remove_name permission.

Bug: 249522285
Change-Id: I16f27e6a9c5c3a7ab2ab8e24d3ad0a20119e16db
Test: Presubmit
2022-09-29 09:56:30 +00:00
Treehugger Robot
f974811fd7 Merge "Allow dumpstate to exec derive_sdk" 2022-09-28 23:03:35 +00:00
Mårten Kongstad
098e9094c3 Allow dumpstate to exec derive_sdk
derive_sdk is used to configure installed SDK extensions. It can also
print debug information about these.

Allow dumpstate to execute derive_sdk, to include the debug information
in bugreports.

Bug: 240656777
Test: adb bugreport /tmp/bugreport.zip && unzip -c /tmp/bugreport.zip bugreport*.txt | grep -i 'sdk extensions'
Change-Id: I0f502f9f94a376dff2e7eb821f7bf753de2d5482
2022-09-28 14:26:46 +02:00
Neil Fuller
81d2039656 Merge "Revert "Limit processes that can change settings sysprops"" 2022-09-28 09:01:58 +00:00
Neil Fuller
8fa264d60c Revert "Limit processes that can change settings sysprops"
This reverts commit c5980699a4.

Reason for revert: Vendor code is setting timezone_prop

Change-Id: Ib09e618745924bd95b4b9aa7106eb2e4cc7895eb
2022-09-28 08:52:46 +00:00
Sandro Montanari
7315a5af8c Merge "Rollback "Move allow rules of sdk_sandbox to apex policy"" 2022-09-28 08:47:37 +00:00
Neil Fuller
b9f8aad52c Merge changes I20b40cbe,Iac1bc330,I8d818342
* changes:
  Limit processes that can change settings sysprops
  Add new type for system settings metadata
  Reduce use of exported_system_prop
2022-09-27 23:01:26 +00:00
Treehugger Robot
490eb3cb75 Merge "[MTE] allow mtectrl to sync state to property." 2022-09-27 21:42:45 +00:00
Neil Fuller
c5980699a4 Limit processes that can change settings sysprops
Limit processes that can change global settings system properties.

Only system server and shell (for tests) should be able to set the
affected system properties.

Bug: 248307936
Test: treehugger only
Change-Id: I20b40cbedc9ad5277d08d033fc9d3ff6df7b7919
2022-09-27 16:08:59 +00:00
Neil Fuller
bbb00fa4cf Add new type for system settings metadata
Add a new selinux type for a system property used to hold metadata about
the time zone setting system property. Although system settings are
world readable, the associated metadata only needs to be readable by the
system server (currently).

Bug: 236612872
Test: treehugger
Change-Id: Iac1bc3301a049534ea5f69edf27cd85443e6a92e
2022-09-27 16:06:57 +00:00
Neil Fuller
0c4d8fff64 Reduce use of exported_system_prop
Reduce use of "exported_system_prop" by defining 2 new (currently
identical) "locale_prop" and "timezone_prop" types for the system
properties that are for "global system settings". See the comments in
private/property_contexts for details.

Initially the rights of the new types should be identical to
exported_system_prop but they will be reduced with a follow-up commit to
enable easier rollback / progress to be made on related work.

Bug: 236612872
Test: treehugger
Change-Id: I8d818342023bc462376c091b8a522532ccaf15d3
2022-09-27 16:05:54 +00:00
Florian Mayer
51382a3af0 [MTE] allow mtectrl to sync state to property.
Bug: 245624194
Change-Id: If580f3e64a839ee409b58e80300b927f6898c894
2022-09-27 15:56:33 +00:00
Amos Bianchi
8070ba00a7 Merge "Add sepolicy for new module." 2022-09-26 14:48:39 +00:00
Treehugger Robot
3e068f977f Merge changes I1cb8c3ac,Ib1a914b9
* changes:
  Grant artd read permissions on current profile directories.
  Grant artd write permissions on profile directories.
2022-09-26 12:27:56 +00:00
Sandro
692c3ad3b2 Rollback "Move allow rules of sdk_sandbox to apex policy"
Rolling back the changes from aosp/2206999.

Bug: 243923977#comment9
Test: atest SeamendcHostTest
Change-Id: I361811d021523f48f08bab5353ea5e03bc58fbef
2022-09-26 11:49:45 +00:00
Jiakai Zhang
28e69a4156 Grant artd read permissions on current profile directories.
The permissions are needed for profile-guided compilation: when ART
Services compiles an app, it uses the information in current profiles as
one factor to determine which classes and methods to compile.

Since there can be multiple current profiles, in practice, it merges
the current profiles into a "reference profile" and passes that to the
compiler. After the compilation is done successfully, it keeps the
reference profile and deletes current profiles.

This is currently done by installd
(http://cs/android-internal/system/sepolicy/public/installd.te;l=125;rcl=0cbe233cdc361b0976874b2df04392d74245aade),
and we'd like artd to do it.

In addition, we want to make artd work in a more atomic way: If a
reference profile already exists, instead of mutating it in place,
artd creates a temp file next to it, works on the temp file, and
replaces the original file after it's done (or deletes the temp file
if it fails).

Therefore, artd needs the permissions to read current profile files.
It also needs to be mlstrustedsubject because current profile files
seem to have MLS restrictions.

Otherwise, it will get SELinux denials like:

```
09-23 20:22:13.931  8097  8097 I binder:8097_2: type=1400 audit(0.0:164): avc: denied { search } for name="cur" dev="dm-53" ino=81 scontext=u:r:artd:s0 tcontext=u:object_r:user_profile_root_file:s0 tclass=dir permissive=1
09-23 20:22:13.931  8097  8097 I binder:8097_2: type=1400 audit(0.0:164): avc: denied { search } for name="0" dev="dm-53" ino=207 scontext=u:r:artd:s0 tcontext=u:object_r:user_profile_root_file:s0:c512,c768 tclass=dir permissive=1
```

Note the MLS restrictions `c512,c768` in the message above.

Bug: 248318911
Test: manual -
  1. adb shell pm art optimize-package -m speed-profile \
       com.google.android.youtube
  2. See no SELinux denials like above.
Change-Id: I1cb8c3ac07d3790a4d74d747707327b1d5d8ecfb
2022-09-26 10:51:41 +00:00
Jiakai Zhang
ff67b849bf Grant artd write permissions on profile directories.
The permissions are needed for profile-guided compilation: when ART
Services compiles an app, it uses the information in current profiles as
one factor to determine which classes and methods to compile.

Since there can be multiple current profiles, in practice, it merges
the current profiles into a "reference profile" and passes that to the
compiler. After the compilation is done successfully, it keeps the
reference profile and deletes current profiles.

This is currently done by installd
(http://cs/android-internal/system/sepolicy/public/installd.te;l=125;rcl=0cbe233cdc361b0976874b2df04392d74245aade),
and we'd like artd to do it.

In addition, we want to make artd work in a more atomic way: If a
reference profile already exists, instead of mutating it in place,
artd creates a temp file next to it, works on the temp file, and
replaces the original file after it's done (or deletes the temp file
if it fails).

Therefore, artd needs the permissions to add/delete/replace profile
files. Otherwise, it will get SELinux denials like:

```
09-23 19:51:37.951  5050  5050 I binder:5050_1: type=1400 audit(0.0:134): avc: denied { write } for name="com.google.android.youtube" dev="dm-52" ino=922 scontext=u:r:artd:s0 tcontext=u:object_r:user_profile_data_file:s0 tclass=dir permissive=1
09-23 19:51:37.951  5050  5050 I binder:5050_1: type=1400 audit(0.0:134): avc: denied { add_name } for name="primary.prof.6mOsV9.tmp" scontext=u:r:artd:s0 tcontext=u:object_r:user_profile_data_file:s0 tclass=dir permissive=1
```

Bug: 248318911
Test: manual -
  1. adb shell pm art optimize-package -m speed-profile \
       com.google.android.youtube
  2. See no SELinux denials like above.
Change-Id: Ib1a914b9a9526a85b69d27970e4b23c4e101c68a
2022-09-26 10:47:34 +00:00
Rob Seymour
ecbadbb141 Allow service managers access to apex data.
VintfObject will monitor for /apex directory for VINTF data.
Add permissions for service managers to read this data.

Bug: 239055387
Test: m && boot
Change-Id: I179e008dadfcb323cde58a8a460bcfa2825a7b4f
2022-09-23 21:33:58 +00:00
Subrahmanyaman
745efb4ced hidl2aidl: sepolicy changes for confirmationui aidl
Sepolicy changes for confirmationui while converting from hidl
to aidl.

Bug: b/205760172
Test: run vts -m VtsHalConfirmationUIV1_0Target
Change-Id: Ib21038fd89789755b978489f5293725b221d86c4
2022-09-23 19:00:15 +00:00
Amos Bianchi
3189fafa2a Add sepolicy for new module.
Bug: b/241442337
Test: TH
Change-Id: Ia58e2d4b205638509545a0a2c356cd68862beb1f
2022-09-23 10:40:47 -07:00
Vikram Gaur
f4382c5391 Merge "Add SELinux policy changes for rkpd" 2022-09-23 09:33:45 +00:00
Vikram Gaur
d25c80a951 Add SELinux policy changes for rkpd
This is a part of changes to bring up Remote Key Provisioning Daemon
module. See packages/modules/RemoteKeyProvisioning for more info.

Change-Id: Iae4e98176491637acb03e2e09b9d8dbc269be616
Test: atest rkpd_client_test
2022-09-23 05:09:00 +00:00
Pete Bentley
e6da3b80d1 Add SEPolicy for PRNG seeder daemon.
Manual testing protocol:
* Verify prng_seeder daemon is running and has the
  correct label (via ps -Z)
* Verify prng_seeder socket present and has correct
  label (via ls -Z)
* Verify no SELinux denials
* strace a libcrypto process and verify it reads seeding
  data from prng_seeder (e.g. strace bssl rand -hex 1024)
* strace seeder daemon to observe incoming connections
  (e.g. strace -f -p `pgrep prng_seeder`)
* Kill daemon, observe that init restarts it
* strace again and observe clients now seed from new instance

Bug: 243933553
Test: Manual - see above
Change-Id: I0a7e339115a2cf6b819730dcf5f8b189a339c57d
2022-09-22 15:13:20 +00:00
Yu Shan
e799e9284c Merge "Create selinux policy for remoteaccess HAL." 2022-09-22 01:17:00 +00:00
Weilin Xu
52546635b2 Applying new IBroadcastRadio AIDL
Update Sepolicy for AIDL broadcast radio HAL. Ignore
fuzzer default AIDL implementation for now.

Bug: 170336130
Test: m -j
Change-Id: Ie55c08c6a721de1f8dc40acc81de68565f99f7d7
2022-09-21 23:17:20 +00:00
Steven Moreland
5043c02262 Merge "hidl2aidl: conversion of gatekeeper hidl to aidl" 2022-09-21 21:26:01 +00:00
Reema Bajwa
396d34b7c8 Merge "Add SELinux changes for Credential Manager Service in system server Test: Built & Deployed on device locally." 2022-09-21 17:34:09 +00:00
Yu Shan
05a7389aa9 Create selinux policy for remoteaccess HAL.
Will add fuzzer once the service is implemented.

Test: Run remoteaccess HAL on gcar_emu. Verify the service is running.
Bug: 241483300
Change-Id: I01b31a88414536ddd90f9098f422ae43a48cf726
2022-09-20 18:09:49 -07:00
Anna Zhuravleva
2864a66331 Add sepolicy for Health Connect system service.
Add selinux policy so the healthconnect system service
can be accessed by other processes.

Bug: 246961138
Test: build
Change-Id: I37e0e7f1a2b4696b18f8876a107c509d2906e850
2022-09-20 17:14:35 +00:00
Reema Bajwa
5b57bfaf7e Add SELinux changes for Credential Manager Service in system server
Test: Built & Deployed on device locally.

Change-Id: I892107ed528e0ca7435aa29a0fa1e6dbf4f225c5
2022-09-19 17:51:06 +00:00
Subrahmanyaman
1d2a3fedcc hidl2aidl: conversion of gatekeeper hidl to aidl
Conversion of the gatekeeper hidl interface to stable aidl interface.

Bug: 205760843
Test: run vts -m VtsHalGatekeeperTarget
Change-Id: I44f554e711efadcd31de79b543f42c0afb27c23c
2022-09-19 17:43:26 +00:00
Jiyong Park
c4f84bcb37 Don't let ro.log.file_logger.path to be set
ro.log.file_logger.path is a system property that liblog uses to
determine if file_logger should be used (instead of logd) and what file
the logs should be emitted to. It is primarily meant for non-Android
environment like Microdroid, and doesn't need to be set in Android. In
fact, setting it to a wrong value can break the system logging
functionality. This change prevents such a problem by assigning a
dedicated property context (log_file_logger_prop) to the property and
making it non-writable. (Note that it still has to be readable because
liblog reads it and liblog can be loaded in any process)

Bug: 222592894
Test: try to set ro.log.file_logger.path

Change-Id: Ic6b527327f5bd4ca70a58b6e45f7be382e093318
2022-09-18 23:39:41 +09:00
Treehugger Robot
7c4f837e40 Merge "Microdroid: remove logd and logcat" 2022-09-17 13:03:08 +00:00
Jiyong Park
75e8c1f461 Microdroid: remove logd and logcat
Previously in Microdroid, processes send log messages to logd over
socket and then logcat ran to hand the message to the host side over the
serial console.

That has changed. Now, the liblog library which processes use to emit
logs directly sends the given message to the serial console. Liblog does
this by reading a new system property ro.log.file_logger.path. When this
is set, liblog doesn't use the logd logger, but opens the file that the
sysprop refers to and writes logs there.

This change implments sepolicy side of the story.

* logd and logcat types are removed since they no longer are needed.
* existing references to those types are removed as well.
* a new property type `log_prop` is introduced and the two system
  properties are labaled as log_prop
* all processes have read access to the system properties
* all processes have append access to /dev/hvc2

Bug: 222592894
Test: run microdroid, see log is still emitted.

Change-Id: I4c4f3f4fd0e7babeab28ddf39471e914445ef4da
2022-09-14 14:27:26 +00:00
Katherine Lai
e3398210b8 Add bluetooth LE inquiry scan parameters
Bug: 233119457
Tag: #floss
Test: Manual
Change-Id: I4d0b505b761ad49832ef1d5e5097f6aad7a472e7
2022-09-09 20:48:36 +00:00
Suren Baghdasaryan
2d390e5094 Merge "Add policies for ro.kernel.watermark_scale_factor property" 2022-09-09 16:55:25 +00:00
Treehugger Robot
5384619c62 Merge "Allow reading process info from /proc." 2022-09-09 16:48:05 +00:00
Jiakai Zhang
88e5583eac Allow reading process info from /proc.
This is needed for getting CPU time and wall time spent on subprocesses. Otherwise, the following denials will occur:

09-09 15:11:38.635  6137  6137 I binder:6137_1: type=1400 audit(0.0:185): avc: denied { read } for scontext=u:r:artd:s0 tcontext=u:r:dex2oat:s0 tclass=file permissive=1
09-09 15:11:38.635  6137  6137 I binder:6137_1: type=1400 audit(0.0:185): avc: denied { search } for name="6157" dev="proc" ino=57917 scontext=u:r:artd:s0 tcontext=u:r:dex2oat:s0 tclass=dir permissive=1
09-09 15:11:38.635  6137  6137 I binder:6137_1: type=1400 audit(0.0:185): avc: denied { open } for path="/proc/6157/stat" dev="proc" ino=57954 scontext=u:r:artd:s0 tcontext=u:r:dex2oat:s0 tclass=file permissive=1

Bug: 245380798
Test: -
  1. adb shell pm art optimize-package -m speed -f \
       com.google.android.youtube
  2. See CPU time and wall time in the output. No denial occured.
Change-Id: I9c8c98a31e1ac0c9431a721938c7a9c5c3ddc42b
2022-09-09 15:13:45 +00:00
Suren Baghdasaryan
9fdb29826f Add policies for ro.kernel.watermark_scale_factor property
New ro.kernel.watermark_scale_factor property is used to store the
original value read from /proc/sys/vm/watermark_scale_factor before
extra_free_kbytes.sh changes it. The original value is necessary to
use the same reference point in case the script is invoked multiple
times. The property is set by init the first time script is invoked
and should never be changed afterwards.

Bug: 242837506
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I7760484854a41394a2efda9445cff8cb61587514
2022-09-08 19:35:34 +00:00
Alessandra Loro
6ecd2077bc Merge "Drop back-compatibility for hiding ro.debuggable and ro.secure" 2022-09-08 09:51:22 +00:00
Sandro Montanari
3b94a3f3bc Revert^2 "Move allow rules of sdk_sandbox to apex policy"
Next attempt at rolling forward aosp/2200430. It appears the
first-stage-init did not create the /dev/selinux folder on GSI
instances, resulting in breakages when selinux.cpp tries to copy files
to that folder.

To verify these changes for b/244793900, follow
gpaste/4922166775644160

Bug: 243923977
Test: atest SeamendcHostTest
Change-Id: I2bc630cfaad697d44053adcfd639a06e3510cc72
2022-09-07 08:22:59 +00:00
Treehugger Robot
090f957d65 Merge "Fix io_uring permission denial for snapuserd" 2022-09-06 17:15:45 +00:00
Kelvin Zhang
aa3ac9fafd Fix io_uring permission denial for snapuserd
Starting with
91a9ab7c94
, calling io_uring_setup will need selinux permission to create anon
inodes.

Test: th
Bug: 244785938

Change-Id: I351983fefabe0f6fdaf9272506ea9dd24bc083a9
2022-09-06 17:11:54 +00:00
Kelvin Zhang
d87c1eb663 Merge "Fix selinux denials for fastbootd" 2022-09-06 05:50:57 +00:00
Kelvin Zhang
853085bd65 Fix selinux denials for fastbootd
Test: flash on O6, flash an image using git_master system + mainline
kernel
Bug: 244785938

Change-Id: I1b0e1ea0f1937abd2ad96a606b565812ee8096e1
2022-09-05 17:41:07 +00:00
Samiul Islam
b8650e82db Merge "Revert "Move allow rules of sdk_sandbox to apex policy"" 2022-09-05 11:45:44 +00:00
Sandro Montanari
8cce5b2ffb Revert "Move allow rules of sdk_sandbox to apex policy"
Revert "Add seamendc tests for sdk_sandbox in apex sepolicy"

Revert submission 2201484-sdk_sandbox

Note: this is not a clean revert, I kept the changes in aosp/2199179
and the changes to system/sepolicy/Android.mk. Those changes are already
part of internal, I do not want to put those files out of sync again.

Test: atest SeamendcHostTest
Reason for revert: b/244793900
Reverted Changes:
Ib14b14cbc:Add seamendc tests for sdk_sandbox in apex sepolic...
I27ee933da:Move allow rules of sdk_sandbox to apex policy

Change-Id: If225cdd090248e050d1f0b42f547a4b073bbafc6
2022-09-05 09:39:15 +00:00
Treehugger Robot
1896c039dd Merge "crosvm: dontaudit netlink perms for acpi" 2022-09-02 22:00:45 +00:00
Treehugger Robot
6eecd0a00c Merge "Allow installd delete staging folders." 2022-09-02 22:00:02 +00:00
Steven Moreland
fd59a2d46e crosvm: dontaudit netlink perms for acpi
Currently experiencing these neverallows, but they're intentional.

Fixes: 228077254
Test: N/A
Change-Id: I79f8caaf1695e91d695b8cecbc5f01df09e4e2d2
2022-09-02 20:41:56 +00:00
Alex Buynytskyy
37a0dcbbbc Allow installd delete staging folders.
Apparently readdir uses getattr and skips a folder if denied.

Bug: 244638667
Test: adb root; adb shell mkdir -p
/data/app-staging/session_917335144/lib; adb reboot; adb logcat | grep
session_917335144, check if the folder was removed

Change-Id: I39de49c77d3bf3428d75f0cf4d4c603ea7e03ed5
2022-09-02 13:16:24 -07:00