Commit graph

26840 commits

Author SHA1 Message Date
Alan Stokes
8e307e0847 Merge "Make kmsg_device mlstrustedobject." 2020-10-28 11:20:20 +00:00
Alan Stokes
a0518b7fdb Make kmsg_device mlstrustedobject.
Few domains are granted access to this, but they should have access
from any user.

Also add some neverallows to prevent misuse.

Bug: 170622707
Test: presubmits
Change-Id: Iacbe7b0525604f2339f8bf31c105af738bc3cd75
2020-10-28 09:41:07 +00:00
Bowgo Tsai
5c294986eb Merge "Revert "Android.mk: Enforce SYSTEM_EXT_* vars on API >= 31"" 2020-10-28 05:09:23 +00:00
Bowgo Tsai
72b2acb327 Revert "Android.mk: Enforce SYSTEM_EXT_* vars on API >= 31"
This reverts commit 6c99a6781c.

Reason for revert: build breaks on build test
Bug: 171847597
Test: None

Change-Id: I7d3556aa0f06684b43f80f09e4c8194c6c44336c
2020-10-28 05:04:39 +00:00
Treehugger Robot
a6a5b1f752 Merge "Android.mk: Enforce SYSTEM_EXT_* vars on API >= 31" 2020-10-28 02:04:24 +00:00
Janis Danisevskis
e28e447c3c Merge "Add policy for property ro.android.security.keystore2.enable" 2020-10-27 21:14:29 +00:00
Michael Sun
46261403bb Merge "Disallow system_server to read sysfs_wakeup_reason" 2020-10-27 20:40:45 +00:00
Janis Danisevskis
202e8636ac Add policy for property ro.android.security.keystore2.enable
Bug: 171563717
Bug: 171305684
Test: N/A
Change-Id: I323081fd2ce2fee80951c3d1e19b9935e4596705
2020-10-27 09:49:18 -07:00
David Anderson
45ac6e8400 Merge "Add sepolicy for dm-user devices and the snapuserd daemon." 2020-10-27 16:39:14 +00:00
Yi Kong
eeff15559c Sort device_config property context rules
Clean up, no functionality change.

Test: TreeHugger
Change-Id: I5069bb224f22a34bafc4040eaf60ff095f8c3ed6
2020-10-27 18:57:42 +08:00
Woody Lin
62ddcf0580 Merge "Add zygote.critical_window.minute property" 2020-10-27 08:22:14 +00:00
David Anderson
fe30369efb Add sepolicy for dm-user devices and the snapuserd daemon.
dm-user is a new device-mapper module, providing a FUSE-like service for
block devices. It creates control nodes as misc devices under
/dev/dm-user/. Make sure these nodes get a unique selabel.

snapuserd is a daemon for servicing requests from dm-user. It is a
low-level component of Virtual A/B updates, and provides the bridge
betewen dm-snapshot and the new COW format. For this reason it needs
read/write access to device-mapper devices.

Bug: 168259959
Test: ctl.start snapuserd, no denials
      vts_libsnapshot_test, no denials
Change-Id: I36858a23941767f6127d6fbb9e6755c68b91ad31
2020-10-26 23:23:01 -07:00
Felix Elsner
6c99a6781c Android.mk: Enforce SYSTEM_EXT_* vars on API >= 31
Devices launched with S must use the new variable naming
scheme introduced in If8188feb365eb9e500f2270241fa190a20e9de01
"Android.mk: Support SYSTEM_EXT* sepolicy".

The old variable name
`BOARD_PLAT_{PUBLIC,PRIVATE}_SEPOLICY_DIR` does no longer
accurately reflect its usage and as such is deprecated.

Test: `make selinux_policy` with PRODUCT_SHIPPING_API_LEVEL=26
      `BOARD_PLAT_{PUBLIC,PRIVATE}_SEPOLICY_DIR}` set,
      observe additions in `$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/selinux`
Test: `make selinux_policy` with PRODUCT_SHIPPING_API_LEVEL=31
      `BOARD_PLAT_{PUBLIC,PRIVATE}_SEPOLICY_DIR}` set,
      observe error

