Commit graph

479 commits

Author SHA1 Message Date
Xin Li
11da9e6792 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I6d0b1be1a46288fff42c3689dbef2f7443efebcc
Change-Id: I133180d20457b9f805f3da0915e2cf6e48229132
2020-08-29 01:45:24 -07:00
Songchun Fan
1d4f2221cd Merge "[selinux] allow system_server to call INCFS_IOC_GET_FILLED_BLOCKS ioctl" 2020-08-20 17:07:40 +00:00
Songchun Fan
4be0afbfb7 [selinux] allow system_server to call INCFS_IOC_GET_FILLED_BLOCKS ioctl
This allows Incremental Service (part of system_server) to query the
filled blocks of files on Incremental File System.

Test: atest service.incremental_test
BUG: 165799231
Change-Id: Id63f8f325d92fef978a1ad75bd6eaa8aa5e9e68b
2020-08-20 16:00:00 +00:00
Martijn Coenen
cdecd3ca4c Merge "Add policy for LOOP_CONFIGURE ioctl." 2020-08-12 06:38:37 +00:00
Martijn Coenen
47f61db25e Add policy for LOOP_CONFIGURE ioctl.
This is a new ioctl for configuring loop devices, and is used by apexd.

Bug: 148607611
Bug: 161575393
Test: boot on device with/without LOOP_CONFIGURE
Change-Id: I9ef940c7c9f91eb32a01e68b858169c140d15d0f
Merged-In: I9ef940c7c9f91eb32a01e68b858169c140d15d0f
2020-08-11 13:22:09 +00:00
Hasini Gunasinghe
83e1f14f93 Allow keystore to write to statsd.
Keystore logging is migrated to use statsd. Therefore,
	keystore needs permission to write to statsd.

Test: Treehugger passes.
Bug: 157664923
Change-Id: If15ee3eb2ae7036dbaccd31525feadb8f54c6162
Merged-In: I2fb61fd7e9732191e6991f199d04b5425b637830
2020-08-07 16:35:18 +00:00
Treehugger Robot
142d16a964 Merge "Allow dumpstate to dump auto hal servers" 2020-08-04 17:28:41 +00:00
Jeff Sharkey
a0e7a6da28 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Change-Id: I0caf39b349c48e44123775d98c52a773b0b504ff
2020-07-31 12:28:11 -06:00
Yiming Jing
2fd322f630 Allow dumpstate to dump auto hal servers
audiocontrol_hal, vehicle_hal and evs_hal were added to dump_util.cpp in
b/148098383. But the coresponding dumpstate.te is not updated to relfect
the changes, causing denials when dumpstate attempts to dump auto hal servers.

This CL updates dumpstate.te to allow dumpstate to access auto hal servers.

Bug: 162537916
Test: sesearch -A -s dumpstate -t hal_audiocontrol_server -p signal sepolicy
Test: sesearch -A -s dumpstate -t hal_vehicle_server -p signal sepolicy
Test: sesearch -A -s dumpstate -t hal_evs_server -p signal sepolicy
Change-Id: If6d6e4d9c547da17817f2668dc4f2a093bddd632
2020-07-31 10:19:22 -07:00
Calin Juravle
6b1ac2e7c3 Fix sepolicy for secondary dex files am: de7244cf23 am: 150e00dd75
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1360752

Change-Id: Ib02dd445b7f15f4131323b02794b6a41aa93a625
2020-07-15 19:00:55 +00:00
Calin Juravle
de7244cf23 Fix sepolicy for secondary dex files
dexoptanalyzer need read access on the secondary
dex files and of the main apk files in order to successfully evaluate
and optimize them.

Example of denial:
audit(0.0:30): avc: denied { read } for
path="/data/app/~~Zux_isdY0NBkRWPp01oAVg==/com.example.secondaryrepro-wH9zezMSCzIjcKdIMtrw7A==/base.apk"
dev="vdc" ino=40966 scontext=u:r:dexoptanalyzer:s0
tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=0
app=com.example.secondaryrepro

Test: adb shell cmd package compile -r bg-dexopt --secondary-dex app
Bug: 160471235
Bug: 160351055
Change-Id: Id0bda5237d3ce1620d4f6ee89595836b4e1f3abf
2020-07-15 16:43:40 +00:00
Tianjie Xu
f609a8007e Merge "Allow kernel to write to update_engine_data_file" into rvc-dev am: 6bdafed310
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/11897443

