Commit graph

987 commits

Author SHA1 Message Date
Jiakai Zhang
10aa6465d9 Allow system_server to read /data/misc/profman.
Before this change, system_server only has write access. We want read
access the directory so that we can check if it has the right
permissions before we write to it.

Bug: 262230400
Test: No longer see SELinux denials on that directory.
Change-Id: Ic26b2a170031c4f14423b8b1f1a8564d64f532ae
2023-01-03 16:48:11 +00:00
Venkatarama Avadhani
5a86d5f3f3 HDMI: Refactor HDMI packages
Organize the HDMI packages into CEC, EArc and connection under a common
hdmi package.

Bug: 261729059
Test: atest vts_treble_vintf_framework_test
      atest vts_treble_vintf_vendor_test
Change-Id: Ief5bff996028775ea355b392a4028a091fb83b99
2022-12-27 18:15:26 +05:30
Venkatarama Avadhani
0f0861af8f EARC: Add Policy for EArc Service
Test: atest vts_treble_vintf_framework_test
      atest vts_treble_vintf_vendor_test
Bug: 240388105
Change-Id: I561f647a68553fa0134f2e1bd65b0f18dd1785f1
2022-12-27 18:11:36 +05:30
Treehugger Robot
3ca356b7df Merge "Allow system_server to enable fs-verity." 2022-12-21 01:24:43 +00:00
Alex Buynytskyy
ff577a00b8 Allow system_server to enable fs-verity.
Bug: 253568736
Test: atest PackageManagerSettingsTests
Change-Id: I2fc59d6441eca95b349aebaa633a15584c7ef744
2022-12-20 15:36:26 -08:00
Florian Mayer
152f832904 Allow system_server to set arm64 memtag property
Bug: 262763327
Bug: 244290023
Test: atest MtePolicyTest on user build
Test: manually with TestDPC
Change-Id: If1ed257fede6fa424604eed9775eb3a3b8365afe
2022-12-16 16:58:36 -08:00
Mohi Montazer
ad059403ad SEPolicy updates for camera HAL
Updates SEPolicy files to give camera HAL permission to access
Android Core Experiment flags.

Example denials:
11-30 13:08:33.172  1027  1027 W binder:1027_3: type=1400 audit(0.0:7): avc: denied { read } for name="u:object_r:default_prop:s0" dev="tmpfs" ino=152 scontext=u:r:hal_camera_default:s0 tcontext=u:object_r:default_prop:s0 tclass=file permissive=0
11-30 13:08:33.172  1027  1027 W binder:1027_3: type=1400 audit(0.0:8): avc: denied { read } for name="u:object_r:default_prop:s0" dev="tmpfs" ino=152 scontext=u:r:hal_camera_default:s0 tcontext=u:object_r:default_prop:s0 tclass=file permissive=0
11-30 13:08:33.244  1027  1027 W 3AThreadPool:  type=1400 audit(0.0:9): avc: denied { read } for name="u:object_r:default_prop:s0" dev="tmpfs" ino=152 scontext=u:r:hal_camera_default:s0 tcontext=u:object_r:default_prop:s0 tclass=file permissive=0

Bug: 259433722
Test: m
Change-Id: I11165b56d7b7e38130698cf86d9739f878580a14
2022-12-13 09:52:04 -08:00
Seth Moore
3accea479a Add permissions for remote_provisioning service
Bug: 254112668
Test: manual + presubmit
Change-Id: I54d56c34ad4a8199b8aa005742faf9e1e12583c3
2022-12-06 08:46:20 -08:00
Etienne Ruffieux
fb4ca780fe Merge "Add bluetooth_prop to system_server sepolicy." 2022-11-18 22:08:11 +00:00
Etienne Ruffieux
3b39e92bd9 Add bluetooth_prop to system_server sepolicy.
We need to be able to access Bluetooth sysprops from
BluetoothManagerService.

Bug: 217292806
Test: atest CtsBluetoothTestCases
Tag: #feature
Change-Id: Ia4d5d286ccf94f61bbc87e9063d22b8822806e5c
2022-11-10 18:00:55 -08:00
Lakshman Annadorai
4d277b7baa Revert "Add sepolicies for CPU HAL."
This reverts commit f4ab6c9f3c.

Reason for revert: CPU HAL is no longer required because the CPU frequency sysfs files are stable Linux Kernel interfaces and could be read directly from the framework.

Change-Id: I8e992a72e59832801fc0d8087e51efb379d0398f
2022-11-09 16:47:07 +00:00
Lakshman Annadorai
f4ab6c9f3c Add sepolicies for CPU HAL.
Change-Id: Ia091bf8f597a25351b5ee33b2c2afc982f175d51
Test: Ran `m; emulator; adb logcat -b all -d > logcat.txt;`
      and verified CPU HAL is running without any sepolicy violation.
Bug: 252883241
2022-11-04 18:13:00 +00:00
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
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
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
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
Alex Buynytskyy
aad4ae8a74 Allow system_server to obtain verity root hash for install files.
Bug: 160605420
Test: atest ChecksumsTest, check for selinux denials
Change-Id: I33b60d86317c37ef58a1be691d6a90dfef637db1
2022-09-02 09:30:21 -07:00
Thiébaud Weksteen
c0fef5c1ae Merge "Remove wpantund and lowpan_service" 2022-08-25 23:57:20 +00:00
Hongguang
9515559657 Add properties to configure whether the lazy tuner is enabled.
ro.tuner.lazyhal: system_vendor_config_prop to decide whether the lazy
tuner HAL is enabled.
tuner.server.enable: system_internal_prop to decide whether tuner server
should be enabled.