Signed-off-by: Felix Elsner <google@ix5.org>
Change-Id: Ic4d1164be611836f6aa697fbf1cb1f1c73a3cd39
2020-10-27 03:30:17 +00:00
Yi Kong
0ac00727c3 Configs for profcollect system properties
Test: build
Bug: 79161490
Change-Id: I83362b2089a54c4dcbf8da5a7720da8529ba1e34
2020-10-27 03:46:31 +08:00
Woody Lin
8633462d85 Add zygote.critical_window.minute property
This property controls the minimal timing window that triggers init
process fatal abort, when the zygote service crashes repeatedly in it.

Bug: 146818493
Change-Id: Ibd371be0daf6510df8b4d1a1f12f0aab8d6392c7
2020-10-27 01:33:49 +08:00
Treehugger Robot
25ccba8a16 Merge "Fix TH build error because of file.te" 2020-10-26 08:56:42 +00:00
Yo Chiang
6273186e0f Merge "Allow gsid to find and binder-call vold" 2020-10-26 05:27:36 +00:00
Yo Chiang
453c55057b Merge "Add secdiscard policies for vold_metadata_file" 2020-10-26 05:27:36 +00:00
martinwu
c366ba73c6 Fix TH build error because of file.te
Add proc_net rules into prebuilts/api/30.0/public/file.te to fix build
errors

After applying AOSP/1468206, TH complains a build error:
Files system/sepolicy/prebuilts/api/30.0/public/file.te and
system/sepolicy/public/file.te differ

Bug: 145579144
Bug: 170265025
Test: build pass and reboot to check avc message in bugreport
Change-Id: I2085366b345c044e1b69f726809100fa43336c34
2020-10-26 11:09:23 +08:00
Primiano Tucci
f1fa1b9114 Merge "Allow tracing service to access kallsyms on userdebug" 2020-10-23 18:03:30 +00:00
Primiano Tucci
cd452300a7 Allow tracing service to access kallsyms on userdebug
This CL allows the traced_probes service to temporarily
lower kptr_restrict and read /proc/kallsyms.
This is allowed only on userdebug/eng builds.
The lowering of kptr_restrict is done via an init
property because the kernel checks that the kptr_restrict
writer is CAP_SYS_ADMIN, regardless of the /proc file ACLs [1].

[1] 4cbffc461e/kernel/sysctl.c (L2254)

Bug: 136133013
Design doc: go/perfetto-kallsyms
Test: perfetto_integrationtests --gtest_filter=PerfettoTest.KernelAddressSymbolization in r.android.com/1454882

Change-Id: Ic06e7a9a74c0f3e42fa63f7f41decc385c9fea2c
2020-10-23 14:03:08 +01:00
Yo Chiang
ffe786ebd7 Allow gsid to find and binder-call vold
Bug: 168571434
Test: 1. Install a DSU system.
  2. Boot the DSU system and reboot back to the host system.
  3. Wipe the DSU installation.
  4. DSU metadata key dir /metadata/vold/metadata_encryption/dsu/dsu is
     destroyed.
Change-Id: I229a02abb7bd1f070bb078bdaf89fb27cc4bfa47
2020-10-23 20:30:00 +08:00
Martin Stjernholm
c02098273f Merge "Rename ART release APEX to com.android.art." 2020-10-23 10:03:24 +00:00
Treehugger Robot
2f4b010e52 Merge "Ensure property owners are exclusive" 2020-10-23 07:55:46 +00:00
Inseob Kim
1b8b1f648c Ensure property owners are exclusive
system_property_type and vendor_property_type can't be assigned
together. For example, the following policy snippet will fail.

system_public_prop(foo_prop)
typeattribute foo_prop vendor_property_type;

product_property_type is currently synonym for system_property_type, so
we only check those two.

Bug: 171437654
Test: m selinux_policy
Test: add "typeattribute default_prop vendor_property_type;" to
      property.te and then "m selinux_policy"
