Commit graph

36135 commits

Author SHA1 Message Date
Maciej Żenczykowski
afa8ca689f Merge "much more finegrained bpf selinux privs for networking mainline" 2022-06-23 11:05:03 +00:00
Almaz Mingaleev
0e70ea793f Merge "Remove TZUvA feature." 2022-06-23 07:47:26 +00:00
Treehugger Robot
0235cbf4b9 Merge changes I036e4853,I55e03a3c,Ic98c6fc6
* changes:
  sepolicy: allow TUNSETLINK and TUNSETCARRIER
  Add xfrm netlink permissions for system server
  Fix system server and network stack netlink permissions
2022-06-23 01:43:56 +00:00
Maciej Żenczykowski
b13921c3f0 much more finegrained bpf selinux privs for networking mainline
Goal is to gain a better handle on who has access to which maps
and to allow (with bpfloader changes to create in one directory
and move into the target directory) per-map selection of
selinux context, while still having reasonable defaults for stuff
pinned directly into the target location.

BPFFS (ie. /sys/fs/bpf) labelling is as follows:
  subdirectory   selinux context      mainline  usecase / usable by
  /              fs_bpf               no (*)    core operating system (ie. platform)
  /net_private   fs_bpf_net_private   yes, T+   network_stack
  /net_shared    fs_bpf_net_shared    yes, T+   network_stack & system_server
  /netd_readonly fs_bpf_netd_readonly yes, T+   network_stack & system_server & r/o to netd
  /netd_shared   fs_bpf_netd_shared   yes, T+   network_stack & system_server & netd [**]
  /tethering     fs_bpf_tethering     yes, S+   network_stack
  /vendor        fs_bpf_vendor        no, T+    vendor

* initial support for bpf was added back in P,
  but things worked differently back then with no bpfloader,
  and instead netd doing stuff by hand,
  bpfloader with pinning into /sys/fs/bpf was (I believe) added in Q
  (and was definitely there in R)

** additionally bpf programs are accesible to netutils_wrapper
   for use by iptables xt_bpf extensions

'mainline yes' currently means shipped by the com.android.tethering apex,
but this is really another case of bad naming, as it's really
the 'networking/connectivity/tethering' apex / mainline module.
Long term the plan is to merge a few other networking mainline modules
into it (and maybe give it a saner name...).

The reason for splitting net_private vs tethering is that:
  S+ must support 4.9+ kernels and S era bpfloader v0.2+
  T+ must support 4.14+ kernels and T beta3 era bpfloader v0.13+

The kernel affects the intelligence of the in-kernel bpf verifier
and the available bpf helper functions.  Older kernels have
a tendency to reject programs that newer kernels allow.

/ && /vendor are not shipped via mainline, so only need to work
with the bpfloader that's part of the core os.

Bug: 218408035
Test: TreeHugger, manually on cuttlefish
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I674866ebe32aca4fc851818c1ffcbec12ac4f7d4
(cherry picked from commit 15715aea32)
2022-06-22 16:07:42 -07:00
Patrick Rohr
f1c63a4e91 sepolicy: allow TUNSETLINK and TUNSETCARRIER
This is required for testing new ethernet APIs in T.

This change is not identical to the corresponding AOSP change
because it also needs to update the T prebuilts.

Test: TH
Bug: 171872016
(cherry picked from commit 02b55354bd)
(cherry picked from commit 69fa8ca6f2)
Change-Id: I036e48530e37f7213a21b250b858a37fba3e663b
2022-06-22 16:07:28 -07:00
Benedict Wong
a6471611cc Add xfrm netlink permissions for system server
This change enables xfrm netlink socket use for the system server,
and the network_stack process. This will be used by IpSecService
to configure SAs, and network stack to monitor counters & replay
bitmaps for monitoring of IPsec tunnels.

This patch updates the prebuilts, in addition to the changes to the
master source.

Bug: 233392908
Test: Compiled
(cherry picked from commit b25b4bf53f)
(cherry picked from commit 8b7c1cbd5e)
Change-Id: I55e03a3ca7793b09688f603c973c38bd2f6e7c7f
2022-06-22 16:07:16 -07:00
Patrick Rohr
7e3e7e4a41 Fix system server and network stack netlink permissions
Give system_server and network_stack the same permissions as netd.
This is needed as we are continuously moving code out of netd into
network_stack and system_server.