Change-Id: I3b0892db1dcce1590d8b5903a964653a4e146d7f
2020-07-10 21:03:23 +00:00
Tianjie Xu
6bdafed310 Merge "Allow kernel to write to update_engine_data_file" into rvc-dev 2020-07-10 20:46:41 +00:00
Treehugger Robot
cee6cecaad Merge "Update prebuilt/seapp_contexts" am: 7b4027a826 am: 2312be1814
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1356843

Change-Id: I75dc920b9e0509c860c20b4fcff7fc5ba87c0358
2020-07-07 20:43:04 +00:00
Treehugger Robot
7b4027a826 Merge "Update prebuilt/seapp_contexts" 2020-07-07 20:09:18 +00:00
Ashwini Oruganti
a9ab9362d4 Update prebuilt/seapp_contexts
The seinfo=platform bit seems to have been missed in a previous update.

Test: builds
Change-Id: I0d8faeb8ca1ed326ab958e5da329288b91719206
2020-07-07 11:48:26 -07:00
Paul Crowley
93aad35cb1 Merge "Uncrypt: Allow uncrypt to write on ota_package_file." am: 42f9a5337a am: a05c24d464
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1344636

Change-Id: Ie99b25fdab079ef68d7e102c0f7592d6cbb28c95
2020-07-07 15:49:50 +00:00
Paul Crowley
42f9a5337a Merge "Uncrypt: Allow uncrypt to write on ota_package_file." 2020-07-07 15:27:29 +00:00
P.Adarsh Reddy
916bd874d6 Uncrypt: Allow uncrypt to write on ota_package_file.
This adds sepolicy rule to allow uncrypt module to write
on OTA zip (for f2fs_pin_file functionality).

Also, add a few dontaudit rules to suppress harmless denials.

Denials:
I uncrypt : type=1400 audit(0.0:177): avc: denied { write } for name="update.zip" dev="dm-10" ino=7727 scontext=u:r:uncrypt:s0 tcontext=u:object_r:ota_package_file:s0 tclass=file permissive=0

I uncrypt : type=1400 audit(0.0:175): avc: denied { search } for name="/" dev="sda9" ino=2 scontext=u:r:uncrypt:s0 tcontext=u:object_r:metadata_file:s0 tclass=dir permissive=0

I uncrypt : type=1400 audit(0.0:176): avc: denied { search } for name="gsi" dev="sda9" ino=19 scontext=u:r:uncrypt:s0 tcontext=u:object_r:gsi_metadata_file:s0 tclass=dir permissive=0

Bug: 158070965
Change-Id: I473c5ee218c32b481040ef85caca907a48aadee6
2020-07-07 00:03:11 +00:00
Treehugger Robot
da5d688917 Merge changes Ieee1d7de,Ie7780128
* changes:
  perfetto: don't audit isatty() check on shell pipes
  update 30.0 prebuilts for commit 2b2cde7592
