Commit graph

7976 commits

Author SHA1 Message Date
Steven Moreland
248f0e069a Update transaction log permissions.
I locked down binderfs in Android V (this release still), but
part of it was opened up too much, so transactions restricted
to userdebug.

transaction_log and failed_transaction_log are not used in AOSP,
but they are requested by partners.

Bug: 316970771 for transactions
Bug: 336711420 for request to open up transaction history logs
Test: boot, bugreport, also:

:) adb shell ls -Z /dev/binderfs/binder_logs
u:object_r:binderfs_logs_transaction_history:s0 failed_transaction_log
u:object_r:binderfs_logs_proc:s0                proc
u:object_r:binderfs_logs:s0                     state
u:object_r:binderfs_logs_stats:s0               stats
u:object_r:binderfs_logs_transaction_history:s0 transaction_log
u:object_r:binderfs_logs_transactions:s0        transactions
:) adb shell cat /dev/binderfs/binder_logs/transaction_log
10058502: reply from 6450:8668 to 6766:6766 context binder node 0 handle -1 size 36:0 ret 0/0 l=0
10058503: call  from 6766:6766 to 6450:0 context binder node 199747 handle 23 size 116:0 ret 0/0 l=0
10058504: reply from 6450:8668 to 6766:6766 context binder node 0 handle -1 size 12:0 ret 0/0 l=0
10058505: call  from 6766:6766 to 6450:0 context binder node 199747 handle 23 size 84:0 ret 0/0 l=0
...
:) adb shell cat /dev/binderfs/binder_logs/failed_transaction_log
26418: reply from 584:1568 to 0:0 context binder node 0 handle -1 size 20:0 ret 29189/0 l=3194
57265: async from 2978:4304 to 3039:0 context binder node 40111 handle 6 size 96:0 ret 29189/-3 l=3465
57269: call  from 4437:4613 to 670:0 context binder node 57183 handle 44 size 116:0 ret 29189/-3 l=3465
57288: async from 4252:4450 to 3039:0 context binder node 34895 handle 1 size 92:0 ret 29189/-3 l=3465
...

Change-Id: I73e570dee8e59e76acaf0def615701e0e85e207f
2024-05-17 22:35:55 +00:00
Nate Jiang
229807f032 Change WifiScanner from system_api_service to app_api_service
This will allow the CTS get the WifiScanner to test. Also WifiScanner is
a system API and all APIs are protected by the priviliged permissions.

Bug: 339527374
Test: CtsWifiTestCases

Change-Id: Ic06a5804fa81a952e9e8792e93df489a9d47d521
2024-05-09 00:13:26 +00:00
Pawan Wagh
b071882d76 Allow system app and update_engine to read OTA from /vendor
Introuducing vendor_boot_ota_file which will be used to allow
reading OTAs from /vendor/boot_otas when BOARD_16K_OTA_MOVE_VENDOR := true
is set. These OTAs will be read from settings app(system_app) and update
engine.

Test: m, m Settings && adb install -r $ANDROID_PRODUCT_OUT/system_ext/priv-app/Settings/Settings.apk
Bug: 335022191
Change-Id: Ie42e0de12694ed74f9a98cd115f72d207f67c834
2024-05-02 01:14:47 +00:00
T.J. Mercier
716260ac6b Allow shell read access to cgroup state
at /proc/cgroups.

Test: adb shell cat /proc/cgroups
Bug: 335278695
Change-Id: I52773c63200a2a048a4c5497c338ddcbe0f23593
2024-04-29 14:59:03 +00:00
Inseob Kim
ec218a7678 Guard proc_compaction_proactiveness
Bug: 330670954
Test: TH
Change-Id: I92c5f5d08fbe16a7c185e430799c98b6a9b38ecf
2024-04-25 09:58:55 +09:00
Inseob Kim
3458c57e5a Guard new types with starting_at_board_api macro
To prevent these types from being released in 24Q3, which must be same
as 202404 release.

Bug: 330670954
Test: build
Change-Id: Ibb124fbb069f2025a572bc09c73c241f808676c3
2024-04-23 02:05:24 +00:00
Treehugger Robot
949b5d7e4e Merge "Revert^2 "Add pm.archiving.enabled system property"" into main 2024-04-11 03:34:52 +00:00
Inseob Kim
e972e936da Revert^2 "Add pm.archiving.enabled system property"
This reverts commit 840041d5d2.

Reason for revert: 202404 prebuilts must not be changed since freeze.

Change-Id: I320fde8de611ad4ae1546f4ce754871a0646dcc4
2024-04-11 00:56:13 +00:00
Treehugger Robot
808a734c09 Merge "Revert "Add pm.archiving.enabled system property"" into main 2024-04-11 00:12:11 +00:00
Song Chun Fan
840041d5d2 Revert "Add pm.archiving.enabled system property"
This reverts commit 32ab868eac.