Bug: 236002754
Test: Check tuner HAL and framework behavior
Change-Id: I6a2ebced0e0261f669e7bda466f46556dedca016
2022-08-23 07:01:05 +00:00
Thiébaud Weksteen
8439a1ff29 Remove wpantund and lowpan_service
Bug: 235018188
Test: TH
Change-Id: I0e2f03ad6d17f5d9223b2c500b6c3183835ec807
2022-08-22 14:09:01 +10:00
Richard Chang
6d5bb236da Merge "sepolicy: allow vendor system native boot experiments property" 2022-08-17 06:29:30 +00:00
Siim Sammul
9c0d804b45 Merge "Allow creating /data/tombstones files by system_server. Needed for ag/18773746" 2022-08-11 09:58:56 +00:00
Richard Chang
74334efa4b sepolicy: allow vendor system native boot experiments property
Grant system_server and flags_health_check permission to set the
properties that correspond to vendor system native boot experiments.

Bug: 241730607
Test: Build
Merged-In: Idc2334534c2d42a625b451cfce488d7d7a651036
Change-Id: I3e98f1b05058245cad345061d801ecd8de623109
2022-08-11 08:03:42 +00:00
John Wu
e5010a22a6 Remove key migration related changes
Migrating keys across UIDs is no longer required