This change is not identical to the corresponding AOSP change
because it also needs to update the T prebuilts.

Test: TH
Bug: 233300834
(cherry picked from commit ab02397814)
(cherry picked from commit d0478822ce)
Change-Id: Ic98c6fc631ee98bef4b5451b6b52d94e673b4f3c
2022-06-22 16:06:55 -07:00
Treehugger Robot
612f706737 [automerger skipped] Merge "RESTRICT AUTOMERGE Revert "Add policy for command line tool to control MTE boot state. am: 949e1d0a76"" into android12L-tests-dev am: 50e1cfc192 -s ours
am skip reason: subject contains skip directive

Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2133982

Change-Id: I7e3dfa585643361ef08073fb7895fde555a8a417
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-22 22:31:32 +00:00
Florian Mayer
1b2b7649ca [automerger skipped] RESTRICT AUTOMERGE Revert "Add policy for command line tool to control MTE boot state. am: 949e1d0a76" am: fdee5eddfa -s ours
am skip reason: subject contains skip directive

Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2133982

Change-Id: Id9dd5cb89701923cca7f0376361efe6b44bf09df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-22 22:31:08 +00:00
Treehugger Robot
50e1cfc192 Merge "RESTRICT AUTOMERGE Revert "Add policy for command line tool to control MTE boot state. am: 949e1d0a76"" into android12L-tests-dev 2022-06-22 22:15:55 +00:00
Treehugger Robot
11a9ff428d Merge "Allow remote_prov_app to find mediametrics." 2022-06-22 06:14:28 +00:00
Florian Mayer
fdee5eddfa RESTRICT AUTOMERGE Revert "Add policy for command line tool to control MTE boot state. am: 949e1d0a76"
This reverts commit 069435505e.

Reason for revert: b/236099211

Change-Id: Ia3538caebdf7ccea943a16c594a3ff6a645014a2
2022-06-22 00:51:24 +00:00
Jiyong Park
6fb4511df4 Label ro.build.version.known_codenames in Microdroid
Bug: 236602028
Test: atest ComposHostTestCases
Change-Id: I7a479f32f58964b60468b7d19c9cd9f47a334741
2022-06-21 10:59:03 +09:00
Alan Stokes
1035ba1023 Allow compos_verify to write VM logs
Previously I've resisted granting write access to these files, since
it allows the instance image to be altered. But that doesn't allow an
attacker to do anything other than render it invalid, since it's
protected by the VM key.

Note that logs are only written when the VM is debuggable, which is
currently only when only non-protected VMs are available.

Bug: 235350758
Test: Force debug on, stage APEX, compile, reboot -> see vm logs
Test: Presubmit
Change-Id: I17c9a17db83d15adfab97b8cfe4ccd67393a08c1
2022-06-17 13:41:51 +01:00
Xin Li
5a7531590f Merge "Merge Android 12 QPR 3" 2022-06-16 18:51:57 +00:00
Treehugger Robot
13b939a91a Merge "SELinux configuration for memory safety device configs." 2022-06-16 06:27:04 +00:00
Max Bires
d1cd55f660 Allow remote_prov_app to find mediametrics.
This change allows remote_prov_app to find mediametrics. This is a
permission that all apps have. It is now needed for remote_prov_app due
to a new feature related to provisioning Widevine through the MediaDrm
framework.

Bug: 235491155
Test: no selinux denials related to remote_prov_app
Change-Id: Id3057b036486288358a9a84100fe808eb56df5fe
Merged-In: Id3057b036486288358a9a84100fe808eb56df5fe
2022-06-15 13:42:32 -07:00
Avichal Rakesh
fb2097c1fd Merge "Allow camera provider services following AIDL naming conventions" 2022-06-15 19:46:16 +00:00
Treehugger Robot
558915461b Merge "Dontaudit chmod of virtualizationsevice_data_file" 2022-06-15 18:04:46 +00:00
Florian Mayer
5b3a8333af SELinux configuration for memory safety device configs.
These will get read by system libraries in arbitrary processes, so it's
a public property with read access by `domain`.