Reason for revert: no longer needed

Change-Id: I2ce46773503d39f843038fca3bb8527eb5bb53eb
BUG: 331165939
2024-04-10 17:39:43 +00:00
Martin Liu
f7396914b0 add compaction_proactiveness type
Bug: 332916849
Test: boot
Change-Id: I41c0da22ed5ad738c75fb00e2ac8a22c35dff2d3
Signed-off-by: Martin Liu <liumartin@google.com>
2024-04-10 13:48:15 +00:00
Devin Moore
dfc018f886 Merge "Allow system_server to read binderfs state file" into main 2024-04-02 22:04:34 +00:00
Devin Moore
9645657201 Allow system_server to read binderfs state file
This is for more information on binder threads during ANRs.

Test: adb shell am hang
Bug: 316970771
Change-Id: I905c8b605540aabb7463cb0e1b3a9a8b07f8d5cb
2024-03-29 00:30:19 +00:00
Treehugger Robot
f02575f27f Merge "Add "DO NOT ADD statements" comments to public" into main 2024-03-28 06:22:32 +00:00
Treehugger Robot
350ddbb9dc Merge "Make enable_16k_pages_prop readable by vendor" into main 2024-03-28 03:26:30 +00:00
Inseob Kim
09b27c7109 Add "DO NOT ADD statements" comments to public
For visibility

Bug: 232023812
Test: N/A
Change-Id: I0bc6dc568210b81ba1f52acb18afd4bcc454ea1c
2024-03-28 11:27:43 +09:00
Inseob Kim
75806ef3c5 Minimize public policy
Ideally, public should only contain APIs (types / attributes) for
vendor. The other statements like allow/neverallow/typeattributes are
regarded as implementation detail for platform and should be in private.

Bug: 232023812
Test: m selinux_policy
Test: diff <(git diff --staged | grep "^-" | cut -b2- | sort) \
           <(git diff --staged | grep "^+" | cut -b2- | sort)
Test: remove comments on plat_sepolicy.cil, replace base_typeattr_*
      to base_typeattr and then compare old and new plat_sepolicy.cil
Change-Id: I5e7d2da4465ab0216de6bacdf03077d37f6ffe12
2024-03-28 00:33:46 +00:00
Kelvin Zhang
b9a6b9ac11 Make enable_16k_pages_prop readable by vendor
Vendor_init needs to read this property to process event triggers
depending on ro.product.build.16k_page.enabled .

Test: th
Bug: 319335586
Change-Id: I4f52073fbd2a138d84162710c925f65cc705c356
2024-03-27 14:23:16 -07:00
Jiakai Zhang
4acd07323e Update SELinux policy for Pre-reboot Dexopt.
- Add pm.dexopt.* properties.
- Add rules for running artd in chroot.

Bug: 311377497
Test: manual - Run Pre-reboot Dexopt and see no denial.
Change-Id: If5ff9b23e99be033f19ab257c90e0f52bf250ccf
2024-03-27 10:53:50 +00:00
Treehugger Robot
b8e34c377a Merge "lmkd: Add sepolicy rules around bpf for lmkd" into main 2024-03-21 06:07:18 +00:00
Treehugger Robot
a6039befcf Merge "allow domain search for /metadata dir" into main 2024-03-21 03:07:16 +00:00
Dennis Shen
9a5b2f5e3b allow domain search for /metadata dir
While testing aconfig storage file read by a demo app. We discovered
the need to do metadata_file:dir search in logcat log.

Bug: b/312459182
Test: demo app start
Change-Id: I0872ff192280228cc2270ae4a04755bc5cfbd9cc
2024-03-21 01:50:06 +00:00
Treehugger Robot
b637f1a413 Merge "Cameraserver: Allow camera to switch thread scheduling policy" into main 2024-03-20 16:25:50 +00:00
Dennis Shen
10c1046a3f Merge "allow all domain search permission for aconfig_storage_metadata_file dir" into main 2024-03-20 11:56:57 +00:00
Emilian Peev
a31bbfe4e2 Cameraserver: Allow camera to switch thread scheduling policy
Allow camera server to switch the scheduling policy
for certain time critical threads.

Bug: 323292530
Test: Manual using camera application,
Camera CTS

Change-Id: Ib665009c095efc21f65b1d8b3ddd9c2528c1c794
2024-03-19 19:14:45 +00:00
Dennis Shen
cd560f115b allow all domain search permission for aconfig_storage_metadata_file dir
Just allow aconfig_storage_metadata_file:file read permission is not
enough to read the pb file, we also need
aconfig_storage_metadata_file:dir search permission.

