Commit graph

7214 commits

Author SHA1 Message Date
Bart Van Assche
e3cfa9e1d3 Revert "Remove the bdev_type and sysfs_block_type SELinux attributes"
This reverts commit 63930d3850.

Reason for revert: Broken build (https://android-build.googleplex.com/builds/submitted/7863094/aosp_raven-userdebug/latest/view/logs/error.log)

Change-Id: I1742d69d471e9b00359a2e7e654aa752513990df
2021-10-28 18:03:49 +00:00
Bart Van Assche
187ffea5b8 Merge "Remove the bdev_type and sysfs_block_type SELinux attributes" 2021-10-28 16:45:54 +00:00
Treehugger Robot
f88e2dfe94 Merge "hal_neverallow: Add hal_uwb_server exceptions" 2021-10-27 21:03:29 +00:00
Roshan Pius
329b0c81a8 hal_neverallow: Add hal_uwb_server exceptions
These are similar to the existing exceptions added for
`hal_uwb_vendor_server`.

Also, added a TODO to remove the older `hal_uwb_vendor` tags once we
migrate to the new T architecture.

Bug: 196225233
Test: Compiles
Change-Id: I2077d409f575a2e46684de4fb92fe3da0cceaf70
2021-10-27 12:46:44 -07:00
Steven Moreland
cc7de177ec Remove bufferhub HAL policy.
The bufferhub daemon policy still remains, since it still needs to be
deleted. However, since the HAL no longer exists, removing policy
related to this.

Bug: 204068144
Test: build only
Change-Id: I96b96c77a39e2ba2024680ebaf3067283d0cfc65
2021-10-27 10:54:45 -07:00
Yifan Hong
388bbbccb3 Add health AIDL HAL.
Test: pass
Bug: 177269435
Change-Id: I755d5158715b38a89a28af753ad4c27cdfa93546
2021-10-26 19:34:34 -07:00
Chris Weir
4ac3d74a70 SEPolicy for Netlink Interceptor
Make Netlink Interceptor work when SELinux is enforcing

Test: Netlink Interceptor HAL comes up and works
Bug: 194683902
Change-Id: I3afc7ae04eba82f2f6385b66ddd5f4a8310dff88
2021-10-26 10:03:14 -07:00
Bart Van Assche
63930d3850 Remove the bdev_type and sysfs_block_type SELinux attributes
Remove these SELinux attributes since the apexd and init SELinux policies
no longer rely on these attributes.

The only difference between a previous version of this patch and the
current patch is that the current patch moves these attributes to the
'compat' policy. See also
https://android-review.googlesource.com/c/platform/system/sepolicy/+/1850656.

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 && adb -e shell dmesg | grep avc
Change-Id: Id7d32a914e48bc74da63d87ce6a09f11e323c186
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-10-25 16:26:07 -07:00
Tomasz Wasilczyk
9d56107b3d Enable Telephony AIDL-HIDL shim HAL
Bug: 203699028
Test: Boot with ag/16078505 applied
Change-Id: Ib9afbe2217670ccfc163812c6b73d9d11d748d2d
2021-10-25 12:59:46 -07:00
shubang
9fa7dc9c7b Add SE policy for tv_iapp
Bug: 203730671
Test: cuttlefish;
Change-Id: I533f2004343aafe5660e4018e73111880dfa647f
2021-10-22 00:02:05 -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
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
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
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
Treehugger Robot
0503ed283e Merge "Remove the bdev_type and sysfs_block_type SELinux attributes" 2021-10-19 01:05:55 +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
Maurice Lam
1517644d4d SELinux rules for virtual device
Bug: 194949534
Test: Manual
Change-Id: I5fcc83e313ce464e4a855b24d32fc2d82ee0b07e
2021-10-15 18:16:01 -07: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
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
Dave McCloskey
74fd233c29 Merge "SEPolicy changes to support Attestation Verification Service" 2021-10-14 00:12:50 +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
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
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
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
Xin Li
2b2247f14c Merge "Merge Android 12" 2021-10-07 23:50:37 +00:00
David Anderson
2c6b2326a7 Merge "allow init to set status on loop device" 2021-10-07 15:49:18 +00:00
Enrico Granata
393ebdda04 Merge "Introduce ro.boot.hypervisor properties" am: dd35626853
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1843773

Change-Id: I4ff9a7c008590a5ca17987aac95c5afab441f392
2021-10-04 19:20:47 +00:00
Enrico Granata
645c390d1a Introduce ro.boot.hypervisor properties
In virtualized deployments of Android, it can be useful to have
access to a description of the hypervisor/host environment being
used to run the guest OS instance.

This is represented by means of a new system property
ro.boot.hypervisor.version, which is meant to convey a
free-form descriptor of the current host/hypervisor version

The property is meant to be provided to Android as androidboot.
by whatever host-specific means are used to supply other boot
properties to the target Android instance. Access could be later
opened to other vendor processes to set if needed for specific
setups where init is not a sufficiently-early stage for
host/guest communication. Such setups are not known at this time.

For a native Android incantation, the property defaults to
being missing

Other properties could later be added to this same namespace
and context if they turn out to be useful in specific scenarios.

Bug: 178749018
Test: build cuttlefish
Change-Id: Id721c14ef1958b525c2866a660dcae8fd176a79d
2021-10-04 11:14:03 -06:00
Liangcai Fan
486be79cb7 allow init to set status on loop device
Bug: 200904398

Change-Id: I02b0a4edcd47e325da7ec8200d5167485e4084c9
Signed-off-by: Liangcai Fan <liangcai.fan@unisoc.com>
2021-10-01 10:49:40 +08:00
Treehugger Robot
7301e308bb Merge "Grant apexd access the SELinux type sysfs_devices_block" am: d190e5242d
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1834854

Change-Id: Iad612edd06d3f35a470b1936e15efeeceb918f5f
2021-09-24 02:17:05 +00:00
Bart Van Assche
27f77dc9b0 Grant apexd access the SELinux type sysfs_devices_block
Commit ec50aa5180 ("Allow the init and apexd processes to read all
block device properties") did not include the SELinux type
sysfs_devices_block although it should have included that SELinux
type. Fix this.

Bug: 194726804
Change-Id: Ia299a0a8b28160c634863e15ae66fae8f18a5efb
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-09-23 09:52:11 -07:00
Arthur Ishiguro
e310e59585 Allow dumpstate to dump Context Hub HAL am: 876ded0bf8
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1833654

Change-Id: I13e5d45df4881c39ef65fc69bc2609f0aad9ff86
2021-09-22 23:18:11 +00:00
Arthur Ishiguro
876ded0bf8 Allow dumpstate to dump Context Hub HAL
Bug: 194285834
Test: adb bugreport
Change-Id: I6cd7efddf207b896303278539ddb824ad2e4c454
2021-09-22 18:44:49 +00:00
Treehugger Robot
c7801169d8 Merge "Bundle proc_bootconfig permission into read_fstab" am: 855f16dd87
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1826536

Change-Id: I93104b7549a3596ad62a37f80ab747f8cc770a90
2021-09-15 03:51:17 +00:00
Treehugger Robot
855f16dd87 Merge "Bundle proc_bootconfig permission into read_fstab" 2021-09-15 03:36:24 +00:00
Kelvin Zhang
2b5f108143 Bundle proc_bootconfig permission into read_fstab
fs_mgr::ReadDefaultFstab calls fs_mgr:ReadFstabFromDt() which eventually
calls fs_mgr_get_boot_config_from_bootconfig_source to read boot config.
Therefore bundle permission to read proc_bootconfig. This resolves some
selinux denials for update_engine

Test: th
Change-Id: Ia8bd94eb33a38ccd939577b54910645fec4ccda8
2021-09-14 18:44:42 -07:00
Christopher Ferris
a325b5c195 Merge "Allow crash_dump to read from /data/local/tests." am: adaabe529c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821636

Change-Id: Id23835b202676224eac8c57b1322d55df28cd87f
2021-09-09 23:43:49 +00:00
Christopher Ferris
f2acb20e1b Allow crash_dump to read from /data/local/tests.
Without this change, any crash from an executable in /data/local/tests
is incomplete. Specifically, function names are missing which makes
the crash nearly useless for debugging.

Bug: 197229540

Test: Used the crasher executable and copied it to /data/local/tests
Test: and verified that running it as root and shell results in
Test: tombstones that have full unwinds with function names.
Change-Id: Ic4862ca6ee9b02132a593ccd5fe26508ed5c8510
2021-09-09 14:49:36 -07:00
Alan Stokes
872a6f52aa Restrict VM usage to platform_app. am: f96cd6557e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1820377

Change-Id: I61be7eadb593bef05d1afa7bda448dfb1978bbe0
2021-09-09 04:34:17 +00:00
Alan Stokes
f96cd6557e Restrict VM usage to platform_app.
Remove access from untrusted apps and instead grant it to platform_app
(but on user builds as well as debug).

Also restrict any app from creating a vsock_socket; using an already
created one is fine.

Bug: 193373841
Test: Microdroid demo app now gets a denial
Test: Rebuild demo with certifcate: platform, adb install, no denial
Change-Id: I7be011e05244767a42d4c56e26de792db4fe599d
2021-09-09 02:30:43 +00:00
Ytai Ben-Tsvi
7e393109dd Allow audioserver to access sensorservice am: c71b2c18cc
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1821634

Change-Id: I637157e5836746048bc597ccc97ad5cb506bf561
2021-09-08 21:50:34 +00:00
Ytai Ben-Tsvi
c71b2c18cc Allow audioserver to access sensorservice
This is required for accessing sensor data in audioserver.

Bug: 188502620
Test: log-based verification of sensor data coming through.
Change-Id: I183ce5106401ae7853096e80a8650cc7919e6221
2021-09-08 11:44:11 -07:00
Alan Stokes
8d90131012 Merge "SEPolicy for compos_verify_key." am: d1ac340034
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1818452

Change-Id: I22c4c3ed09c2db1ee66f524b9ca1d5e4c26c0b91
2021-09-06 08:08:49 +00:00
Alan Stokes
d1ac340034 Merge "SEPolicy for compos_verify_key." 2021-09-06 07:55:58 +00:00
Bart Van Assche
5ebe643596 Add the 'bdev_type' attribute to all block device types am: d05534f3d5
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1816979

Change-Id: If14fc996690a70802f3e5ed4e807fc966de4d783
2021-09-03 22:28:44 +00:00
Alan Stokes
39f497013c SEPolicy for compos_verify_key.
Remove some allow rules for odsign, since it no longer directly
modifies CompOs files. Instead allow it to run compos_verify_key in
its own domain.

Grant compos_verify_key what it needs to access the CompOs files and
start up the VM.

Currently we directly connect to the CompOs VM; that will change once
some in-flight CLs have landed.

As part of this I moved the virtualizationservice_use macro to
te_macros so I can use it here. I also expanded it to include
additional grants needed by any VM client that were previously done
for individual domains (and then deleted those rules as now
redundant).

I also removed the grant of VM access to all apps; instead we allow it
for untrusted apps, on userdebug or eng builds only. (Temporarily at
least.)

Bug: 193603140
Test: Manual - odsign successfully runs the VM at boot when needed.
Change-Id: I62f9ad8c7ea2fb9ef2d468331e26822d08e3c828
2021-09-03 16:31:02 +01:00
Bart Van Assche
d05534f3d5 Add the 'bdev_type' attribute to all block device types
The following patch iterates over all block devices:
https://android-review.googlesource.com/c/platform/system/core/+/1783847/9

The following patch grants 'init' and 'apexd' permission to iterate over
all block devices:
https://android-review.googlesource.com/c/platform/system/sepolicy/+/1783947

The above SELinux policy change requires to add the 'bdev_type'
attribute to all block devices. Hence this patch.

Bug: 194450129
Test: Untested.
Change-Id: I706285544f348944ca0c24e031b7c4e1052ec390
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-09-02 10:13:16 -07:00
Treehugger Robot
3367996656 Merge "allow installd to kill dex2oat and dexoptanalyzer" am: 4442c1f7eb
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1798367

Change-Id: I8412c792979bc2a4f1aadb41016bdc210621d924
2021-09-01 17:24:58 +00:00
Treehugger Robot
4442c1f7eb Merge "allow installd to kill dex2oat and dexoptanalyzer" 2021-09-01 17:11:23 +00:00
Roshan Pius
fbfb4a8b89 Allow uwb HAL client/server to talk to service manager am: 3015324460
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1811079

Change-Id: Ia652e5350fd0cf86ad8648a04c4d27f50bd06c50
2021-08-28 00:26:44 +00:00
Roshan Pius
3015324460 Allow uwb HAL client/server to talk to service manager
Denial logs:
08-27 21:43:18.716   801   801 W android.hardwar: type=1400 audit(0.0:4): avc:
denied { call } for scontext=u:r:hal_uwb_default:s0 tcontext=u:r:servicemanager:s0
tclass=binder permissive=0

Bug: 195308730
Test: Bootup default UWB HAL implementation on cuttlefish & verify UCI stack
can talk to the HAL.

Change-Id: I493af52513fd5b8f89d1375f80226ffa10c34f48
2021-08-28 00:01:59 +00:00
Ankita Vyas
e0d6c3604f Merge "Add selinux changes for Locale Manager Service" am: 7ac013be94
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1810459

Change-Id: Idd51d097ffd18b7e0f4c47e4e83221d24b787b94
2021-08-27 04:13:38 +00:00
Ankita Vyas
7ac013be94 Merge "Add selinux changes for Locale Manager Service" 2021-08-27 03:59:42 +00:00
Treehugger Robot
209b78ab83 Merge "sepolicy: Change UWB HAL from HIDL to versioned AIDL" am: d7fc7bd30b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1809163

Change-Id: I423431ce2bee07fd3c2a968f4c59799b17fa71c6
2021-08-27 01:55:54 +00:00
Roshan Pius
7076dfaa4f Merge "sepolicy: Add UWB HAL interface in AOSP" am: ea6c84b560
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1808158

Change-Id: I8168654bf875acbec024e8a2d144cbfb0486ef17
2021-08-27 00:37:05 +00:00
Roshan Pius
cd8333b53a sepolicy: Change UWB HAL from HIDL to versioned AIDL
No new HIDL HAL's are allowed in Android T. UWB HAL converted to
versioned AIDL interface to be compliant.

Bug: 195308730
Test: Compiles
Change-Id: I35cf8edd244baa02778ee8eff46840ae26424869
2021-08-27 00:28:56 +00:00
“Ankita
623ece0386 Add selinux changes for Locale Manager Service
Test: build and booted device

Bug: 194094788

Change-Id: Ic3c1f135985a5003ed07a8da9dbd7a3f8b61ae71
2021-08-26 14:33:24 +00:00
Roshan Pius
37ee61f663 sepolicy: Rename hal_uwb -> hal_uwb_vendor
Since we are now creating an AOSP HAL for uwb. Rename Pixel specific
internal UWB HAL from Android S to hal_uwb_vendor to avoid conflicts
with the AOSP HAL sepolicy rules that are going to be added in
Android T.

Android S Architecture:
|Apps | AOSP API | Vendor Service | Vendor HAL Interface | Vendor HAL
Implementation | Vendor driver/firmware

Android T Architecture:
|Apps | AOSP API | AOSP Service | AOSP HAL Interface | Vendor HAL
Implementation | Vendor driver/firmware

Ignore-AOSP-First: Dependent changes in internal-only projects.

Bug: 195308730
Test: Compiles
Change-Id: I7bf4794232604372134ea299c8e2a6ba14a801d3
Merged-In: I7bf4794232604372134ea299c8e2a6ba14a801d3
(cherry picked from commit 40465250e4)
(cherry picked from commit 27ab309fad)
2021-08-26 05:20:39 +00:00
Roshan Pius
8a5370c5e4 sepolicy: Add UWB HAL interface in AOSP
Adding sepolicy rules for the AOSP HAL interface.

Ignore-AOSP-First: Dependent changes in internal-only projects.

Bug: 195308730
Test: Compiles
Change-Id: I56302b570a749f7d72b6fe8f4f4a8767ea4785c1
Merged-In: I56302b570a749f7d72b6fe8f4f4a8767ea4785c1
2021-08-24 20:10:21 -07:00
Roshan Pius
65e938e539 sepolicy: Rename hal_uwb -> hal_uwb_vendor
Since we are now creating an AOSP HAL for uwb. Rename Pixel specific
internal UWB HAL from Android S to hal_uwb_vendor to avoid conflicts
with the AOSP HAL sepolicy rules that are going to be added in
Android T.

Android S Architecture:
|Apps | AOSP API | Vendor Service | Vendor HAL Interface | Vendor HAL
Implementation | Vendor driver/firmware

Android T Architecture:
|Apps | AOSP API | AOSP Service | AOSP HAL Interface | Vendor HAL
Implementation | Vendor driver/firmware

Ignore-AOSP-First: Dependent changes in internal-only projects.

Bug: 195308730
Test: Compiles
Change-Id: I7bf4794232604372134ea299c8e2a6ba14a801d3
Merged-In: I7bf4794232604372134ea299c8e2a6ba14a801d3
2021-08-24 20:10:06 -07:00
Keith Mok
e3ace79b18 Merge "Revert "crash_dump: supress denials for files in /proc"" am: 97935f4898
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1789807

Change-Id: Ic2f8920b0c49fb19e70184395da7afb7e55d1f8e
2021-08-23 16:27:48 +00:00
Keith Mok
97935f4898 Merge "Revert "crash_dump: supress denials for files in /proc"" 2021-08-23 16:15:20 +00:00
Suren Baghdasaryan
a3152de04d Merge "Allow init to execute extra_free_kbytes.sh script" am: ce8e066761
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1782248

Change-Id: I53559bd04d3e65dec4ee2187636677e91ededc27
2021-08-17 19:24:23 +00:00
Suren Baghdasaryan
ce8e066761 Merge "Allow init to execute extra_free_kbytes.sh script" 2021-08-17 19:17:59 +00:00
Eric Biggers
2b7e9943d9 Merge "Restore permission for shell to list /sys/class/block" am: cc0f64416f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1797007

Change-Id: I60b12f2a7cb088b8e648149d9356f9b00f97adbe
2021-08-17 19:17:07 +00:00
Suren Baghdasaryan
6988677f22 Allow init to execute extra_free_kbytes.sh script
extra_free_kbytes.sh is used by init to set /sys/vm/watermark_scale_factor
value. Allow init to execute extra_free_kbytes.sh and the script to access
/proc/sys/vm/watermark_scale_factor and /proc/sys/vm/extra_free_kbytes
files.

Bug: 109664768
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I55ec07e12a1cc5322cfdd4a48d0bdc607f45d832
2021-08-17 17:02:38 +00:00
Keun young Park
d577958598 allow installd to kill dex2oat and dexoptanalyzer
Bug: 179094324
Bug: 156537504

Test: confirm that installd killing those processes are not brininging
      selinux violation
Change-Id: Icac3f5acc3d4d398bbe1431bb02140f3fe9cdc45
2021-08-17 09:48:47 -07:00
Eric Biggers
8b2b951349 Restore permission for shell to list /sys/class/block
As a side effect, commit ec50aa5180 ("Allow the init and apexd
processes to read all block device properties") removed permission for
the shell context to list the /sys/class/block directory.  There is a
CTS test that relies on this (CtsNativeEncryptionTestCases), so grant
permission to do this again.

Bug: 196521739
Bug: 194450129
Test: Before this change, 'adb shell ls /sys/class/block' fails.
      After this change, 'adb shell ls /sys/class/block' succeeds.
Change-Id: I87cb90880f927db1385887b35c84f4dd7f95021b
2021-08-16 10:54:44 -07:00
Arthur Ishiguro
cfa6d86d50 Context Hub stable AIDL sepolicy am: e1ced2f4d8 am: 779c996ebd
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1792668

Change-Id: Icdfb36f33e59953f6f13eb9901803ff61d2d4c90
2021-08-11 03:28:18 +00:00
Arthur Ishiguro
e1ced2f4d8 Context Hub stable AIDL sepolicy
Bug: 194285834
Test: TreeHugger
Change-Id: I88675f7f61821619abbff87fa5ee321836745324
2021-08-10 22:06:43 +00:00
Keith Mok
0e486b6c6f Merge "Allow crash_dump to read uptime" am: 6e9494af08 am: 1f349fd8a9
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1789687

Change-Id: Ifa0f57b9200743166aa20ce3ee9bbd0aa96bc8b7
2021-08-10 07:45:19 +00:00
Keith Mok
6e9494af08 Merge "Allow crash_dump to read uptime" 2021-08-10 07:25:46 +00:00
Jiyong Park
047e5af29b Merge "Don't prevent crosvm from accessing vendor-owned VM disk images" am: 11d2b1c5c9 am: 88e069900e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1789271

Change-Id: I06bef31e792e6f8c6e6745e9281dbaf518674016
2021-08-10 01:54:59 +00:00
Bart Van Assche
7efcbf568c Allow the init and apexd processes to read all block device properties am: ec50aa5180 am: b00618fb9f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1783947

Change-Id: Iac344ff86cae6870c6f29fc2b4fb5529482a4219
2021-08-10 01:54:52 +00:00
Jiyong Park
11d2b1c5c9 Merge "Don't prevent crosvm from accessing vendor-owned VM disk images" 2021-08-10 01:34:08 +00:00
Bart Van Assche
ec50aa5180 Allow the init and apexd processes to read all block device properties
Addressing b/194450129 requires configuring the I/O scheduler and the
queue depth of loop devices. Doing this in a generic way requires
iterating over the block devices under /sys/class/block and also to
examine the properties of the boot device (/dev/sda). Hence this patch
that allows 'init' and 'apexd' to read the properties of all block
devices. The patch that configures the queue depth is available at
https://android-review.googlesource.com/c/platform/system/core/+/1783847.

Test: Built Android images, installed these on an Android device and verified that modified init and apexd processes do not trigger any SELinux complaints.
Change-Id: Icb62449fe0d21b3790198768a2bb8e808c7b968e
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-09 13:46:41 -07:00
Jiyong Park
3fee5a43c1 Don't prevent crosvm from accessing vendor-owned VM disk images
There can be VM disk images that are specific to the underlying SoC.
e.g. in case where SoC-specific hardware is dedicated to a VM and the VM
needs drivers (or HALs) for the hardware.

Don't prevent crosvm from reading such a SoC-specific VM disk images.

Note that this doesn't actually allow crosvm to do that in AOSP. Such an
allow rule could be added in downstreams where such use cases exist.

Bug: 193605879
Test: m
Change-Id: If19c0b6adae4c91676b142324c2903879548a135
2021-08-09 11:13:54 +09:00
Keith Mok
c3e42c0034 Revert "crash_dump: supress denials for files in /proc"
This reverts commit bd247bc88a.

Bug: 193159611
Bug: 183575981
Test: manual

Change-Id: Id79f623d7aa759862a519411f95ab364e9916f6b
2021-08-07 18:01:21 +00:00
Keith Mok
a03659044b Allow crash_dump to read uptime
crash_dump need to read process uptime
which need to be calc by minus the system uptime

Bug: 193159611
Bug: 183575981
Test: manual
Change-Id: I9f071007f31b8101d2d67db19b5d2b2835e6c5a4
2021-08-07 17:59:54 +00:00
Rick Yiu
e7d3b3d499 Merge "Move vendor_sched to common sepolicy" am: 2e8a281466 am: 2daa7d932b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1781205

Change-Id: Ic0104cc1606286dba5066dceea8b66c75f4480f0
2021-07-30 04:11:22 +00:00
Rick Yiu
2e8a281466 Merge "Move vendor_sched to common sepolicy" 2021-07-30 03:47:38 +00:00
Rick Yiu
b31ec34eef Move vendor_sched to common sepolicy
Previously vendor_sched is put under product area which will be replaced
by GSI. To solve it, move it to system/sepolicy.

Bug: 194656257
Test: build pass
Change-Id: Ia0b855e3a876a58b58f79b4fba09293419797b47
2021-07-30 03:01:32 +00:00
Linzhao Ye
b2abee1922 Merge "Add SeLinux policy for hostapd AIDL service." am: f023c126fc am: ded1063fd2
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1781487

Change-Id: Id5fd54b83225a7e7caa5d3c102dff6a68753cdbd
2021-07-29 16:42:16 +00:00
Linzhao Ye
f023c126fc Merge "Add SeLinux policy for hostapd AIDL service." 2021-07-29 16:12:41 +00:00
Chris Ye
b7bb89b551 Add SeLinux policy for hostapd AIDL service.
Bug: 194806512
Test: Manual test wifi hotspot.
Change-Id: I12b3e93650fcc6f2ea8794970fa8cf62c0a82475
2021-07-28 23:37:46 -07:00
David Anderson
8429ed5bdf Merge "Add new snapuserd socket and property rules." am: f595435798 am: f9d4e5003b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1778706

Change-Id: Ie1d65724b6b8e4e3cfb2413bd7838c27c310559c
2021-07-28 22:25:06 +00:00
David Anderson
bf5b6ce422 Add new snapuserd socket and property rules.
This adds a new property prefix owned by snapuserd, for communicating
when the service is ready to accept connections (snapuserd.ready and
snapuserd.proxy_ready).

This also adds a new socket context. This is a seqpacket socket used to
communicate with a special instance of snapuserd that bridges to the
first-stage daemon.

Bug: 193833730
Test: no denials after OTA applies and boots
Change-Id: Ibad03659eba5c25e205ba00f27d0b4f98585a84b
2021-07-27 10:50:59 -07:00
Hongguang
e6b51cec20 Allow Tuner AIDL sample HAL. am: 2179e112e1 am: cc12e7bf00
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1760683

Change-Id: I66bb1ec1efe05f6e0725fb25c09984cbc33c7bd7
2021-07-26 22:17:05 +00:00
Hongguang
2179e112e1 Allow Tuner AIDL sample HAL.
Bug: 191825295
Test: tuner HAL can run
Change-Id: I069da68cb4fec535c6549a9a0f89202eb17ef003
2021-07-26 11:35:18 -07:00
Jiyong Park
c9996ffadd Merge "Add rules for virtualizationservice and crosvm" am: d59b429b63 am: cf84b7571b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1763405

Change-Id: Ie906fccde2e3e120627d780fe6c4eaa215068f7d
2021-07-26 13:58:07 +00:00
Jiyong Park
d59b429b63 Merge "Add rules for virtualizationservice and crosvm" 2021-07-26 13:25:39 +00:00
Jiyong Park
5e20d83cfb Add rules for virtualizationservice and crosvm
The test for the services has been running with selinux disabled. To
turn selinux on, required rules are allowed.

Below is the summary of the added rules.

* crosvm can read the composite disk files and other files (APKs,
APEXes) that serve as backing store of the composite disks.
* virtualizationservice has access to several binder services
  - permission_service: to check Android permission
  - apexd: to get apex files list (this will be removed eventually)
* Both have read access to shell_data_file (/data/local/tmp/...) for
testing purpose. This is not allowed for the user build.
* virtualizationservice has access to the pseudo terminal opened by adbd
so that it can write output to the terminal when the 'vm' tool is
invoked in shell.

Bug: 168588769
Test: /apex/com.android.virt/bin/vm run-app --log /dev/null
/data/local/tmp/virt/MicrodroidDemoApp.apk
/data/local/tmp/virt/MicrodroidDemoApp.apk.idsig
/data/local/tmp/virt/instance.img
assets/vm_config.json

without disabling selinux.

Change-Id: I54ca7c255ef301232c6e8e828517bd92c1fd8a04
2021-07-26 10:45:08 +09:00
Kalesh Singh
a51fc2334e Merge changes from topic "suspend-aidl-1" am: 792d519b56 am: 7929a9faa8
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1772909

Change-Id: I81ddd1984dff94fe62c89e65fe375996a7141ed4
2021-07-23 21:25:42 +00:00
Kalesh Singh
21baa7a9cd sepolicy: Serve suspend AIDL hal from system_suspend am: 0e903620a5 am: 599387666b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1772908

Change-Id: I4d55e0a02f283fd1405d406cddf0a967fd5d4528
2021-07-23 21:25:40 +00:00
Joel Galenson
406090c009 Merge "Correctly alphabetize a newly-added ioctl definition." am: d055774b74 am: 03300f05ab
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1774790

Change-Id: I455ef4562da245f5d22dbd265f5ca30310d80e12
2021-07-23 21:25:29 +00:00
Kalesh Singh
599387666b sepolicy: Serve suspend AIDL hal from system_suspend am: 0e903620a5
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1772908

Change-Id: If424997bdb78a1b14b78b6ffcaf0d7f3cc2c8380
2021-07-23 20:56:44 +00:00
Kalesh Singh
792d519b56 Merge changes from topic "suspend-aidl-1"
* changes:
  sepolicy: Update wakelock_use macro
  sepolicy: Serve suspend AIDL hal from system_suspend
2021-07-23 17:16:28 +00:00
Joel Galenson
6dd5117864 Correctly alphabetize a newly-added ioctl definition.
Thanks to nnk for noticing this!

Test: Build
Change-Id: I3d6e5b223aabcf3ec93dc62112fc194af13e6a60
2021-07-22 09:38:53 -07:00
Kalesh Singh
d86bcd1dfd sepolicy: Update wakelock_use macro
Update wakelock_use macro to allow requesting wakelocks from system
supend AIDL hal.

Bug: 170260236
Test: boot; Check logcat for avc denials
Change-Id: I43b69cd39b3f1c858b3f0133ea317800b796fd9c
2021-07-21 00:03:36 +00:00
Kalesh Singh
0e903620a5 sepolicy: Serve suspend AIDL hal from system_suspend
Allow system_suspend to server the suspend AIDL hal service.

Bug: 170260236
Test: Check logcat for supend avc denials
Change-Id: Ie4c07e2e8d75fd4b12e55db15511060e09be59cf
2021-07-20 18:54:55 +00:00
Joel Galenson
998299d40a Merge "Add FUNCTIONFS_ENDPOINT_ALLOC to ioctl_defines and mediaprovider.te" am: 6d20ea2095 am: da51d74a17
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1762745

Change-Id: Iaa012198476ce0249ffd9bc492faf58e90baa186
2021-07-20 15:39:47 +00:00
Joel Galenson
6d20ea2095 Merge "Add FUNCTIONFS_ENDPOINT_ALLOC to ioctl_defines and mediaprovider.te" 2021-07-20 15:11:58 +00:00
Treehugger Robot
ce3a4de8d8 Merge "Add TARE service to SE policy." am: 9daeadb31e am: ba23828e12
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1766506

Change-Id: I7498a860b4dae6e1f5c4e4b4cd38fe700794558b
2021-07-17 02:03:39 +00:00
Kweku Adams
988d073012 Add TARE service to SE policy.
Bug: 158300259
Test: adb shell dumpsys tare
Change-Id: I30c11631110d6bc4f291357dda639449aa9c39d3
2021-07-14 10:25:14 -07:00
David Anderson
7adb8aa5cb Merge "Fix e2fsck denials introduced by latest e2fsprogs merge." am: 00edd4b095 am: d2a3b73672
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1764018

Change-Id: Ia26f8c4b013b10ec34b8cd85939f9fbcbc88427e
2021-07-13 19:15:57 +00:00
David Anderson
00edd4b095 Merge "Fix e2fsck denials introduced by latest e2fsprogs merge." 2021-07-13 18:39:31 +00:00
David Anderson
8a525d768f Fix e2fsck denials introduced by latest e2fsprogs merge.
This resulted from changes in e2fsprogs logic which traverses
/proc/mounts to warn about fixing a mounted filesystem.

Denials:

        07-08 15:08:21.207   853   853 I auditd  : type=1400 audit(0.0:88): avc: denied { getattr } for comm="e2fsck" path="/metadata" dev="vda12" ino=2 scontext=u:r:fsck:s0 tcontext=u:object_r:metadata_file:s0 tclass=dir permissive=0
        07-08 15:08:21.207   853   853 I auditd  : type=1400 audit(0.0:89): avc: denied { search } for comm="e2fsck" name="/" dev="tmpfs" ino=1 scontext=u:r:fsck:s0 tcontext=u:object_r:mirror_data_file:s0 tclass=dir permissive=0

Bug: 193137337
Test: treehugger
Change-Id: Ib050463f7fa6ea453795c933ff388d3594bb7c23
2021-07-13 10:17:30 -07:00
Treehugger Robot
7406fa45c1 Merge "Refactor apex data file types." am: 4fea2f0e16 am: cafed410aa
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1763205

Change-Id: I47fec594b7f8af80f46c15c4502105e9b8836211
2021-07-13 08:48:26 +00:00
Macpaul Lin
641c5ae99d Add FUNCTIONFS_ENDPOINT_ALLOC to ioctl_defines and mediaprovider.te
We've got a SELinux warning in kernel-5.10 when "File Transfer" (MTP)
has been enabled by user.

Error log:
avc: denied { ioctl } for  pid=5521 comm="MtpServer" path="/dev/usb-ffs/mtp/ep1" dev="functionfs" ino=102677 ioctlcmd=0x67e7 scontext=u:r:mediaprovider:s0:c512,c768 tcontext=u:object_r:functionfs:s0 tclass=file permissive=0

Repeat steps:
  1. Connect the phone to PC with USB cable.
  2. Select "File Transfer" (MTP) in "USB Preferences" Menu.
  3. Selinux warning will arise after "File Transfer" has been enabled by user
     due to an IOCTL access to /dev/usb-ffs/mtp/ep1.

Solution:
  To solve this warning, add a sepolicy to allow this type of IOCTL is required.

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Change-Id: Id340fb98062b3cee239343f3800f6dfceadeb572
Bug: 193473440
2021-07-13 09:33:15 +08:00
Alan Stokes
fa10a14fac Refactor apex data file types.
We ended up with 4 labels for specific APEX files that were all
identical; I've replaced them with a single one
(apex_system_server_data_file).

Additionally I created an attribute to be applied to a "standard" APEX
module data file type that establishes the basics (it can be managed
by vold_prepare_subdirs and apexd), to make it easier to add new such
types - which I'm about to do.

Fix: 189415223
Test: Presubmits
Change-Id: I4406f6680aa8aa0e38afddb2f3ba75f8bfbb8c3c
2021-07-12 14:41:04 +01:00
Bram Bonné
3f36b24504 Merge "untrusted_app_30: add new targetSdk domain" am: c1d9d9a85c am: 86943d839a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1752122

Change-Id: I243310bb512309a3bf0cb3dc0267cec78e430925
2021-07-08 11:41:10 +00:00
Bram Bonné
c1d9d9a85c Merge "untrusted_app_30: add new targetSdk domain" 2021-07-08 11:01:41 +00:00
Treehugger Robot
01bfd5d032 Merge "Add persist.nfc property" am: cb83d70584 am: 41ac67c619
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1733494

Change-Id: I2b3d1c2374533b3f5946a735e8e359ad12d624a2
2021-07-06 08:52:25 +00:00
Treehugger Robot
cb83d70584 Merge "Add persist.nfc property" 2021-07-06 08:05:46 +00:00
Bram Bonné
ea5460ab6e untrusted_app_30: add new targetSdk domain
Enforce new requirements on app with targetSdkVersion=32 including:
- No RTM_GETNEIGH on netlink route sockets.
- No RTM_GETNEIGHTBL on netlink route sockets.

Bug: 171572148
Test: atest NetworkInterfaceTest
Test: atest bionic-unit-tests-static
Test: atest CtsSelinuxTargetSdkCurrentTestCases
Test: atest CtsSelinuxTargetSdk30TestCases
Test: atest CtsSelinuxTargetSdk29TestCases
Test: atest CtsSelinuxTargetSdk28TestCases
Test: atest CtsSelinuxTargetSdk27TestCases
Test: atest CompatChangesSelinuxTest
Test: atest NetlinkSocketTest
Change-Id: I2167e6cd564854c2656ee06c2202cfff2b727af5
2021-07-05 11:42:31 +02:00
Treehugger Robot
2422d8c87d Merge "allow init to access watermark_boost_factor" am: 6ab599ec46 am: c74f64278b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1753820

Change-Id: I2f71652ec00855267ac02fc239d9a4af96c5b127
2021-07-04 08:42:17 +00:00
Treehugger Robot
6ab599ec46 Merge "allow init to access watermark_boost_factor" 2021-07-04 08:16:08 +00:00
Treehugger Robot
2614dd1bbe Merge "Allow the kernel to read shell_data_file" am: 8ea29cd4de am: d2c7fb074b
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1752600

Change-Id: Ie6b38ae5aef42b658ca9440e72f9856dde982e3e
2021-07-02 19:38:24 +00:00
Treehugger Robot
8ea29cd4de Merge "Allow the kernel to read shell_data_file" 2021-07-02 19:13:46 +00:00
Yabin Cui
5edae0da4d Merge changes Ia2defe72,Icef1ebdd am: e43222e19b am: 93bb35adf9
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1753148

Change-Id: Ia74495af553bf3977d14ae0c62e0730f70f1d6b8
2021-07-02 16:59:13 +00:00
Yabin Cui
e43222e19b Merge changes Ia2defe72,Icef1ebdd
* changes:
  allow simpleperf to profile more app types.
  simpleperf_app_runner: move rules to private.
2021-07-02 16:37:38 +00:00
Martin Liu
4db56b0b52 allow init to access watermark_boost_factor
Bug: 189938926
Test: boot
Signed-off-by: Martin Liu <liumartin@google.com>
Change-Id: I07c8490c94c837952921e95f12efa6213edbf056
2021-07-01 12:24:52 +08:00
Yabin Cui
41a18f5bf3 simpleperf_app_runner: move rules to private.
Bug: 192404394
Test: build
Change-Id: Icef1ebdd59668b31a07ac0a5aea30a87eac1da45
2021-06-30 17:24:05 -07:00
Hasini Gunasinghe
4334d35f01 Add keystore permission for metrics re-routing.
Keystore2 atoms need to be rounted to statsd via a proxy.
The proxy needs to have this permission in order to pull metrics from
keystore.

Ignore-AOSP-First: No mergepath to AOSP.
Bug: 188590587
Test: Statsd Testdrive script
Change-Id: Ic94f4bb19a08b6300cfd2d3ed09b31d5b7081bfd
Merged-In: Ic94f4bb19a08b6300cfd2d3ed09b31d5b7081bfd
(cherry picked from commit 61d07e7ce0)
2021-06-30 17:02:14 -07:00
Janis Danisevskis
e1a289b66f Merge "Rename vpnprofilestore to legacykeystore." into sc-dev am: adb49d3df6
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/14981212

Change-Id: Ie341418b9491cd93e2af1ebe354f943e8ff85499
2021-06-30 19:57:20 +00:00
Janis Danisevskis
4678660d83 Rename vpnprofilestore to legacykeystore.
Bug: 191373871
Test: N/A
Merged-In: I3f11827909bd37a2127069de82670776a8e192b3
Change-Id: I3f11827909bd37a2127069de82670776a8e192b3
2021-06-30 12:40:39 -07:00
Janis Danisevskis
ab433c765b Rename vpnprofilestore to legacykeystore.
Ignore-AOSP-First: No mergepath from AOSP.
Bug: 191373871
Test: N/A
Change-Id: I3f11827909bd37a2127069de82670776a8e192b3
2021-06-30 09:36:30 -07:00
Jooyung Han
4b8ece3683 Allow the kernel to read shell_data_file
In ApexTestCases, a temp file in /data/local/tmp is used via a loop
device, which requires the kernel to read it.

This is only allowed in userdebug/eng.

Bug: 192259606
Test: ApexTestCases
Change-Id: Ic7d3e67a8a3e818b43b7caead9053d82cbcbccf7
2021-07-01 00:04:41 +09:00
Hasini Gunasinghe
7611870f49 Merge "Add keystore permission for metrics re-routing." into sc-dev am: 898fc5b39b
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/14937250

Change-Id: I881b239515d17f81099ed16d519e1071e80c68ea
2021-06-30 13:32:33 +00:00
Hasini Gunasinghe
898fc5b39b Merge "Add keystore permission for metrics re-routing." into sc-dev 2021-06-30 13:07:22 +00:00
Paul Hobbs
2dec873de0 Revert "untrusted_app_30: add new targetSdk domain" am: f6fc9377ad am: dc26e38e21
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1750189

Change-Id: I1a771e26fca7a9ec98f5434918416eb9dcb3a961
2021-06-30 08:18:40 +00:00
Paul Hobbs
f6fc9377ad Revert "untrusted_app_30: add new targetSdk domain"
Revert "Ignore SELinux denials for all untrusted_app domains"

Revert "Update tests to check RTM_GETNEIGH{TBL} restrictions"

Revert submission 1748045-getneigh-enable-restrictions

Reason for revert: Breaks android.net.netlink.NetlinkSocketTest#testBasicWorkingGetNeighborsQuery with permissions error.

Bug: 192406650

Reverted Changes:
Iea29a1b36:Ignore SELinux denials for all untrusted_app domai...
I14b755020:Update tests to check RTM_GETNEIGH{TBL} restrictio...
I32ebb407b:untrusted_app_30: add new targetSdk domain
I8598662b7:libsepol: trigger new RTM_GETNEIGH{TBL} behavior

Change-Id: I525544191520607fdd238b5ac55aa5132f679253
2021-06-30 07:41:39 +00:00
Bram Bonné
040fa575e0 untrusted_app_30: add new targetSdk domain am: 55badc22c1 am: d9fea8c063
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1728087

Change-Id: I7ff99f17fcf264e071e42dc65e6df5779ac744d4
2021-06-29 19:24:52 +00:00
Bram Bonné
55badc22c1 untrusted_app_30: add new targetSdk domain
Enforce new requirements on app with targetSdkVersion=32 including:
- No RTM_GETNEIGH on netlink route sockets.
- No RTM_GETNEIGHTBL on netlink route sockets.

Bug: 171572148
Test: atest NetworkInterfaceTest
Test: atest bionic-unit-tests-static
Test: atest CtsSelinuxTargetSdkCurrentTestCases

Change-Id: I32ebb407b8dde1c872f53a1bc3c1ec20b9a5cb49
2021-06-29 17:50:22 +02:00
Treehugger Robot
ec30c418f9 Merge "Extend hal_uwb_server neverallow" 2021-06-29 05:22:39 +00:00
Thiébaud Weksteen
d631804671 Merge "Add fusefs_type for FUSE filesystems" am: 53ef2e85e2 am: 93749a5278
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1742996

Change-Id: I927bec927c8d531c59820c46cb280b700c64ced4
2021-06-28 13:03:20 +00:00
Thiébaud Weksteen
53ef2e85e2 Merge "Add fusefs_type for FUSE filesystems" 2021-06-28 12:39:58 +00:00
Thiébaud Weksteen
9ec532752d Add fusefs_type for FUSE filesystems
Any FUSE filesystem will receive the 'fuse' type when mounted. It is
possible to change this behaviour by specifying the "context=" or
"fscontext=" option in mount().

Because 'fuse' has historically been used only for the emulated storage,
it also received the 'sdcard_type' attribute. Replace the 'sdcard_type'
attribute from 'fuse' with the new 'fusefs_type'. This attribute can be
attached on derived types (such as app_fusefs).

This change:
- Remove the neverallow restriction on this new type. This means any
  custom FUSE implementation can be mounted/unmounted (if the correct
  allow rule is added). See domain.te.
- Change the attribute of 'fuse' from 'sdcard_type' to 'fusefs_type'.
  See file.te.
- Modify all references to 'sdcard_type' to explicitly include 'fuse'
  for compatibility reason.

Bug: 177481425
Bug: 190804537
Test: Build and boot aosp_cf_x86_64_phone-userdebug
Change-Id: Id4e410a049f72647accd4c3cf43eaa55e94c318f
2021-06-28 13:18:46 +02:00
Michael Ayoubi
07aa892503 Extend hal_uwb_server neverallow
Bug: 187386527
Test: Boot and confirm HAL is up

Signed-off-by: Michael Ayoubi <mayoubi@google.com>
Change-Id: I2abf108f2504997b06c0269f905608d8063cb3b4
Merged-In: I2abf108f2504997b06c0269f905608d8063cb3b4
2021-06-28 03:10:49 +00:00
Michael Ayoubi
c3af66222b Extend hal_uwb_server neverallow
Bug: 187386527
Test: Boot and confirm HAL is up
Signed-off-by: Michael Ayoubi <mayoubi@google.com>
Change-Id: I2abf108f2504997b06c0269f905608d8063cb3b4
Merged-In: I2abf108f2504997b06c0269f905608d8063cb3b4
2021-06-25 17:31:09 +09:00
Treehugger Robot
757bfdfa04 Merge "Allow keymint to access tee-device" 2021-06-24 18:38:40 +00:00
TreeHugger Robot
bf5c56e796 Merge "sepolicy: Allow to receive FDs from app_zygote" into sc-dev 2021-06-24 17:48:21 +00:00
Egor Pasko
271e63bbd0 sepolicy: Allow to receive FDs from app_zygote
The primary goal is to have an ashmem region shared between the main app
process in Chrome (=Browser Process) and the app zygote. It can only be
passed from the App Zygote, since there is no communication in the other
direction. Passing of the file descriptor should happen by:
(A) inheriting via fork(2)
(B) using binder IPC

Currently ashmem FDs are sufficiently allowed to be mmap(2)-ed in all
Chrome processes. The mode of mapping (read-only, read-write etc.) is
controlled by the settings of the region itself, not by sepolicy.

This change additionally allows an FD created in the app zygote to be
passed to the 'untrusted_app' domain.

Note: This change allows *any* FD, not just an ashmem one to be passed.
This is on purpose: in the future we will likely want to return to the
memfd story.  Other usecases (pipes, sockets) might appear.

The app zygote preload takes the responsibility not to share
capabilities in the form of FDs unintentionally with other app
processes.

Historical note: we tried to enable this for memfd (using additional
rules), but it required a 'write' permission when sending an FD. Reasons
for that are still puzzling, and there seems to be no easy workaround
for it. Decision: use ashmem.

Bug: 184808875
Test: Manual: Build and install Chrome (trichrome_chrome_google_bundle)
      from [1]. Make sure FileDescriptorAllowlist allows the FD, like
      [2]. Reach a NewTabPage, click on a suggested page, observe no
      errors related to binder transactions and selinux violations.

[1] A change in Chrome to create an ashmem region during app zygote
    preload and pass it to the browser process:
    https://crrev.com/c/2752872/29

[2] Allowlist change in review:
     https://android-review.googlesource.com/c/platform/frameworks/base/+/1739393
    (Alternatively: Remove gOpenFdTable checks in ForkCommon() in
    com_android_internal_os_Zygote.cpp)

Change-Id: Ide085f472c8fb6ae76ab0b094319d6924552fc02
Ignore-AOSP-First: in addition to changes in AOSP, copied to prebuilts
2021-06-24 13:06:43 +00:00
Treehugger Robot
3651e08779 Merge "sepolicy: allow recovery to operate devpts and kmsg" am: 097a8b4e29 am: 1bce0abd27
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1726491

Change-Id: Ia9c706a2edfe588b3bc7749694da968531e7013b
2021-06-24 02:23:54 +00:00
Treehugger Robot
097a8b4e29 Merge "sepolicy: allow recovery to operate devpts and kmsg" 2021-06-24 01:33:52 +00:00