Change-Id: I1cdbf3d04264bb045568c30f19339dfe3889dbb4
2020-10-23 15:16:11 +09:00
Steven Moreland
7c794ba51d Merge "untrusted_apps: AIDL vendor service parity w/ HIDL" 2020-10-22 23:08:09 +00:00
Steven Moreland
a43e26e3f2 untrusted_apps: AIDL vendor service parity w/ HIDL
Before, we completely dissallowed any untrusted app to access a service
operated by vendor. However, sometimes this is needed in order to
implement platform APIs. So now, vendor services which aren't explicitly
marked as 'protected_service' (like protected_hwservice in HIDL) are
blocked from being used by apps. This gives everyone a mechanism for
apps to directly access vendor services, when appropriate.

For instance:

                        VINTF
                          |
        vendor.img/etc    |   system.img/etc
                          |
 (vendor HAL) <----AIDL---|--> (public lib   <-- loaded by app
                          |     or platform
                          |     component)
                          |
                          |

Fixes: 163478173
Test: neverallow compiles
Change-Id: Ie2ccbff4691eafdd226e66bd9f1544be1091ae11
2020-10-21 22:33:42 +00:00
Treehugger Robot
c1eb80e302 Merge "init: allow LOOP_GET_STATUS ioctl on loop device" 2020-10-21 19:03:38 +00:00
Martin Stjernholm
a20322600a Rename ART release APEX to com.android.art.
Test: See https://r.android.com/1457217
Bug: 169639321
Change-Id: Idd7c667e8184518967892dd98d10ae7c3604efde
Merged-In: Idd7c667e8184518967892dd98d10ae7c3604efde
2020-10-21 15:41:07 +01:00
Jeff Vander Stoep
2442019061 init: allow LOOP_GET_STATUS ioctl on loop device
This is needed here:
https://android.googlesource.com/platform/system/core/+/refs/heads/master/init/builtins.cpp#494

Bug: 170934466
Test: TH
Change-Id: I8e6d06cae42d68182e9cca29723f0b16ff413b7c
2020-10-21 11:22:58 +02:00
Treehugger Robot
ba412c8c78 Merge "private/file_contexts: delist ART binaries under /system/bin" 2020-10-21 09:06:04 +00:00
Treehugger Robot
cc9cfa92c1 Merge "Add SEpolicy for VcnManagementService" 2020-10-21 00:54:35 +00:00
Treehugger Robot
21961caeff Merge "Enforce sysprop owner" 2020-10-21 00:26:34 +00:00
Maciej Żenczykowski
159c6e13dc public/file.te: add 'allow proc_net proc:filesystem associate'
Per http://cs/aosp-master/system/sepolicy/private/genfs_contexts?l=21

  genfscon proc /net u:object_r:proc_net:s0

/proc/net/... portion of proc should be 'proc_net' not the default of 'proc'

For example on a bonito:
  $ adbb shell ls -alZd /proc /proc/net/xt_quota
  dr-xr-xr-x 757 root root u:object_r:proc:s0      0 1969-12-31 16:00 /proc
  dr-xr-xr-x   2 root root u:object_r:proc_net:s0  0 2020-10-20 11:02 /proc/net/xt_quota

This already mostly works, but occasionally on 4.19 devices we see
(apparently spurious) denials (my gut feeling is kernel behaviour
changed and/or is racy):

[   37.434457] type=1400 audit(1574821413.359:2102): avc: denied { associate } for comm="Binder:762_1" name="globalAlert" scontext=u:object_r:proc_net:s0 tcontext=u:object_r:proc:s0 tclass=filesystem permissive=1

Presumably caused by a binder rpc into netd:
  http://cs/aosp-master/system/netd/server/BandwidthController.cpp?l=635&rcl=cdd79f13c670605819333de2d7b67d7f8a42210c

Things seem to work anyway, presumably because eventually it does somehow
get set to 'proc_net' anyway...

This patch will allow the removal of:
    allow proc_net proc:filesystem { associate };
and
    dontaudit proc_net proc:filesystem associate;
from device specific configs.

Bug: 145579144
Bug: 170265025
Test: treehugger will
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I46294d8b1526e846a5eddb350adf51c76634b8f1
2020-10-20 18:25:39 +00:00
Treehugger Robot
913868c19d Merge "Added system_server_dumper service." 2020-10-20 17:46:13 +00:00
Orion Hodson
8dfb408cdf private/file_contexts: delist ART binaries under /system/bin
These are in the ART APEX and covered by
apex/com.android.art.{debug,release}-file_contexts.