Bug: b/312459182
Test: audit2allow after having demo app access the file
Change-Id: I1790ea84a56e83f43313af82378f245e2bb6597e
2024-03-19 17:50:16 +00:00
Carlos Galo
ea1bd5d68f lmkd: Add sepolicy rules around bpf for lmkd
LMKD needs to be able to attach BPF tracepoints. It needs to be able to
access tracefs, attach and run bpf programs.

Test: m
Test: Verified no denials with lmkd and libmemevents integration
Bug: 244232958
Change-Id: I57248b729c0f011937bec139930ca9d24ba91c3b
Signed-off-by: Carlos Galo <carlosgalo@google.com>
2024-03-19 00:46:47 -07:00
Inseob Kim
4914c17ded Add a trailing newline
Bug: 326134149
Test: TH
Change-Id: I7a47014a8cd9d586f521b8926197a3659dd13b6b
2024-03-19 10:24:55 +09:00
Yabin Cui
948ae15060 Add profcollectd.etr.probe property and associated permissions
It is used by profcollectd to notify vendor_init to trigger
a manual probe of coresight etr.

Bug: 321061072
Test: build and run on device
Change-Id: I5aa65f8d5a25f1284f09111c940f0a2c1a62ac18
2024-03-15 12:21:44 -07:00
Treehugger Robot
7c6a7c0486 Merge "Allow dumpsys on user builds" into main 2024-03-07 00:03:35 +00:00
Dennis Shen
067f7db593 Merge "aconfigd: create aconfig daemon selinux policy" into main 2024-02-28 12:31:26 +00:00
Dennis Shen
2659257c76 aconfigd: create aconfig daemon selinux policy
Bug: b/312444587
Test: m and launch avd
Change-Id: I0156a9dee05139ec84541e0dff2f95285c97cfb9
2024-02-26 19:58:48 +00:00
Thiébaud Weksteen
1fc3a6f955 Merge "Grant lockdown integrity to all processes" into main 2024-02-26 00:11:52 +00:00
Jooyung Han
c6d75293b9 Add input_device.config_file.apex property
This new property is to set an apex name when input configuration files
are bundled in an apex.

libinput checks the new sysprop when loading input configuration.

This removes hard-coded apex name (com.android.input.config).

Bug: 315080500
Test: adb shell dumpsys input
  # set "touch.orientationAware = 0" in Touchscreen_0.idc
  # build/install the input config apex
  # Observe the Input configuration
  # "Touch Input Mapper" shows "OrientationAware: false"
Change-Id: Ie0bf30bff2ed7f983caa5b893994a5bd2759e192
2024-02-23 14:31:58 +09:00
Thiébaud Weksteen
99a4cbcee7 Grant lockdown integrity to all processes
The default policy for the "lockdown" access vector on Android was
introduced in commit bcfca1a6. While the "confidentiality" permission
was granted to all processes, the "integrity" was marked as
neverallowed.

Upstream, the support for that access vector was removed from kernel
5.16 onwards.

It was found that the "integrity" permission either does not apply to
Android or duplicates other access control (e.g., capabilities
sys_admin).

Instead of simply removing the neverallow rule, the access is granted to
all processes. This will prevent the proliferation of references to this
access vector in vendors' policies and ultimately facilitate its
removal.

Test: presubmit
Bug: 285443587
Bug: 269377822
Bug: 319390252
Change-Id: If2ad34fbbf2c0d29ac54ab5d1be430623f86f1f7
2024-02-22 12:20:38 +11:00
Jooyung Han
77b2a438fc Merge "Revert^2 "Relax neverallows for vendor to use /system/bin/sh"" into main 2024-02-19 02:03:06 +00:00
Jooyung Han
9a123be434 Revert^2 "Relax neverallows for vendor to use /system/bin/sh"
This reverts commit f77cf6780c.