2020-07-02 16:24:33 +00:00
TreeHugger Robot
dbe4f732a3 Merge "resolve merge conflicts of f885ab33e4 to rvc-dev-plus-aosp" into rvc-dev-plus-aosp 2020-07-02 16:15:17 +00:00
Justin Yun
aedba668b4 Label /system_ext/lib(64)/* as system_lib_file am: 088587886c am: 9730e23c22
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1354282

Change-Id: Id922f0821796f2c126c6be5904d2c50cc9bd447c
2020-07-02 05:09:41 +00:00
Justin Yun
112c4135db Label /system_ext/lib(64)/* as system_lib_file
This needs to be updated to api 30.0 which introduced the system_ext.

Bug: 160314910
Test: build and boot
Change-Id: I08c4aed640467d11482df08613039726e7395be0
Merged-In: I08c4aed640467d11482df08613039726e7395be0
(cherry picked from commit 85a92849c73ae2b28e8a33a2e01bac47cc9f1684)
2020-07-02 04:07:44 +00:00
Justin Yun
088587886c Label /system_ext/lib(64)/* as system_lib_file
This needs to be updated to api 30.0 which introduced the system_ext.

Bug: 160314910
Test: build and boot
Change-Id: I08c4aed640467d11482df08613039726e7395be0
2020-07-02 04:07:12 +00:00
Jeff Vander Stoep
1f9e45ee4b Label kprobes and restrict access
Bug: 149659981
Test: build & boot Pixel

Change-Id: I6abcd1bb9af15e7ba0f1f5e711ea9ac661bffc25
Merged-In: I6abcd1bb9af15e7ba0f1f5e711ea9ac661bffc25
2020-06-30 17:22:08 -07:00
Ryan Savitski
58c8751cf7 perfetto: don't audit isatty() check on shell pipes
CTS runs are being polluted by denial logs from the best-effort isatty (
-> TCGETS ioctl) check done by the perfetto's log formatter.

This patch suppresses the denial.

I believe that what's actually being denied is the ioctl itself, NOT the
TCGETS aspect of it (there is a domain-wide fifo_file TCGETS allowxperms
rule in domain.te:303). But the "dontauditxerms" suppresses the denial
anyway.

Bug: 159988048
Merged-In: Ieee1d7de8b023dd632d0e37afa3a2434cfd1a3a1
Change-Id: Ieee1d7de8b023dd632d0e37afa3a2434cfd1a3a1
(cherry picked from commit 8519c6d316)
2020-06-29 23:10:40 +01:00
Ryan Savitski
952990da87 resolve merge conflicts of f885ab33e4 to rvc-dev-plus-aosp
This is resolving the combination of ag/11956179 + ag/11956180,
as submitted in rvc-dev. The first change is a CP of a change already in
aosp/master, the second change is new.

The merge therefore contains just the second change as far as the
non-prebuilts are concerned, as well as an update of 30.0 prebuilts
for the combined changes.

Bug: 159988048
Change-Id: Ia35358419207dba7984f30da507f32902967ca62
2020-06-29 21:59:36 +00:00
Ryan Savitski
837e1f9bc7 update 30.0 prebuilts for commit 2b2cde7592
The non-prebuilt files are already up-to-date, as this change exists in
aosp/master as aosp/1267820.

Bug: 159988048
Merged-In: Ie7780128fcd80a051e809bfc98f21179cb3f0ecc
Change-Id: Ie7780128fcd80a051e809bfc98f21179cb3f0ecc
(cherry picked from commit 2b2cde7592)
2020-06-29 22:54:19 +01:00
Ryan Savitski
f885ab33e4 Merge changes Ieee1d7de,Ie7780128 into rvc-dev
* changes:
  perfetto: don't audit isatty() check on shell pipes
  perfetto: minor quality of life tweaks
2020-06-29 18:16:41 +00:00
TreeHugger Robot
051dffd04d Merge "GPU Memory: allow tracing gpu_mem/gpu_mem_total on user build" into rvc-dev 2020-06-26 20:09:14 +00:00
Ryan Savitski
8519c6d316 perfetto: don't audit isatty() check on shell pipes
Per the bug rvc CTS runs are being polluted by denial logs from the
best-effort isatty ( -> TCGETS ioctl) check done by the perfetto's log
formatter.

This patch suppresses the denial, which is what's proposed for the scope
of rvc.

I believe that what's actually being denied is the ioctl itself, NOT the
TCGETS aspect of it (there is a domain-wide fifo_file TCGETS allowxperms
rule in domain.te:303). But the "dontauditxerms" suppresses the denial
anyway.

Bug: 159988048
Tested: flashed crosshatch-userdebug, verified that CTS is no longer
        causing audit logs reported in the bug.
Change-Id: Ieee1d7de8b023dd632d0e37afa3a2434cfd1a3a1
2020-06-26 15:19:07 +00:00
Ryan Savitski
2b2cde7592 perfetto: minor quality of life tweaks
Change 1: when running the "perfetto" binary via "adb shell
perfetto...", ctrl-Cing the host process doesn't propagate the teardown
to the on-device process (which normally should stop the tracing session
immediately). Allow signals adbd->perfetto to resolve.

Change 2: don't print audit logs for a harmless isatty() check on adb
sockets when they're the stderr of a "perfetto" process.

Example denials from the isatty() check (ioctl is TCGETS):

avc: denied { getattr } for path="socket:[244990]" dev="sockfs"
ino=244990 scontext=u:r:perfetto:s0 tcontext=u:r:adbd:s0
tclass=unix_stream_socket permissive=0
avc: denied { ioctl } for path="socket:[244992]" dev="sockfs" ino=244992
ioctlcmd=0x5401 scontext=u:r:perfetto:s0 tcontext=u:r:adbd:s0
tclass=unix_stream_socket permissive=0

Example denial from ctrl-c'ing "adb shell perfetto ...":

avc: denied { signal } for comm=7368656C6C20737663203134343537
scontext=u:r:adbd:s0 tcontext=u:r:perfetto:s0 tclass=process
permissive=0

===

This is a CP of commit 5f1f1b6a7a, with
updated 30.0 prebuilts. Using a new Change-Id since as far as I
understand, the prebuilts should still be merged downstream.

Bug: 159988048
Tested: patched onto an internal branch, then verified that denials are
        gone on a flashed crosshatch-userdebug.
Change-Id: Ie7780128fcd80a051e809bfc98f21179cb3f0ecc
2020-06-26 15:16:45 +00:00
Yiwei Zhang
c7507f1b9b GPU Memory: allow tracing gpu_mem/gpu_mem_total on user build
Bug: 158431662
Test: enable the tracepoint on user build
Change-Id: I61560003c5cc92f2563fb98bdaee9bfd4807f46a
Merged-In: I61560003c5cc92f2563fb98bdaee9bfd4807f46a
2020-06-26 04:23:09 -07:00
Adam Shih
11aaf9c6b5 Let dumpstate access hal_identity
Bug: 158614313
Test: CtsSecurityHostTestCases:android.security.cts.SELinuxHostTest#testNoBugreportDenials
Merged-In: Ic07e64b0bb18f948764e7bde5985eab91747b882
Change-Id: I6f30510c391db03111a5bb2694049b32f742ff0c
2020-06-24 16:58:35 -04:00
Adam Shih
1929084080 Let dumpstate access hal_identity am: 8cc3f8d9ee am: c14114d1d3
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1347408

Change-Id: Icdcc679560ff8a835e8873997e342d24889b3973
2020-06-24 14:03:48 +00:00
Adam Shih
8cc3f8d9ee Let dumpstate access hal_identity
Bug: 158614313
Test: CtsSecurityHostTestCases:android.security.cts.SELinuxHostTest#testNoBugreportDenials
Change-Id: Ic07e64b0bb18f948764e7bde5985eab91747b882
2020-06-24 10:40:44 +08:00
TreeHugger Robot
b992eb34e6 Merge "sepolicy: label vendor_service_contexts as vendor_service_contexts_file" into rvc-dev 2020-06-19 11:15:23 +00:00
TreeHugger Robot
863dfbb1d0 Merge "Allow system server to communicate with GPU service." into rvc-dev 2020-06-19 03:00:17 +00:00
linpeter
e0fed1f9b8 sepolicy: label vendor_service_contexts as vendor_service_contexts_file
Due to AIDL HAL introduction, vendors can publish services
with servicemanager. vendor_service_contexts is labeled as
vendor_service_contexts_file, not nonplat_service_contexts_file.
And pack it to vendor partition.

Bug: 154066722

Test: check file label
Merged-In: Ic74b12e4c8e60079c0872b6c27ab2f018fb43969
Change-Id: Ic74b12e4c8e60079c0872b6c27ab2f018fb43969
2020-06-19 02:40:15 +00:00
Peiyong Lin
3e299e3a6f Allow system server to communicate with GPU service.
Currently system server also has a GPU service. We use that to observe
updatable driver package changes, in order to communciate that
information down to the GPU service, this patch allows system server to
make binder call.

Bug: b/157832445, b/159240322
Test: adb shell dumpsys gpu
Change-Id: I9c32c690707e24a5cfbdfdc62feeea9705321f5b
Merged-In: I9c32c690707e24a5cfbdfdc62feeea9705321f5b
2020-06-18 17:25:42 -07:00
Midas Chien
58fc40a8ba sepolicy: allow surfaceflinger to set surfaceflinger_display_prop
W//system/bin/init: type=1107 audit(0.0:51): uid=0 auid=4294967295
ses=4294967295 subj=u:r:init:s0 msg='avc: denied { set }
for property=graphics.display.kernel_idle_timer.enabled pid=643
uid=1000 gid=1003 scontext=u:r:surfaceflinger:s0
tcontext=u:object_r:surfaceflinger_display_prop:s0
tclass=property_service permissive=0

Bug: 157513573
Test: surfaceflinger can set graphics.display.kernel_idle_timer.enabled
Test: vendor_init can get graphics.display.kernel_idle_timer.enabled
Change-Id: I78023a7857c8aa81a8863010b875bcb885bae614
Merged-In: I78023a7857c8aa81a8863010b875bcb885bae614
Merged-In: Ic26874a74b10b13539846de33b3a8aa745c9841a
2020-06-18 20:50:56 +00:00
Ana Krulec
a6bc4e5271 Merge "sepolicy: allow surfaceflinger to set surfaceflinger_display_prop" into rvc-dev-plus-aosp 2020-06-18 19:09:12 +00:00
Midas Chien
0d0391f931 sepolicy: allow surfaceflinger to set surfaceflinger_display_prop
W//system/bin/init: type=1107 audit(0.0:51): uid=0 auid=4294967295
ses=4294967295 subj=u:r:init:s0 msg='avc: denied { set }
for property=graphics.display.kernel_idle_timer.enabled pid=643
uid=1000 gid=1003 scontext=u:r:surfaceflinger:s0
tcontext=u:object_r:surfaceflinger_display_prop:s0
tclass=property_service permissive=0

Bug: 157513573
Test: surfaceflinger can set graphics.display.kernel_idle_timer.enabled
Test: vendor_init can get graphics.display.kernel_idle_timer.enabled
Change-Id: I78023a7857c8aa81a8863010b875bcb885bae614
2020-06-19 01:45:34 +08:00
Treehugger Robot
bc9090fc6c Merge "Allow system server to communicate with GPU service." am: 9df1b49507 am: 1eb8d1b91a
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1341896

Change-Id: I874a8f46257f987cb0c2f56faddee9c2e1cfecf0
2020-06-18 17:18:20 +00:00
Peiyong Lin
d7b20d276f Allow system server to communicate with GPU service.
Currently system server also has a GPU service. We use that to observe
updatable driver package changes, in order to communciate that
information down to the GPU service, this patch allows system server to
make binder call.

Bug: b/157832445, b/159240322
Test: adb shell dumpsys gpu
Change-Id: I9c32c690707e24a5cfbdfdc62feeea9705321f5b
2020-06-17 17:21:23 -07:00
Tianjie Xu
c851deef79 Allow kernel to write to update_engine_data_file
This is needed to run update_engine unittests in cuttlefish. In the test,
the directory is mounted as R/W.

Denial:
avc: denied { write } for path="/data/misc/update_engine/tmp/a_img.NqUpaa" dev="dm-4" ino=3048 scontext=u:r:kernel:s0 tcontext=u:object_r:update_engine_data_file:s0 tclass=file permissive=0

strace:
mount("/dev/block/loop26", "/data/local/tmp/.org.chromium.Chromium.3s2KYE", "ext2", 0, "") = -1 EIO (I/O error)

Bug: 157594374
Test: unittests pass
Change-Id: I4658eb60240bd725bac2aef30305747ffe50aeb6
(cherry picked from commit 9f7947348f)
2020-06-17 14:55:45 -07:00
Maciej Żenczykowski
cd2996d1e1 grant bpfloader ability to fetch the fd of pinned bpf programs
Fixes:
  W bpfloader: type=1400 audit(0.0:13): avc: denied { read } for name="prog_offload_schedcls_ingress_tether_rawip" dev="bpf" ino=12551 scontext=u:r:bpfloader:s0 tcontext=u:object_r:fs_bpf:s0 tclass=file permissive=0

Test: builds, atest, treehugger
Bug: 150040815
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Merged-In: I3c7b116bc95d2534a3b72f2e3f19c4a2d8ee83f2
Change-Id: I3c7b116bc95d2534a3b72f2e3f19c4a2d8ee83f2
2020-06-17 21:21:53 +00:00
Hasini Gunasinghe
5034dcc68c Merge "Allow keystore to write to statsd." into rvc-dev am: 893ce72bc3
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/11824864

Change-Id: I6b17b7d8f1d2e53aa2361ab05da2d999af232e57
2020-06-17 18:23:28 +00:00
Hasini Gunasinghe
893ce72bc3 Merge "Allow keystore to write to statsd." into rvc-dev 2020-06-17 18:03:05 +00:00
Amy Zhang
2ff7d07dfb Merge "Add app_api_service in TunerResourceManager system service sepolicy" into rvc-dev am: 9212c417f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/11852496

Change-Id: Ib724b264d6f15f88a583a8f3db9858db40bc7a42
2020-06-17 17:55:15 +00:00