Bug: 160683548
Test: boot and check no avc denied messages logcat
Change-Id: I8024b3e37bb3e680739c45b08e4a846f2adea98c
2020-10-20 17:06:12 +01:00
Treehugger Robot
766ad4462a Merge "Revert "Prevent isolated_app from searching system_data_file."" 2020-10-20 10:06:54 +00:00
Michael Sun
61c2536f52 Disallow system_server to read sysfs_wakeup_reason
As SystemSuspend will provide wakeup reasons along with wakeup
notification, it is no longer needed for BatteryStats, which lives
on system_server to access the kernel wakeup reason file.

Test: adb logcat -b all -d | audit2allow -p policy
Bug: 171021049
Change-Id: Idfbc7bb6f9a68d70ac89bfe838cda06739de403c
2020-10-20 07:52:30 +00:00
Felipe Leme
e418956ae3 Added system_server_dumper service.
It will be used to dump system_server data that is not associated
with any service.

Test: adb shell dumpsys system_server
Bug: 163921395

Change-Id: I5719f7cd3a9022dc0ab12a3b3b22487e2b4866e0
2020-10-19 21:27:06 -07:00
Inseob Kim
afc09932f6 Enforce sysprop owner
Every property should have an appropriate owner attribute, which can be
one of: system_property_type, product_property_type, or
vendor_property_type. This will be enforced for devices launching with S
or later. Devices launching with R or eariler can relax this by setting
following under BoardConfig.mk:

BUILD_BROKEN_ENFORCE_SYSPROP_OWNER := true

Bug: 131162102
Test: system/sepolicy/tools/build_policies.sh
Change-Id: I7914ef1b7463c9ec00812b9720094531fd63f0c7
2020-10-19 05:07:05 +00:00
Treehugger Robot
161ecd3fc1 Merge changes from topic "btaa" am: 5d876b6024
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1463604

Change-Id: I3b103e503353d5e21a2d6e558693101f8561dbec
2020-10-17 04:54:14 +00:00
Treehugger Robot
5d876b6024 Merge changes from topic "btaa"
* changes:
  Allow SystemSuspend to read from sysfs_wakeup_reasons
  Allow SystemSuspend to call Bluetooth via binder
2020-10-17 04:05:58 +00:00
Treehugger Robot
c167e2b3bb Merge "Allow people service to publish apis" am: d06cdd66d5
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1464344

Change-Id: I14a41beb9a5bf6923e19f8c313152b9f35a47c95
2020-10-16 22:59:15 +00:00
Treehugger Robot
d06cdd66d5 Merge "Allow people service to publish apis" 2020-10-16 22:46:28 +00:00
Treehugger Robot
da436db2a0 Merge changes from topic "ramdisk_timestamp_runtime_load" am: b178fe826c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1451819

Change-Id: I0507c9b561bbe5cb42e80fe9745955186c87baa7
2020-10-16 22:16:45 +00:00
Yifan Hong
c24059c98b Add /second_stage_resources tmpfs. am: 73f9b6cc84
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1451818

Change-Id: I9380b667fbb7d09eac8a8a1324bd396e5ac2c149
2020-10-16 22:16:28 +00:00
Treehugger Robot
b178fe826c Merge changes from topic "ramdisk_timestamp_runtime_load"
* changes:
  Add ro.bootimage.* property contexts
  Add /second_stage_resources tmpfs.
2020-10-16 19:23:08 +00:00
Julia Reynolds
859e5a3093 Allow people service to publish apis
Test:IPeopleManager.Stub.asInterface(ServiceManager.getService(Context.PEOPLE_SERVICE) is
not null when called from another process
Bug: 169783793

Change-Id: I280568955c50f9deef0a35ad1b9864ffc0a82db4
2020-10-16 19:22:33 +00:00
Jack Yu
cbf7d275c5 Merge "Add sepolicy to allow read/write nfc snoop log data" am: dd5c5d7960
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1399148

Change-Id: I3184e8d9a7219eb4cf06f4a6de1735a3e822131b
2020-10-16 08:09:48 +00:00
Jack Yu
dd5c5d7960 Merge "Add sepolicy to allow read/write nfc snoop log data" 2020-10-16 07:56:10 +00:00