Reason for revert: sepolicy change is still necessary. (won't break things)

Change-Id: If47218b39ac34c21f3e09d29a5e713b240c4f0a6
2024-02-16 11:06:40 +00:00
Håkan Kvist
1f915b4b13 label boot animations on oem with bootanim_oem_file
Bootanimation only access boot animation files on oem. Label
these files with bootanim_oem_file and remove oemfs file allow rule.

Also allow mediaserver and app to read this new label as they can access
/oem/media folder.

Bug: 324437684
Test: Confirm that boot animation on oem is shown without violations
Change-Id: I940ccde9391a5daa920f31926d32e68b1de5b7eb
2024-02-16 11:08:30 +01:00
Joonhun Shin
f77cf6780c Revert "Relax neverallows for vendor to use /system/bin/sh"
Revert submission 2964802-sh_path

Reason for revert: <b/325569171>

Reverted changes: /q/submissionid:2964802-sh_path

Change-Id: I89e635e742d8f4f8a79afa1bb2646c7621705994
2024-02-16 09:22:42 +00:00
Jooyung Han
f0ba322926 Relax neverallows for vendor to use /system/bin/sh
Since 202404, vendor components will use /system/bin/sh for system(3),
popen(3), etc.

Bug: 324142245
Test: system("readlink /proc/$$/exe") in vendor HALs
Change-Id: I521499678e87a7d0216a276e014888867f495803
2024-02-15 13:18:40 +09:00
Dennis Shen
6c8210da20 selinux setup for files under /metadata/aconfig dir
1, /metadata/aconfig is the directory that stores aconfig storage
related protobuf files and flag value files boot copy. Grant read
access to everybody. But limit the write access only to init and
aconfig storage service process (to be created later)

2, /metadata/aconfig/flags is the sub directory that stores persistent
aconfig value files.Initially set it up to be accessible by
system_server process only . When aconfig storage service process is
created, will add another permission to storage service process.

Context to why we are hosting flag data on /metadata partition:

Android is adopting trunk stable workflow, flagging and A/B testing is
essential to every platform component. We need some place to host the
flag that are accessible to system processes that starts before /data
partition becomes available.

In addition, there has been a long discussion regarding utilizing
/metadata partition for some process data, another example is mainline
modules, we are trying to make them to be able to be mounted earlier,
but cannot due to /data availability.

Bug: 312444587
Test: m
Change-Id: I7e7dae5cf8c4268d71229c770af31b5e9f071428
2024-02-14 17:56:29 +00:00
Yisroel Forta
e510cb8696 Merge "SELinux permissions for ProfilingService" into main 2024-02-12 14:22:31 +00:00
Yisroel Forta
aa9d0bf24c SELinux permissions for ProfilingService
Test: Presubmit, manually confirm service accessible
Bug: 293957254
Change-Id: I7103be95ff49eb87b4c7164a38a481034d72a9aa
2024-02-09 19:25:32 +00:00
Håkan Kvist
e38af22c5e remount: allow bootanimation to run animation from oem
Grant bootanimation all read permissions on oem using
r_dir_file macro instead of specifying individual permissions.

This prevents failure to read the bootanimation on oem if
partition has been remounted.

After remount, bootanimation will log violation for the
/oem/media directory when reading an existing file (boot animation can
is still played).
avc:  denied  { read } for  pid=2820 comm="bootanimation" name="media"
   dev="sda75" ino=152 scontext=u:r:bootanim:s0
   tcontext=u:object_r:oemfs:s0 tclass=dir permissive=0

After remount, if modifying/adding file in /oem/media directory,
bootanimation will fail to read the bootanimation zip, now with
violation:
avc:  denied  { read } for  pid=2838 comm="bootanimation" name="media"
   dev="dm-8" ino=70 scontext=u:r:bootanim:s0 tcontext=u:object_r:oemfs:s0
   tclass=dir permissive=0

Bug: 324437684
Test: adb remount
      replace /oem/media/bootanimation.zip with custom animation
      adb reboot
      confirm that expected bootanimation is played
      confirm no selinux violations are seen in logcat
Change-Id: Iaafdeeacaf88d8f5c1214700edc8eec2824b0159
2024-02-09 16:09:05 +01:00
Jiakai Zhang
95d371bcfd Merge "Update sepolicy for service dexopt_chroot_setup and artd_pre_reboot." into main 2024-02-09 02:52:58 +00:00
mrulhania
9a7700cd46 Add SELinux policy for ContentProtectionManagerService
Bug: 324348549
Test: build
Change-Id: Ieb319ed033d2fdb18cf76107c44cd6357221ecc4
2024-02-08 19:56:49 +00:00
Jiakai Zhang
817c49f74c Update sepolicy for service dexopt_chroot_setup and artd_pre_reboot.
Bug: 311377497
Test: manual - Call
  getDexoptChrootSetupServiceRegisterer().waitForService()
Test: manual - Set up a chroot environment and call
  getArtdPreRebootServiceRegisterer().waitForService()
Change-Id: I50b5f7f858dab37f05174cb9787f64303d50d083
2024-02-08 10:13:27 +08:00
Robert Shih
0f486059b0 Allow dumpsys on user builds
Bug: 320403913
Test: adb shell dumpsys android.hardware.drm.IDrmFactory/clearkey
Change-Id: Ibc8214dac63558b5bbf886b25607f36e293d3e8d
2024-02-07 18:35:51 +00:00
Treehugger Robot
49a519234b Merge "Changes in SELinux Policy for CSS API" into main 2024-02-06 20:28:45 +00:00
Jooyung Han
952673da5b Add hal_graphics_mapper_service type
This is used for mapper sphal library which is defined in VINTF and
queried via servicemanager.

Bug: 317178925
Test: cuttlefish loads mapper.minigbm
Change-Id: Ibddc0239e52065a89c656f885f34835406665009
2024-02-05 18:14:53 +09:00