Bug: 235129567
Change-Id: I1ab880626e4efa2affe90165ce94a404b918849d
2022-06-15 10:34:54 -07:00
Florian Mayer
981f5581f6 Merge "Add property for MTE permissive mode." 2022-06-15 16:58:25 +00:00
Alan Stokes
40f33c1da1 Dontaudit chmod of virtualizationsevice_data_file
Init attempts to rm -rf these files, to ensure any that are owned by
the old virtualizationservice UID get deleted. This fails for newer
directories, now we use the system UID, which is harmless. But rm
attempts to chmod the directories since it can't read them, which also
fails and generates a spurious audit. So here we suppress that.

Bug: 235338094
Test: No denials seen even when there are stale directories present
Change-Id: If55fbe151174ee08a12b64b301e4aa86ffc1a5bf
2022-06-15 17:25:20 +01:00
Treehugger Robot
f31b1f45d5 Merge "Don't audit mnt_produt_file in dumpstate." 2022-06-15 09:42:49 +00:00
Xin Li
1be8100d8f Merge Android 12 QPR 3
Bug: 236045730
Merged-In: Id7ae2a2160eeea687a3a6876ce43baf05bb3bb8b
Change-Id: I342b75ca067e813bbd9092efd33dc078b2d6312e
2022-06-14 16:48:21 -07:00
Avichal Rakesh
3baabb9157 Allow camera provider services following AIDL naming conventions
Android 13 moved to using AIDL for HALs, which have different version
and naming conventions as compared to the new deprecated HIDL. This CL
updates the regex to include camera provider implementations that follow
AIDL naming conventions in the allowlist.

Bug: 219974678
Test: Manually tested that AIDL implementation is allowed to run
Change-Id: Ic005703bdaaa6376ca4714f22f89271b2a8878f2
2022-06-14 22:39:54 +00:00
Florian Mayer
56af9a268a Add property for MTE permissive mode.
Bug: 202037138
Change-Id: I272996f124ca8391f9312150d1d8757751fe6acb
2022-06-14 10:21:25 -07:00
Inseob Kim
4e71f7d8c8 Merge "Allow microdroid_manager to write serial device" am: ff418d6499
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2121197

Change-Id: Id7ae2a2160eeea687a3a6876ce43baf05bb3bb8b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 03:17:46 +00:00
Inseob Kim
ff418d6499 Merge "Allow microdroid_manager to write serial device" 2022-06-14 02:51:12 +00:00
Neil Fuller
37888b33ba Remove TZUvA feature.
The feature was superseded by tzdata mainline module(s).

Bug: 148144561
Test: see system/timezone
Test: m selinux_policy
Change-Id: I48d445ac723ae310b8a134371342fc4c0d202300
Merged-In: I48d445ac723ae310b8a134371342fc4c0d202300
2022-06-13 11:45:50 +00:00
Inseob Kim
44f68942fa Allow microdroid_manager to write serial device
A serial device is used to pass failure reason to host.

Bug: 220071963
Test: atest MicrodroidTests
Change-Id: I085e902b4f0a79d3c8d2cd5c737ad169caac3659
2022-06-13 18:00:11 +09:00
Treehugger Robot
4ed1cb5a1e Merge "Remove the last traces of idmap (replaced by idmap2)" am: 850045ae07
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2122593

Change-Id: I3a13d0387b86db5744d15775699f2192b6804e2e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-13 07:40:54 +00:00
Treehugger Robot
850045ae07 Merge "Remove the last traces of idmap (replaced by idmap2)" 2022-06-13 07:19:11 +00:00
Yi-yo Chiang
fcbd51b544 Merge "Label ro.force.debuggable as build_prop" am: c85ac2ea3a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2122376

Change-Id: Ibbe3afff89ca75284e9d4705b03095d0c3fc36f9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-13 06:41:14 +00:00
Yi-yo Chiang
c85ac2ea3a Merge "Label ro.force.debuggable as build_prop" 2022-06-13 06:17:47 +00:00
Devin Moore
ff958713a2 Merge "Add permissions for new netd AIDL HAL" am: e47782171a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2095165

Change-Id: I28a8dea121386f90f48850326a8d1c1a41984d6d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 19:41:26 +00:00
Devin Moore
e47782171a Merge "Add permissions for new netd AIDL HAL" 2022-06-10 18:04:28 +00:00
Mårten Kongstad
0547fb5ab2 Remove the last traces of idmap (replaced by idmap2)
Remove mention of the /system/bin/idmap binary: the file no longer
exists.

Remove interaction between the domains installd and idmap to interact:
installd used to fork and exec the idmap binary, but the idmap2 binary
has its own binder service.

