Commit graph

89 commits

Author SHA1 Message Date
Satoshi Niwa
ae167c2105 Set expandattribute false for property attributes in prebuilts am: fa3b250ad1
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1435472

Change-Id: I09d504f312e95a63434c68211f5dd830b6b22f1a
2021-10-08 17:12:46 +00:00
Inseob Kim
3b8b4251b7 Update 30.0 prebuilts to latest rvc-dev policy
For whatever reason, system/sepolicy/prebuilts/api/30.0 and rvc-dev's
system/sepolicy differ a little. This makes 30.0 prebuilts up-to-date
and also updates plat_pub_versioned.cil, built from aosp_arm64-eng
target on rvc-dev branch.

Bug: 168159977
Test: m selinux_policy
Change-Id: I03e8a40bf021966c32f0926972cc2a483458ce5b
2020-12-09 20:44:38 +09:00
martinwu
c366ba73c6 Fix TH build error because of file.te
Add proc_net rules into prebuilts/api/30.0/public/file.te to fix build
errors

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

Bug: 145579144
Bug: 170265025
Test: build pass and reboot to check avc message in bugreport
Change-Id: I2085366b345c044e1b69f726809100fa43336c34
2020-10-26 11:09:23 +08:00
Primiano Tucci
5d026b3152 Keep AOSP sepolicy up to date with internal master
This re-alignes aosp and internal master to avoid
conflicts when uploading CLs upstream.

Bug: 170126760
Change-Id: I9c087e70998cd529b71dec7428641c4bfef10d31
2020-10-13 18:52:25 +00:00
Adam Shih
e712c3db12 Suppress errors that are not needed
The purpose of misc_writer is to write misc partition. However,
when it includes libfstab, it will probe files like kernal command
line (proc/cmdline) and metadata, which are permissions it does not
need.

Bug: 170189742
Test: Boot under permissive mode and find the errors gone.
Change-Id: Icda3200660a3bee5cadb6f5e0026fa71941ae5dc
2020-10-07 08:52:51 +00:00
Satoshi Niwa
fa3b250ad1 Set expandattribute false for property attributes in prebuilts
To prevent these from being optimized away.

(Follow-up CL for aosp/1427751 )

Bug: 161083890
Test: atest CtsSecurityHostTestCases
Change-Id: I11669b1643671f386c53136de0b7adea2b43bc28
2020-09-24 10:43:09 +09:00
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
JaeMan
15f64fc5f8 Add ro.vendor.build.version.sdk to property_contexts
At b/160209547, it is needed to read
ro.vendor.build.version.sdk prop to determine
whether skipping test or not based on vendor
image's release version. But
ro.vendor.build.version.sdk is not added to
property_contexts and failed to read that prop in
tests. So, added ro.vendor.build.version.sdk to
property_contexts for checking vendor image's
release version in test.

Bug: 160209547
Test: m selinux_policy
Change-Id: I4a7b91029c0ea6bb3c4cf2b12469f392f3a77559
Merged-In: I86bcfa632de61c5805e42aea3a1f232ae4ad080e
(cherry picked from 65cecec142)
2020-08-07 04:41:29 +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
P.Adarsh Reddy
5491d7e26c 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
Cherry-Pick-Of: 916bd874d6
Merged-In: I473c5ee218c32b481040ef85caca907a48aadee6
Change-Id: I473c5ee218c32b481040ef85caca907a48aadee6
2020-07-10 19:38:20 -07: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
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
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
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
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
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
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
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
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
Amy Zhang
9212c417f1 Merge "Add app_api_service in TunerResourceManager system service sepolicy" into rvc-dev 2020-06-17 17:45:14 +00:00
Treehugger Robot
6167a003a6 Merge "sepolicy: label vendor_service_contexts as vendor_service_contexts_file" am: bc8ed95f69 am: 23068f2625
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1331415

Change-Id: Ic9d269dedcc061b95ca5942ae4a9f6bad8edd981
2020-06-16 09:37:41 +00:00
linpeter
87c7261f0a 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
Change-Id: Ic74b12e4c8e60079c0872b6c27ab2f018fb43969
2020-06-15 17:09:46 +08:00
Amy Hsu
0f352fbd98 resolve merge conflicts of 98412ab604 to rvc-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: I831c2feb3b86bfa2008ef6e5b74e81399d8145d8
2020-06-15 17:04:12 +08:00
Amy Hsu
98412ab604 sepolicy: change vendor property to system property
1. Add surfaceflinger_display_prop property context
2. Set context for graphics.display.kernel_idle_timer.enabled
3. Context for system property that is get by surfaceflinger
and set by vendor_init and system_app.

W /system/bin/init: type=1107 audit(0.0:5): uid=0 auid=4294967295 ses=4294967295 subj=u:r:init:s0 msg='avc: denied { set } for property=vendor.display.enable_kernel_idle_timer pid=2396 uid=1000 gid=1000 scontext=u:r:system_app:s0 tcontext=u:object_r:vendor_display_prop:s0 tclass=property_service permissive=0'

Bug:137064289
Test: $ make selinux_policy. Check kernel idle timer works correct.