Test: m
Bug: 228999189
Change-Id: I33e85635a4fe82bf1f98a9bfcf505a1067b4ed91
2022-07-20 15:19:37 +10:00
Siarhei Vishniakou
4cb2d3c13d Allow system_server to signal InputProcessor HAL
This is needed for Watchdog to be able to dump InputProcessor HAL.
Watchdog can be triggered locally for testing by patching
InputDispatcher.cpp:

 void InputDispatcher::monitor() {
     // Acquire and release the lock to ensure that the dispatcher has not deadlocked.
     std::unique_lock _l(mLock);
+    std::this_thread::sleep_for(std::chrono::minutes(40));
     mLooper->wake();
     mDispatcherIsAlive.wait(_l);

Bug: 237322365
Test: adb bugreport (after triggering watchdog)
Change-Id: I746df8be4faaef2a67293d6b1c0cde5fa7810de6
Merged-In: I746df8be4faaef2a67293d6b1c0cde5fa7810de6
2022-07-14 22:05:07 +00:00
Thiébaud Weksteen
febedf5a42 Merge "Revert "Remove key migration related changes"" 2022-07-07 08:43:54 +00:00
Thiébaud Weksteen
f412c13a02 Revert "Remove key migration related changes"
This reverts commit 65dcdf2921.

Reason for revert: broken internal target 

Change-Id: Idf57285d95f5466dfa3af08230af4c8f9d76326c
2022-07-07 08:40:23 +00:00
Thiébaud Weksteen
c3cb5a25e3 Merge "Remove key migration related changes" 2022-07-07 04:13:22 +00:00
Ryan Savitski
babba5e83b Revert system app/process profileability on user builds
Please see bug for context.

This reverts commits:
* 6111f0cfc8
* bb197bba02
* 20d0aca7e6

And updates prebuilts/api/33.0 accordingly.

Bug: 217368496
Tested: builds successfully (barbet-userdebug)
Change-Id: If7fcf3d5a2fdb1a48dcaf8ef8f97e8375d461e61
2022-07-01 12:41:01 +00:00
Siim Sammul
252a0502c8 Allow creating /data/tombstones files by system_server.
Needed for ag/18773746

Bug: 225173288
Test: atest ErrorsTest +  manual
Change-Id: I31bab12a59babd9a197cfb03d2417b926e60af84
2022-06-29 15:07:01 +00:00
John Wu
65dcdf2921 Remove key migration related changes
Migrating keys across UIDs is no longer required

Test: m
Bug: 228999189
Change-Id: Icdecbdb3997f9c5b3d470578b1d61e580a1c3537
2022-06-26 01:04:02 +10:00
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
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
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
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
John Wu
b553a30629 Merge "Revert "Revert "Revert "Remove key migration related changes"""" 2022-06-07 01:03:51 +00:00
John Wu
3da8416b5d Revert "Revert "Revert "Remove key migration related changes"""
This reverts commit 82c4d9b474.

Reason for revert: b/235140708

Change-Id: Ifd14bcf4480c74b81602c16723efebef7aad10bd
2022-06-06 22:24:24 +00:00
John Wu
fd6f5dfe6b Merge "Revert "Revert "Remove key migration related changes""" 2022-06-06 17:16:47 +00:00
John Wu
82c4d9b474 Revert "Revert "Remove key migration related changes""
This reverts commit e27f954836.

Reason for revert: this needs to land in AOSP

Change-Id: Ief92bf04eaff4235b0e33d427263bbff312837aa
2022-06-03 18:23:15 +00:00
Patrick Rohr
02b55354bd sepolicy: allow TUNSETLINK and TUNSETCARRIER
This is required for testing new ethernet APIs in T.

Test: TH
Bug: 171872016
Change-Id: I1e6024d7d649be50aa2321543b289f81fcdfc483
2022-05-31 20:36:33 -07:00
Patrick Rohr
817d82bcf5 Merge "Fix system server and network stack netlink permissions" 2022-05-27 01:39:00 +00:00
Treehugger Robot
a4c30a384a Merge "Allow system_server to connect to artd." 2022-05-26 14:33:42 +00:00
Jiakai Zhang
9ed8d3c9be Allow system_server to connect to artd.
Bug: 233915142
Test: m
Change-Id: I07dc0b7ab2e54aea21799698b13651605f4c4b4a
2022-05-26 13:57:53 +01:00
Thiébaud Weksteen
cdf912f65e Merge "Revert "Remove key migration related changes"" 2022-05-26 03:08:29 +00:00
John Wu
e27f954836 Revert "Remove key migration related changes"
This reverts commit cabed18a47.

Reason for revert: b/233922399

Change-Id: Ib371184de3c1bc4e3e0ca951e98d6b5e66952dcc
2022-05-25 23:36:42 +00:00
John Wu
c8d2d1d258 Merge "Remove key migration related changes" 2022-05-25 17:53:17 +00:00
Mohamad Mahmoud
e7d1f32250 Merge "Allow system_server to read io and cpu pressure data Test: tested on device Bug: b/233036368" 2022-05-25 15:49:20 +00:00
Treehugger Robot
f2b91a0199 Merge "Add xfrm netlink permissions for system server" 2022-05-25 01:14:25 +00:00
Benedict Wong
b25b4bf53f 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.

Bug: 233392908
Test: Compiled
Change-Id: I25539dc579f21d6288fa962d1fad9b51573f017d
2022-05-25 00:02:33 +00:00
Mohamad Mahmoud
c49d582df6 Allow system_server to read io and cpu pressure data
Test: tested on device
Bug: b/233036368

Change-Id: Ied90327f97abb771f10ec2efb659bb9090ffa88a
2022-05-24 17:24:54 +00:00
Samiul Islam
61bd67072c Merge "Create a separate label for sandbox root directory" 2022-05-20 07:21:19 +00:00
Patrick Rohr
ab02397814 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.

Test: TH
Bug: 233300834
Change-Id: I9559185081213fdeb33019733654ce95af816d99
2022-05-19 22:07:49 -07:00
Mohammad Samiul Islam
d2ffd35cc0 Create a separate label for sandbox root directory
Currently, app process can freely execute path at
`/data/misc_ce/0/sdksandbox/<package-name>` since it's labeled as system
file. They can't read or write, but use 403/404
error to figure out if an app is installed or not.

By changing the selinux label of the parent directory:
`/data/misc_ce/0/sdksandbox`, we can restrict app process from executing
inside the directory and avoid the privacy leak.

Sandbox process should only have "search" permission on the new label so
that it can pass through it to its data directory located in
`/data/misc_ce/0/sdksandbox/<package-name>/<per-sdk-dir>`.

Bug: 214241165
Test: atest SdkSandboxStorageHostTest
Test: `adb shell cd /data/misc_ce/0/sdksandbox` gives error
Test: manual test to verify webview still works
Change-Id: Id8771b322d4eb5532eaf719f203ca94035e2a8ed
Merged-In: Id8771b322d4eb5532eaf719f203ca94035e2a8ed
2022-05-19 16:01:15 +01:00
John Wu
cabed18a47 Remove key migration related changes
Migrating keys across UIDs is no longer required

Test: m
Bug: 228999189
Change-Id: Ic58a77285e105328a1f56ad9a8ca5d80bb559d83
2022-05-18 21:49:28 +00:00
Jeff Vander Stoep
b07c12c39d Iorapd and friends have been removed
Remove references in sepolicy. Leave a few of the types defined since
they're public and may be used in device-specific policy.

Bug: 211461392
Test: build/boot cuttlefish
Change-Id: I615137b92b82b744628ab9b7959ae5ff28001169
2022-05-18 12:07:39 +02:00
Eric Biggers
17369bef4a Remove init's write access to /data/user and /data/media
As a follow-up to https://r.android.com/2078213, remove init's write
access to directories with type system_userdir_file or
media_userdir_file.  This has been made possible by moving the creation
of /data/user/0 and /data/media/obb to vold.

Bug: 156305599
Change-Id: Ib9f43f2b111518833efe08e8cacd727c75b80266
2022-05-12 00:19:29 +00:00
Eric Biggers
b10cffe768 Merge "Restrict creating per-user encrypted directories" 2022-05-09 14:45:11 +00:00
Eric Biggers
9a5992336e Restrict creating per-user encrypted directories
Creating a per-user encrypted directory such as /data/system_ce/0 and
the subdirectories in it too early has been a recurring bug.  Typically,
individual services in system_server are to blame; system_server has
permission to create these directories, and it's easy to write
"mkdirs()" instead of "mkdir()".  Such bugs are very bad, as they
prevent these directories from being encrypted, as encryption policies
can only be set on empty directories.  Due to recent changes, a factory
reset is now forced in such cases, which helps detect these bugs;
however, it would be much better to prevent them in the first place.

This CL locks down the ability to create these directories to just vold
and init, or to just vold when possible.  This is done by assigning new
types to the directories that contain these directories, and then only
allowing the needed domains to write to these parent directories.  This
is similar to what https://r.android.com/1117297 did for /data itself.

Three new types are used instead of just one, since these directories
had three different types already (system_data_file, media_rw_data_file,
vendor_data_file), and this allows the policy to be a bit more precise.

A significant limitation is that /data/user/0 is currently being created
by init during early boot.  Therefore, this CL doesn't help much for
/data/user/0, though it helps a lot for the other directories.  As the
next step, I'll try to eliminate the /data/user/0 quirk.  Anyway, this
CL is needed regardless of whether we're able to do that.

Test: Booted cuttlefish.  Ran 'sm partition disk:253,32 private', then
      created and deleted a user.  Used 'ls -lZ' to check the relevant
      SELinux labels on both internal and adoptable storage.  Also did
      similar tests on raven, with the addition of going through the
      setup wizard and using an app that creates media files.  No
      relevant SELinux denials seen during any of this.
Bug: 156305599
Change-Id: I1fbdd180f56dd2fe4703763936f5850cef8ab0ba
2022-05-05 04:12:46 +00:00
Alex Buynytskyy
0105944bbc Allow system_server to read apk root hash.
Bug: 231354111
Test: presubmit
Change-Id: I01ec32d46014aafff58aaf94146d7a5953ec023e
2022-05-04 16:30:21 -07:00
Jaegeuk Kim
cec541e9ab Merge "allow rename fscklogs" 2022-05-04 07:35:09 +00:00
Treehugger Robot
1d79fd5071 Merge "[MS82.3] Add sepolicy to access connectivity apex directory" 2022-05-03 08:00:18 +00:00
Jaegeuk Kim
90b7070b37 allow rename fscklogs
Bug: 230637147
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Idd45e0f4135f95d9f650c5492481b5e19321c633
2022-05-02 17:19:43 -07:00
Junyu Lai
c43dbf8dec [MS82.3] Add sepolicy to access connectivity apex directory
Test: m
Bug: 230289468
Change-Id: I7e43c09f929a418c6c7b6bcfc3696a242c19f2d8
2022-04-26 02:20:30 +00:00
Michael Wright
d5d2f60795 Add vibrator and power HALs to Watchdog dumps
Test: adb shell am hang --allow-restart, check Last ANR for stacks
Fixes: 211998169
Change-Id: I7cad1e57caed5eb8a5c0092548362fd0a6b1d98d
2022-04-22 14:32:14 +00:00
Maciej Żenczykowski
1ebfb867a8 Merge "Grants clatd privs since forked by system server" 2022-04-21 14:00:23 +00:00
Alistair Delva
ce19c41b8f Merge "Adds GPU sepolicy to support devices with DRM gralloc/rendering" 2022-04-21 04:21:45 +00:00
Felipe Leme
9a385b2112 Adds system_user_mode_emulation_prop property.
It will be used by system_server only (i.e., not even Shell) to let
developers change the system user mode (to be headless or full).

Test: sesearch --allow -t system_user_mode_emulation_prop $ANDROID_PRODUCT_OUT/vendor/etc/selinux/precompiled_sepolicy

Bug: 226643927

Change-Id: Iaba42fd56dce0d8d794ef129634df78f9599260f
2022-04-20 13:28:01 -07:00
Jason Macnak
a93398051c Adds GPU sepolicy to support devices with DRM gralloc/rendering
... such as Cuttlefish (Cloud Android virtual device) which has a
DRM virtio-gpu based gralloc and (sometimes) DRM virtio-gpu based
rendering (when forwarding rendering commands to the host machine
with Mesa3D in the guest and virglrenderer on the host).

After this change is submitted, changes such as aosp/1997572 can
be submitted to removed sepolicy that is currently duplicated
across device/google/cuttlefish and device/linaro/dragonboard as
well.

Adds a sysfs_gpu type (existing replicated sysfs_gpu definitions
across several devices are removed in the attached topic). The
uses of `sysfs_gpu:file` comes from Mesa using libdrm's
`drmGetDevices2()` which calls into `drmParsePciDeviceInfo()` to
get vendor id, device id, version etc.

Bug: b/161819018
Test: launch_cvd
Test: launch_cvd --gpu_mode=gfxstream
Change-Id: I4f7d4b0fb90bfeef72f94396ff0c5fe44d53510c
Merged-In: I4f7d4b0fb90bfeef72f94396ff0c5fe44d53510c
2022-04-18 17:30:56 -07:00
Richard Chang
1c8df204ff Merge "sepolicy: allow vendor system native experiments property" 2022-04-15 03:47:28 +00:00
Kalesh Singh
6ba41462d5 Merge changes from topic "mglru-exp"
* changes:
  Add sepolicy for Multi-Gen LRU sysfs control
  Add sepolicy for mglru_native flag namespace
2022-04-12 13:48:48 +00:00
Richard Chang
7057e4abca sepolicy: allow vendor system native experiments property
Grant system_server and flags_health_check permission to set the
properties that correspond to vendor system native experiments.

Bug: 226456604
Test: Build
Change-Id: Ib2420cf6eaf1645e7f938db32c93d085dd8950a3
2022-04-12 08:11:53 +00:00
Kalesh Singh
9e25714cd7 Add sepolicy for mglru_native flag namespace
Bug: 227651406
Bug: 228525049
Change-Id: I9311b23bd10573fcdb62aba65eb2c6e3d177b467
2022-04-08 13:37:34 -07:00
Shikha Panwar
36daf98e45 Selinux setup for /data/misc/odsign/metrics/
odsign will be writing(metrics) to file
/data/misc/odsign/metrics/odsign-metrics.txt & system_server needs from it.

Test: adb pull /data/misc/odsign/metrics/odsign-metrics.txt after reboot
Bug: 202926606
Change-Id: I020efcee8ca7f5b81f1aa3374bbf2b3a7403186d
2022-04-07 14:18:37 +00:00
Andy Yu
6a10d563ea Merge "Add label and permission for game_mode_intervention.list" 2022-03-30 19:35:59 +00:00
Andy Yu
8337d04202 Add label and permission for game_mode_intervention.list
Bug: 219543620
Doc: go/game-dashboard-information-to-perfetto
Test: TBD
Change-Id: Ic6622aadef05e22c95d4ba739beed0e6fa1f3a38
2022-03-29 14:12:14 -07:00
Treehugger Robot
d796c9eb6c Merge "Add search in bpf directory for bpfdomains" 2022-03-25 20:32:15 +00:00
Ocean Chen
63e6e1dc02 Add persist.device_config.storage_native_boot.smart_idle_maint_enabled property policies
Add policies to set persist.device_config.storage_native_boot.smart_idle_maint_enabled property.

Bug: 202283480
Bug: 181079477
Bug: 215443809
Change-Id: I998e6dca950a8ceebb5fbc39568e3e8d6b86e8ce
2022-03-22 08:33:40 +00:00
Stephane Lee
b30e888b5c Add search in bpf directory for bpfdomains
Bug: 203462310
Test: Ensure that associated BPFs can be loaded
Change-Id: I317a890abb518cf4ac47cd089e882315434342ce
2022-03-21 17:31:17 -07:00
Evan Rosky
5cfdf2bd6e Add a persist.wm.debug property type and associated permissions
This is intended for wm properties related to wmshell/sysui.
Using this context allows sysui to manipulate these properties
in debug builds.

Bug: 219067621
Test: manual
Change-Id: I5808bf92dbba37e9e6da5559f8e0a5fdac016bf3
2022-03-07 19:44:59 +00:00
Jiakai Zhang
bf58100685 dontaudit denial on the odex file of location provider.
Bug: 194054685
Test: Presubmits
Change-Id: Ia636f7b32251c3b8cb018fee9216e5968d4e95ff
2022-02-16 14:12:49 +00:00
Alexander Potapenko
0a64d100b8 dmesgd: sepolicies
dmesgd is a daemon that collects kernel memory error reports.

When system_server notices that a kernel error occured, it sets the
dmesgd.start system property to 1, which results in init starting
dmesgd.

Once that happens, dmesgd runs `dmesg` and parses its output to collect
the last error report. That report, together with the headers containing
device- and build-specific information is stored in Dropbox.

Empirically, dmesgd needs the following permissions:
- execute shell (for popen()) and toolbox (for dmesg),
  read system_log (for dmesg)
- read /proc/version (to generate headers)
- perform Binder calls to servicemanager and system_server,
  find dropbox_service (for dropbox)
- create files in /data/misc/dmesgd (to store persistent state)

Bug: 215095687
Test: run dmesgd on a user device with injected KFENCE bugs
Change-Id: Iff21a2ffd99fc31b89a58ac774299b5e922721ea
2022-02-10 17:42:52 +00:00
Treehugger Robot
605715d665 Merge "Support legacy apexdata labels" 2022-02-10 11:44:11 +00:00
Steven Moreland
6598175e06 bpfdomain: attribute for domain which can use BPF
Require all domains which can be used for BPF to be marked as
bpfdomain, and add a restriction for these domains to not
be able to use net_raw or net_admin. We want to make sure the
network stack has exclusive access to certain BPF attach
points.

Bug: 140330870
Bug: 162057235
Test: build (compile-time neverallows)
Change-Id: I29100e48a757fdcf600931d5eb42988101275325
2022-02-10 00:34:50 +00:00
Christine Franks
c98bde94c4 Merge "Add uhid_device to system_server" 2022-02-08 17:13:32 +00:00
Alan Stokes
53c76a25bb Support legacy apexdata labels
This partly reverts fa10a14fac. There we
removed individual labels for various apexdata labels, replacing them
with apex_system_server_data_file.

Unfortunately that doesn't handle upgrade scenarios well, e.g. when
updating system but keeping the old vendor sepolicy. The directories
keep their old labels, and vold_prepare_subdirs is unable to relabel
them as there is no policy to allow it to.

So we bring back the legacy labels, in private not public, and add the
rules needed to ensure system_server and vold_prepare_subdirs have the
access they need. All the other access needed is obtained via the
apex_data_file_type attribute.

Bug: 217581286
Test: Reset labels using chcon, reboot, directories are relabeled, no denials
Change-Id: If696882450f2634e382f217dab8f9f3882bff03f
2022-02-08 16:07:08 +00:00
Alan Stokes
55803ca572 Allow reading hypervisor capabilities
System server needs to do this to know whether a suitable VM for
CompOS can be created. System server does not need the ability to
actually start a VM, so we don't grant that.

Bug: 218276733
Test: Presubmits
Change-Id: Ibb198ad55819aa924f1bfde68ce5b22c89dca088
2022-02-07 11:33:18 +00:00
Christine Franks
639c48d146 Add uhid_device to system_server
Bug: 217275682
Change-Id: I1ae74868344da290727df2474712b8b6ad2efdd7
Test: n/a
2022-02-04 15:13:43 +00:00
Lalit Maganti
bb197bba02 sepolicy: Allow system domains to be profiled
Bug: 217368496
Doc: go/field-tracing-t
Change-Id: Ie95c0cc2b1f9e8fa03f6112818936af692edf584
2022-02-01 16:27:26 +00:00
Thiébaud Weksteen
79ff061802 Merge "Grant getpgid to system_server on zygote" 2022-01-30 21:59:04 +00:00
Treehugger Robot
d3d214482f Merge "Move pf_key socket creation permission to system_server" 2022-01-28 19:01:36 +00:00
Ken Chen
1aed006a77 Move pf_key socket creation permission to system_server
Allow system_server to trigger the kernel synchronize rcu with open and
close pf_key socket. This action was previously done by netd but now
it need to be done by system_server instead because the handling code in
netd are moved to mainline module which will be loaded by system_server
in JNI mode.

Note: the permission will be removed from netd once all bpf interactions
have moved out of netd.

Bug: 202086915
Test: android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest
Change-Id: I440e0c87193775115a9b9ffb19270c47b01b082e
2022-01-28 17:12:51 +01:00
Lalit Maganti
34fb0d8933 Merge "sepolicy: add permissions for trace reporting" 2022-01-28 12:15:57 +00:00
Thiébaud Weksteen
6390b3f090 Grant getpgid to system_server on zygote
Should system_server kill zygote on crashes, it will attempt to kill any
process in the same process group. This ensures that no untracked
children are left.

Bug: 216097542
Test: m selinux_policy
Change-Id: Ie16074f76e351d80d9f17be930a731f923f99835
2022-01-28 13:47:20 +11:00
paulhu
70b0a77ee0 Add sepolicy for mdns service
mdns service is a subset of netd-provided services, so it gets
the same treatment as netd_service or dnsresolver_service

Bug: 209894875
Test: built, flashed, booted
Change-Id: I33de769c4fff41e816792a34015a70f89e4b8a8c
2022-01-25 00:50:21 +08:00
Treehugger Robot
c23930818d Merge "Add sepolicy for IInputProcessor HAL" 2022-01-21 22:45:52 +00:00
Hungming Chen
fc6556a5b5 Grants clatd privs since forked by system server
System server forks clatd now. Need to add rules to
fork clatd. netd doesn't fork clatd anymore.

Bug: 212345928
Test: ping 8.8.8.8 under ipv6-only network
check bpf maps are added.
$ adb shell dumpsys netd --short | grep Clat -A10
  ClatdController
    Trackers: iif[iface] nat64Prefix v6Addr -> v4Addr v4iif[v4iface] [fwmark]
    BPF ingress map: iif(iface) nat64Prefix v6Addr -> v4Addr oif(iface)
      47(wlan0) 64:ff9b::/96 2a00:79e1:abc:6f02:b7aa:ff3c:9220:595c -> 192.0.0.4 52(v4-wlan0)
    BPF egress map: iif(iface) v4Addr -> v6Addr nat64Prefix oif(iface)
      52(v4-wlan0) 192.0.0.4 -> 2a00:79e1:abc:6f02:b7aa:ff3c:9220:595c 64:ff9b::/96 47(wlan0) ether

Change-Id: I70be6132ab7bfdd96b5f537a96722312cd93bbb8
2022-01-21 18:17:45 +00:00
Treehugger Robot
439f17558c Merge "Allow system_server read and open access to sys/class/net." 2022-01-21 14:47:52 +00:00
Wayne Ma
27abad0dc8 Allow system_server read and open access to sys/class/net.
system_server needs search/read/open access to the directory.
This change gives system_server permissions to fetching the
information from sys/class/net.

Bug: 202086915
Test: build, flash, boot
Change-Id: I7b245510efbc99427f3491c9234c45c8cc18fea1
2022-01-21 03:20:10 +00:00
Siarhei Vishniakou
c655bece6a Add sepolicy for IInputProcessor HAL
This sepolicy is needed so that the vendor can launch a new HAL process,
and then this HAL process could join the servicemanager as an impl for
IInputProcessor. This HAL will be used to contain the previous impl of
InputClassifier and also new features that we are going to add.

Bug: 210158587
Test: use together with a HAL implementation, make sure HAL runs
Change-Id: I476c215ad622ea18b4ce5cba9c07ae3257a65817
2022-01-20 23:40:05 +00:00
John Wu
ce225f8bfb Merge "Add keystore2 LIST permission to system_server" 2022-01-19 00:05:29 +00:00
John Wu
cd5cf383f1 Add keystore2 LIST permission to system_server
This is required for listing all key aliases of other APP domains' keys
in order to migrate keys on behalf of the updated app by PMS.

Test: builds
Bug: 211665859
Change-Id: I541fb81e6186288a1e852ce60882651f838e36dc
2022-01-13 14:26:28 -08:00
Wenhao Wang
6a656c0b67 Add sepolicy for logd and logcat services
The logd binder service is on logd side.
The logcat binder service is on system_server side.
These two binder services facilitate the binder RPC
between logd and system_server.

Bug: 197901557
Test: manual
Change-Id: I5f08bbb44a88dc72302331ab11c7d54f94db16ac
2022-01-13 11:38:43 -08:00
Lalit Maganti
b549e2d837 sepolicy: add permissions for trace reporting
Bug: 205892741
Change-Id: I1b6b2ebeae99ca6a9725f24564386cea78403c6d
2022-01-04 14:02:20 +00:00
Richard Fung
d34435c257 Support reading block apexes from system_server
This relaxes the neverallow so that it is possible to write a new
SELinux allow for system_server to read /dev/block/vd*. It still isn't
possible unless a vendor enables it.

Bug: 196965847
Test: m -j
local_test_runner arc.Boot.vm

Change-Id: Idad79284778cf02066ff0b982480082828f24e19
2021-11-22 21:18:54 +00:00
Treehugger Robot
c1ebd11f2c Merge "Allow system server to access composd." 2021-11-18 13:03:01 +00:00
Ashwini Oruganti
ed7ebb867e Merge "Define and add the migrate_any_key permission to system_server" 2021-11-17 17:55:13 +00:00
Ashwini Oruganti
41843731cc Define and add the migrate_any_key permission to system_server
This change adds a permission migrate_any_key that will help the system
server in migrating keys for an app that wants to leave a sharedUserId.

Bug: 179284822
Test: compiles
Change-Id: I2f35a1335092e69f5b3e346e2e27284e1ec595ec
2021-11-16 10:18:19 -08:00
Alan Stokes
9112c9aa6d Allow system server to access composd.
Also allow composd to kill odrefresh (it execs it); this is necessary
for cancel() to work.

Bug: 199147668
Test: manual
Change-Id: I233cac50240130da2f4e99f452697c1162c10c40
2021-11-16 09:29:58 +00:00
David Brazdil
f7d7c22115 Merge "Allow control of AVF experiments" 2021-11-10 20:42:25 +00:00
Andrew Scull
d7bed7733e Allow control of AVF experiments
Grant system_server and flags_health_check permission to set the
properties that correspond to the AVF experiments.

Bug: 192819132
Test: m
Change-Id: I0e6fa73187abb4412d07ecfd42c1074b8afa5346
2021-11-10 10:42:47 +00:00
Ken
851c11b2cb sepolicy: allow to play f2fs-compression for odex/vdex files
This patch adds some ioctls for odex/vdex files.

Bug: 205257122
Test: Manual. Code runs.
Signed-off-by: Ken Bian <kenjc.bian@rock-chips.com>
Change-Id: Ibf7890f0910ed04e0355bef9c0bfb21b406fb7eb
2021-11-09 03:13:46 +00: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
Nicolas Geoffray
cd470d1e51 Allow system server to map zygote_tmpfs files.
Needed for an ART optimization.

Test: build
Change-Id: I120cdbe410248ac08f4e56cdeb6588681630a964
2021-10-05 15:03:54 +01:00
Treehugger Robot
a122abab14 Merge "Revert "Add userspace_panic_device and userpanic_use"" 2021-09-20 06:46:29 +00:00
Woody Lin
6ad56599a2 Revert "Add userspace_panic_device and userpanic_use"
This reverts commit 7ed2456b45.

Reason for revert: /dev/userspace-panic is discarded (b/188777408#comment13)
Bug: 188777408
Change-Id: I98b0159890ee755ffaefc5533f9c40d54f8f26d2
2021-09-18 03:03:36 +00:00
Hongguang
8e5d3d469f allow system server to read extcon state and type from sysfs
The target device needs to lable the SoC's extcons to sysfs_extcon in
the device's vendor sepolicy to allow the system_server access.

Bug: 152245127
Bug: 193492798
Bug: 193114615
Test: pressubmit and manual
Change-Id: Ib0a90ac5ce2c9437b19d6dc1e0b2cc50fed41dc3
2021-09-09 14:15:19 -07:00
Woody Lin
7ed2456b45 Add userspace_panic_device and userpanic_use
Define type userspace_panic_device and macro userpanic_use for init,
llkd, and system_server to access /dev/userspace_panic - a kernel file
node for userspace processes to request kernel panic.

Bug: 188777408
Change-Id: I1e9d115d85f664aa84bdd6bb4b95bdb48e3aab9a
2021-09-07 01:18:25 +08: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
Suren Baghdasaryan
592e06c910 sepolicy updates for adding native flag namespace for lmkd
sepolicy updates for running lmkd experiments.

Bug: 194316048
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I21df3b76cce925639385111bd23adf419f026a65
2021-08-09 17:35:09 -07: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
Hasini Gunasinghe
3e20b2895f Merge "Add keystore permission for metrics re-routing." 2021-07-01 12:30:08 +00: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
rnlee
b6142ecc22 Add sepolicy SF native boot namespace.
Following go/android-native-flag-api-manual.

Bug: 190769260
Test: make.
Change-Id: I84fe7e9d046fbbe737f09043589b19e71981f521
2021-06-30 14:07:44 -07: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
Treehugger Robot
03b80a12e4 Merge "Allow system_server to read /proc/vmstat" 2021-06-10 11:10:30 +00:00
Yi Kong
953aa5643f Allow system server to read profcollectd data files
This allows the system server to read the reports for uploading.

also cleaned up the out of order qemu_hw_prop entry.

Test: manual
Bug: 178561556
Bug: 183487233
Change-Id: I9e5aef9cbcf50fd085dd72900e3ab00a1b6c20a7
2021-06-09 13:01:50 +00:00
Ioannis Ilkos
351326b578 Allow system_server to read /proc/vmstat
/proc/vmstat oom_kill counts the number of times __oom_kill_process
was actioned
(https://lore.kernel.org/lkml/149570810989.203600.9492483715840752937.stgit@buzz/)

We want to record this in the context of system_server for tracking
purposes.

Bug: 154233512
Change-Id: I27bcbcd5d839e59a1dca0e87e2f4ae107201654c
Test: build, verify vmstat can be read
2021-06-08 14:24:26 +00:00
Calin Juravle
0b2ca6c22c Enable ART properties modularization
ART is becoming a module and we need to be able to add new properties
without modifying the non updatable part of the platform:

- convert ART properties to use prefix in the namespace of
[ro].dalvik.vm.
- enable appdomain and coredomain to read device_config properties
that configure ART

Test: boot
Bug: 181748174
Change-Id: Id23ff78474dba947301e1b6243a112b0f5b4a832
2021-06-01 16:14:55 -07:00
Jaegeuk Kim
1a15808dc0 sepolicy: allow to play f2fs-compression for apk files
This patch adds some ioctls for apk files and allows
shell to query for f2fs features.

Bug: 189169940
Test: Manual. Code runs.
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ia8bccf1bf663404b902703326a1853947b64e5ab
2021-05-27 20:31:17 -07:00
Alexander Dorokhine
0b2553a32b Allow the appsearch apex access to the apexdata misc_ce dir.
Bug: 177685938
Test: AppSearchSessionCtsTest
Change-Id: I727860a02cb9e612ce6c322662d418cddc2ff358
2021-05-26 09:47:19 -07:00
Shawn Willden
4361ef2724 Merge "TEMP" 2021-05-11 22:53:43 +00:00
Max Bires
2189a1a447 TEMP
Have system server add keystore2 stacktraces for ANR reporting

Test: ANR something
Bug: 184006658
Change-Id: I75892479cb59a8ae79cb9555b731dce479175aff
2021-05-11 22:52:05 +00:00
Hridya Valsaraju
f35c70b0dd Merge changes If26ba23d,Ibea38822
* changes:
  Revert "Revert "Exclude vendor_modprobe from debugfs neverallow restrictions""
  Revert "Revert "Add neverallows for debugfs access""
2021-05-05 17:31:35 +00:00
Songchun Fan
633f7ca868 [sepolicy] allow system server to read incfs metrics from sysfs
Address denial messages like:

05-05 05:02:21.480  1597  1597 W Binder:1597_12: type=1400 audit(0.0:140): avc: denied { read } for name="reads_delayed_min" dev="sysfs" ino=107358 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0

BUG: 184844615
Test: atest android.cts.statsdatom.incremental.AppErrorAtomTests#testAppCrashOnIncremental
Change-Id: I201e27e48a08f99f41a030e06c6f22518294e056
2021-05-04 22:56:41 -07:00
Hridya Valsaraju
23f9f51fcd Revert "Revert "Add neverallows for debugfs access""
This reverts commit e95e0ec0a5.

Now that b/186727553 is fixed, it should be safe to revert this revert.

Test: build
Bug: 184381659
Change-Id: Ibea3882296db880f5cafe4f9efa36d79a183c8a1
2021-05-04 22:06:46 -07:00
Songchun Fan
979a1f8f34 [sepolicy] allow system_server to ioctl INCFS_IOC_GET_LAST_READ_ERROR
Solves the denial message like:

04-30 03:54:46.972 21944 21944 I Binder:21944_17: type=1400 audit(0.0:502): avc: denied { ioctl } for path=2F646174612F696E6372656D656E74616C2F4D545F646174615F6170705F766D646C3133352F6D6F756E742F2E70656E64696E675F7265616473202864656C6574656429 dev="incremental-fs" ino=2 ioctlcmd=0x6727 scontext=u:r:system_server:s0 tcontext=u:object_r:incremental_control_file:s0 tclass=file permissive=1

BUG: 184844615
Test: manual
Change-Id: I3ef32613de348bca1d58cddf4ec1296d4828b51a
2021-04-30 16:46:06 +00:00
Nicolas Geoffray
6a311471a6 Allow boot animation to update boot status.
This CL was missed from the topic:
https://android-review.googlesource.com/q/topic:bootanim-percent

Test: update ART module, see animation go to 100%
Bug: 184881321
Change-Id: I59706718af11751a7e1f4b5ab1ff2793f554fb19
2021-04-28 15:17:09 +01:00
Treehugger Robot
98914119ae Merge "[incfs] Allow everyone read the IncFS sysfs features" 2021-04-26 22:19:37 +00:00
Hridya Valsaraju
e95e0ec0a5 Revert "Add neverallows for debugfs access"
Revert submission 1668411

Reason for revert: Suspect for b/186173384
Reverted Changes:
Iaa4fce9f0:Check that tracefs files are labelled as tracefs_t...
I743a81489:Exclude vendor_modprobe from debugfs neverallow re...
I63a22402c:Add neverallows for debugfs access
I289f2d256:Add a neverallow for debugfs mounting

Change-Id: I9b7d43ac7e2ead2d175b265e97c749570c95e075
2021-04-23 16:38:20 +00:00
Yurii Zubrytskyi
b382f02bf4 [incfs] Allow everyone read the IncFS sysfs features
Every process needs to be able to determine the IncFS features
to choose the most efficient APIs to call

Bug: 184357957
Test: build + atest PackageManagerShellCommandTest
Change-Id: Ia84e3fecfd7be1209af076452cc27cc68aefd80d
2021-04-21 15:15:40 -07:00
Hridya Valsaraju
a0b504a484 Add neverallows for debugfs access
Android R launching devices and newer must not ship with debugfs
mounted. For Android S launching devices and newer, debugfs must only be
mounted in userdebug/eng builds by init(for boot time initializations)
and dumpstate(for grabbing debug information from debugfs using the
dumpstate HAL).

This patch adds neverallow statements to prevent othe processes
being provided access to debugfs when the flag PRODUCT_SET_DEBUGFS_RESTRICTIONS
is set to true.

Test: make with/without PRODUCT_SET_DEBUGFS_RESTRICTIONS
Bug: 184381659
Change-Id: I63a22402cf6b1f57af7ace50000acff3f06a49be
2021-04-21 14:13:22 -07:00
Orion Hodson
cb0627099e Merge "Add odrefresh_data_file for odrefresh metrics" 2021-04-15 08:51:01 +00:00
Janis Danisevskis
79d167704e Add keystore2 namespace for LocksettingsService.
Bug: 184664830
Test: N/A
Change-Id: Ie04186eddaae689b968690b2bb0d3692c81ac645
2021-04-14 16:03:13 -07:00
Orion Hodson
7c6b3eb963 Add odrefresh_data_file for odrefresh metrics
Metrics are written to /data/misc/odrefresh by odrefresh during early
boot, then native code in ART system_server initialization passes them
to statsd and deletes the metrics files. This hand-off is necessary
because statsd does not start until after odsign and odrefresh have run.

Bug: 169925964
Test: manual
Change-Id: I8054519a714907819886dd6e5e78f3b5796d0898
2021-04-09 15:50:28 +01:00
Janis Danisevskis
b488a8fe1a Keystore 2.0: Remove keystore2.enable property.
Bug: 171563717
Test: N/A
Change-Id: I85819a71dc24777a9d54f0c83b8b29da9f48cec1
2021-03-19 10:07:49 -07:00
Treehugger Robot
baf84ee461 Merge "Add SELinux policy for using userfaultfd" 2021-03-17 15:04:51 +00:00
Lokesh Gidra
06edcd8250 Add SELinux policy for using userfaultfd
ART runtime will be using userfaultfd for a new heap compaction
algorithm. After enabling userfaultfd in android kernels (with SELinux
support), the feature needs policy that allows { create ioctl read }
operations on userfaultfd file descriptors.

Bug: 160737021
Test: Manually tested by exercising userfaultfd ops in ART
Change-Id: I9ccb7fa9c25f91915639302715f6197d42ef988e
2021-03-17 04:57:22 -07:00
Howard Chen
28003eeda4 Merge "Support copy-on-write persistent data block when running a DSU" 2021-03-17 02:07:03 +00:00