Bug: 118711077
Bug: 119264713
Test: atest FrameworksServicesTests:com.android.server.om OverlayDeviceTests OverlayHostTests CtsAppSecurityHostTestCases:OverlayHostTest
Change-Id: I06d22057308984e43cb84ff365dbdd1864c7064b
2022-06-10 12:58:21 +02:00
Inseob Kim
cf9c59241d Merge "Fix policy file order for hal_attributes" am: b2984a49bd
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2121272

Change-Id: I5613be959f16d63d21cab13eda4343f2055e7b70
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 09:29:27 +00:00
Inseob Kim
b2984a49bd Merge "Fix policy file order for hal_attributes" 2022-06-10 09:07:02 +00:00
Yi-Yo Chiang
598d079de7 Label ro.force.debuggable as build_prop
It was default_prop. Label it build_prop for good code hygiene.

Bug: 223517900
Test: Boot with and without debug boot image
Change-Id: I4e00d301eb526a0fc9e29657cbcedda8dd0fc7b1
2022-06-10 14:52:38 +08:00
Treehugger Robot
e9cd3e95cb Merge "Obsolete BOARD_PLAT_*_SEPOLICY_DIR" am: 747fc1236e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2120421

Change-Id: Icd4eaabc5a7288d04b7f642aaa8bb8f2371d2e86
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 02:16:02 +00:00
Treehugger Robot
747fc1236e Merge "Obsolete BOARD_PLAT_*_SEPOLICY_DIR" 2022-06-10 01:56:16 +00:00
Vova Sharaienko
38ad5d01c4 Merge "hal_vehicle_default: enabled communication with statsd" am: 7816224ea2
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2106885

Change-Id: Id31bf7bf78f66575871ba3718889442360c64e9f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-09 23:03:51 +00:00
Akilesh Kailash
ba1b02ae5b Allow update_verifier to connect to snapuserd daemon am: 5fe8252425
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2039364

Change-Id: I3425242728e614526befaca3be2f82bf482593a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-09 23:03:33 +00:00
Vova Sharaienko
7816224ea2 Merge "hal_vehicle_default: enabled communication with statsd" 2022-06-09 22:51:21 +00:00
Devin Moore
309a355088 Add permissions for new netd AIDL HAL
Netd is now serving an AIDL HAL to replace the old HIDL HAL.

Bug: 205764585
Test: Boot and check for avc denials
Change-Id: I1ca5ed4ff3b79f082ea2f6d3e81f60a64ca04855
2022-06-09 22:39:15 +00:00
Dan Willemsen
9dd75fe474 Obsolete BOARD_PLAT_*_SEPOLICY_DIR
See If803a33efc38a970247919bf224c12b8c717f955 for more details.

Bug: 235414673
Test: treehugger
Change-Id: Iff939a58e0a8238e085d63f28b5fa8d7982d82a0
2022-06-09 09:36:21 -07:00
Inseob Kim
1e796342aa Fix policy file order for hal_attributes
Partners should be able to add hal_attributes to system_ext or product's
public/attributes file. However, if system_ext or product's
public/attributes contain any domain sets, numbers for base_typeattr
become inconsistent. It's because the order is now:

    ...
    te_macros
    attributes
    ioctl_defines
    ioctl_macros
    *.te
    roles_decl
    ...

That is, system_ext/public/attributes and product/public/attributes are
included prior to system/sepolicy/**/*.te. Thus, plat_sepolicy.cil and
system_ext_sepolicy.cil/product_sepolicy.cil can conflict.

This change fixes this issue by making attributes and *.te files have
the same rank. This way, system_ext/public/attributes is included after
system/sepolicy/**/*.te.

Bug: 234137981
Test: m selinux_policy after adding hal_attribute to
      system_ext/public/attributes
Change-Id: I85e1f6b8e4ab47c723724684d1938297a3305fe8
2022-06-09 11:26:35 +09:00
Akilesh Kailash
5fe8252425 Allow update_verifier to connect to snapuserd daemon
Bug: 193863442
Test: OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I10cb900466078930c9124fc381ba2adfc50ffcd4
2022-06-08 20:26:18 +00:00
Steven Terrell
c402a02164 Merge "Add System Property Controlling Animators" am: 06c506940e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2118925

Change-Id: Ieee8f322c099443e6e533d8475501e55e9748511
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 16:11:44 +00:00