Change-Id: I77a82b5abfe5a771418dab5d40b404a1cdca4deb
2020-06-15 13:56:38 +08:00
Amy Zhang
0379e48ecf Add app_api_service in TunerResourceManager system service sepolicy
Make TunerResourceManager accessible through CTS
Test: atest android.media.tv.tuner.cts
Bug: 158868205

Change-Id: Ica202eacd674ae8f05000b31b76b31c50d8f761c
2020-06-12 15:37:05 -07:00
TreeHugger Robot
d0e2d47162 Merge "selinux: Allow system_server to access files in iorapd dir." into rvc-dev am: 50f13cfc82
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/11796673

Change-Id: Ie2d5522c31371541c35601b6138727569553dec0
2020-06-10 22:06:53 +00:00
Alan Stokes
075bb7c84e DO NOT MERGE Update prebuilts/api/30.0.
Bug: 157723850
Test: Builds
Change-Id: Id774d00099317cb4d5b69751e74c6d4fcaf5c5d6
2020-06-09 16:35:15 +01:00
Treehugger Robot
f08f743702 Merge "Update sepolicy for GPU profiling properties." 2020-06-09 05:05:33 +00:00
Treehugger Robot
63ff32ddb0 Merge "Add sepolicy for FUSE control filesystem." 2020-06-09 00:23:51 +00:00
Yan Wang
a9df37fff2 selinux: Allow system_server to access files in iorapd dir.
Bug: 158007508
Test: make and see if system server could access iorapd dir.
Change-Id: I4cff9b4154d7e633d8437de84c51ac1ca334cbcf
2020-06-09 00:19:41 +00:00
Martijn Coenen
aa2cb5129e Add sepolicy for FUSE control filesystem.
To allow vold to abort it.

Bug: 153411204
Test: vold can access it
Merged-In: I334eaf3459905c27d614db8eda18c27e62bea5fa
Change-Id: I334eaf3459905c27d614db8eda18c27e62bea5fa
2020-06-08 20:40:01 +02:00
Peiyong Lin
37dea070ce Update sepolicy for GPU profiling properties.
A device must indicate whether GPU profiling is supported or not through
setting these two properties properly. CTS needs to read these two
properties in order to run corresponding compliance tests. Hence need to
update sepolicy for these two properties.

Bug: b/157832445
Test: Test on Pixel 4
Change-Id: I6f400ecbbd5e78b645bb620fa24747e9367c2ff3
Merged-In: I6f400ecbbd5e78b645bb620fa24747e9367c2ff3
2020-06-05 12:03:29 -07:00
Peiyong Lin
374424fc60 Update sepolicy for GPU profiling properties.
A device must indicate whether GPU profiling is supported or not through
setting these two properties properly. CTS needs to read these two
properties in order to run corresponding compliance tests. Hence need to
update sepolicy for these two properties.

Bug: b/157832445
Test: Test on Pixel 4
Change-Id: I6f400ecbbd5e78b645bb620fa24747e9367c2ff3
Merged-In: I6f400ecbbd5e78b645bb620fa24747e9367c2ff3
2020-06-04 22:24:22 -07:00
Peiyong Lin
fbfa8ce0ae Update sepolicy for GPU profiling properties.
A device must indicate whether GPU profiling is supported or not through
setting these two properties properly. CTS needs to read these two
properties in order to run corresponding compliance tests. Hence need to
update sepolicy for these two properties.

Bug: b/157832445
Test: Test on Pixel 4
Change-Id: I6f400ecbbd5e78b645bb620fa24747e9367c2ff3
2020-06-04 20:27:01 -07:00
Mohammad Samiul Islam
16acba6536 Merge "Create sepolicy for allowing system_server rw in /metadata/staged-install" into rvc-dev am: b1ab605166
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/sepolicy/+/11408966

Change-Id: Ic8fcf68a36a565638badedbdbdc8f03366cf7fd8
2020-06-03 10:19:32 +00:00
Mohammad Samiul Islam
476d616e43 Create sepolicy for allowing system_server rw in /metadata/staged-install
Bug: 146343545
Test: presubmit
Change-Id: I4a7a74ec4c5046d167741389a40da7f330d4c63d
Merged-In: I4a7a74ec4c5046d167741389a40da7f330d4c63d
(cherry picked from commit be5c4de29f)
2020-06-03 10:59:02 +01:00
Mohammad Samiul Islam
b1ab605166 Merge "Create sepolicy for allowing system_server rw in /metadata/staged-install" into rvc-dev 2020-06-03 09:57:18 +00:00
Yan Wang
5f8faa8547 sepolicy: Allow iorapd process to send signal to prefetch and am: 9ef72aae58
Original change: undetermined

Change-Id: I4539a7361694dd4b41d58f94d65652ee3297ff24
2020-06-02 10:43:29 +00:00
Yan Wang
9ef72aae58 sepolicy: Allow iorapd process to send signal to prefetch and
inode2filename process.

Bug: 157282668
Test: Check no avc: denied in logcat.
Change-Id: I298cea931c8d6f178bc0195bfced0e8efc51fcad
2020-06-01 20:05:30 +00:00