Commit graph

23448 commits

Author SHA1 Message Date
Treehugger Robot
5476d80b9a Merge "Merge public/property_contexts into private" 2020-03-13 02:06:47 +00:00
Ryan Savitski
485fe7b14b Merge "perfetto: fix missing fd:use for producer-supplied shared memory" 2020-03-12 14:05:32 +00:00
Inseob Kim
3efe91b8e0 Merge public/property_contexts into private
Originally public/property_contexts was introduced to create a whitelist
of system properties which can be accessed from vendor, and to be used
from VTS to ensure that the whitelist isn't modified. But it doesn't fit
well on sepolicy public/private split as the split isn't for stability,
but for letting vendor compile their sepolicy with public types. Also it
doesn't make sense only to check the whitelist on VTS, because platform
internal ones must also be unchanged.

This commit merges public/property_contexts into private as before. This
gives consistency with other context files such as file_contexts which
are already containing entries for vendor but are only defined in
private. This also simplifies property_contexts as there will be only one
property_contexts file. Another benefit is that VTS will check all
entries defined by system, not only exported ones.

Bug: 150331497
Test: m && run VtsTrebleSysProp manually
Change-Id: Ib9429e27b645ef21a36946fbaea069a718c3c6eb
Merged-In: Ib9429e27b645ef21a36946fbaea069a718c3c6eb
(cherry picked from commit 31391fa78e)
2020-03-12 21:07:18 +09:00
Ryan Savitski
3baeb1ea80 perfetto: fix missing fd:use for producer-supplied shared memory
The previous attempt (aosp/1225417) had a missing piece: while we
allowed traced to use the shared memory, we haven't allowed it to use
the file descriptors in the producers' domains. Since the shared memory
is being transferred as an fd (obtained from memfd_create), the service
ends up hitting a denial (see below for an example).

We ended up missing the general case as we only tested with the shell
domain at the time, and traced is already allowed to use shell's fds for
other reasons.

To reiterate, the tracing service treats producers as inherently
untrusted/adversarial, so its implementation should never attempt to use
a file descriptor that isn't otherwise validated (such as checking seals
for the memfds).

Example denial from a chromium apk that is exercising this path:

traced  : type=1400 audit(0.0:80): avc: denied { use } for
path=2F6D656D66643A706572666574746F5F73686D656D202864656C6574656429
dev="tmpfs" ino=151536 scontext=u:r:traced:s0
tcontext=u:r:untrusted_app_29:s0:c136,c256,c512,c768 tclass=fd
permissive=0

(deobfuscated path in the denial: /memfd:perfetto_shmem (deleted))

Tested: experimental chromium apk no longer crashes when trying to hand
        over shared memory to traced
Bug: 148841422
Change-Id: I7390fb174e2083ba7693c3160da44b4cfa7b1c8b
2020-03-11 22:12:09 +00:00
A. Cody Schuffelen
71b0b85a94 Add sepolicy for the securityfs mount type.
See discussion in aosp/1233645. There was a concern about this
filesystem automounting when enabled, so this change adds sepolicy to
preemptively lock it down.

I'm not confident it actually automounts. If it does, it'll land in
/sys/kernel/security, which is also protected with the sysfs policy.

Test: Builds
Bug: 148102533
Change-Id: I78a246a5c18953f2471f84367ab383afb2742908
2020-03-11 12:24:24 -07:00
Treehugger Robot
6862377b84 Merge "sepolicy: Add context for ro.boot.product.vendor.sku" 2020-03-09 20:08:55 +00:00
Steven Moreland
48eed15c35 Merge "Allow vndservicemanager to self-register." 2020-03-06 17:36:02 +00:00
Treehugger Robot
d9514b860e Merge "property_contexts: Drop COMPATIBLE_PROP guard" 2020-03-06 02:47:35 +00:00
Bill Yi
6b7f6599fa Merge stage-aosp-master to aosp-master - DO NOT MERGE
Change-Id: I46fe648ce4bd015b1ffff8d5a001d33311d2363b
2020-03-05 09:51:38 -08:00
Steven Moreland
52a96cc7dd Allow vndservicemanager to self-register.
This is useful for tools like dumpsys, so that they work on all services
equally as well. Also, so that there is no difference with the regular
service manager.

Bug: 150579832
Test: 'adb shell /vendor/bin/dumpsys -l' shows 'manager'
Test: denial is no longer present:
03-05 12:23:47.346   221   221 E SELinux : avc:  denied  { add } for pid=221 uid=1000 name=manager scontext=u:r:vndservicemanager:s0 tcontext=u:object_r:service_manager_vndservice:s0 tclass=service_manager permissive=0

Change-Id: Id6126e8277462a2c4d5f6022ab67a4bacaa3241e
2020-03-05 17:43:35 +00:00
Automerger Merge Worker
e7c95cb7a2 Merge "Add rules to dump fingerprint hal traces" am: 4f027f0eff
Change-Id: I3eee908d3b625f963f4b48d4b4fff4cbeb3cba07
2020-03-05 17:01:37 +00:00
Automerger Merge Worker
100d38e316 Merge "Allow update_engine to search metadata_file:dir." am: fe45425667
Change-Id: I2a1bacd9c2234233c28bf81c1140b0abdf6de12a
2020-03-05 17:00:50 +00:00
KRIS CHEN
4f027f0eff Merge "Add rules to dump fingerprint hal traces" 2020-03-05 16:46:52 +00:00
Yifan Hong
fe45425667 Merge "Allow update_engine to search metadata_file:dir." 2020-03-05 16:41:16 +00:00
Automerger Merge Worker
f35884b84f Allow apps to use mmap on fuse fds. am: 975215578f
Change-Id: I5bc9dc24cb69563fd131991381dc8abc575fde8b
2020-03-05 04:45:17 +00:00
Sudheer Shanka
975215578f Allow apps to use mmap on fuse fds.
This is needed for the following denial:
type=1400 audit(0.0:124): avc: denied { map } for
comm=54696D652D6C696D69746564207465 path="/mnt/appfuse/10182_2/2"
dev="fuse" ino=2 scontext=u:r:untrusted_app:s0:c182,c256,c512,c768
tcontext=u:object_r:app_fuse_file:s0 tclass=file permissive=0

Bug: 150801745
Test: atest CtsBlobStoreTestCases:com.android.cts.blob.BlobStoreManagerTest#testOpenBlob -- --abi x86
Merged-In: Ib7ca64e11b24f8835874698df15a9a0fdce67454
Change-Id: I4dc4ce91da3513a2d1f08ada401741f6d5a090c3
2020-03-04 17:21:18 -08:00
Automerger Merge Worker
3c777ae94c Merge "Allow gsid to callback system server for oneway method" am: 4e47834266
Change-Id: Ia8f911d46f4b7bf8e98cb4fcfdbf6a41fa0bb131
2020-03-04 09:34:59 +00:00
Howard Chen
4e47834266 Merge "Allow gsid to callback system server for oneway method" 2020-03-04 09:16:47 +00:00
Kris Chen
258442b3d4 Add rules to dump fingerprint hal traces
Bug: 150008549
Test: adb shell am hang
Test: adb bugreport
Change-Id: I0440bb8fd3cc1205a43eca6c7ef5f8d0afc92396
2020-03-03 16:58:58 +08:00
Yifan Hong
b34ede070d Allow update_engine to search metadata_file:dir.
This is previously needed by snapshotctl to initiate the merge,
but now update_engine is responsible for initiating the merge.

Bug: 147696014
Test: no selinux denial on boot.
Change-Id: I7804af1354d95683f4d05fc5593d78602aefe5a7
2020-03-02 18:20:37 -08:00
Automerger Merge Worker
8c0a066211 Merge "vold: allow to set boottime prop" am: 94dc474264
Change-Id: Ifaeadbf36f4486af3d566f9be774fecc4d8b9d32
2020-03-03 00:47:32 +00:00
Jaegeuk Kim
94dc474264 Merge "vold: allow to set boottime prop" 2020-03-03 00:33:50 +00:00
Felix
342b58a2ee property_contexts: Drop COMPATIBLE_PROP guard
public/property_contexts needs to be included regardless of
API level so that the property *labels* are always included.
Else, devices without PRODUCT_COMPATIBLE_PROPERTY (shipping
API level <27) will run into denials because the props are
labeled `default_prop`.

As a side benefit, this reduces deviation in test matrices.

The guard was originally introduced in:
e49714542e "Whitelist exported platform properties"

Test: Build for device without PRODUCT_COMPATIBLE_PROPERTY,
no more denials for accessing `default_prop` from e.g. HALs.

Change-Id: I5bbe5d078040bb26dd48d353953661c9375d2009
Signed-off-by: Felix <google@ix5.org>
2020-03-02 16:28:38 +01:00
Automerger Merge Worker
8b3a64da52 Merge "Add new apexd.status value of "activated"." am: f3f5163f0c
Change-Id: I0e854139d1d43a30c4e7507fc6cd09ce3ead707f
2020-03-02 10:33:47 +00:00
Oli Lan
f3f5163f0c Merge "Add new apexd.status value of "activated"." 2020-03-02 10:24:21 +00:00
Jaegeuk Kim
9c38162d28 vold: allow to set boottime prop
Bug: 149595111
Bug: 149844577
Bug: 138909685
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I46b8828569dd008944685a1f0c45cbddc4870002
2020-02-28 17:20:47 -08:00
Automerger Merge Worker
4d07ceb77c Whitelist prop persist.device_config.configuration. am: 1d9daf1c6e
Change-Id: Ibcc0621551b4094a01122fa3e97e41dbb2814edd
2020-02-28 18:12:35 +00:00
Hongyi Zhang
1d9daf1c6e Whitelist prop persist.device_config.configuration.
For system prop flags from DeviceConfig namespace "Configuration".

Test: Build and run on local device
Bug: 149420506

Change-Id: If4196b4bf231e7c52f98b92cc0031a08dad06120
2020-02-27 14:06:58 -08:00
Howard Chen
389bc7baec Allow gsid to callback system server for oneway method
Bug: 149790245
Bug: 149716497
Test: adb shell am start-activity \
    -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
    -a android.os.image.action.START_INSTALL \
    -d file:///storage/emulated/0/Download/system.raw.gz \
    --el KEY_SYSTEM_SIZE $(du -b system.raw|cut -f1) \
    --el KEY_USERDATA_SIZE 8589934592

Change-Id: I41c7b1278cfc103c90282b6a6781eab66fc9dcdb
2020-02-27 16:32:25 +08:00
Automerger Merge Worker
b55baf51eb Merge "Add resize2fs to fsck_exec file context" am: aa6dba2770
Change-Id: Iac634e675fd7c2d8091894177842b2eb9d5ab025
2020-02-27 03:21:11 +00:00
Keun-young Park
aa6dba2770 Merge "Add resize2fs to fsck_exec file context" 2020-02-27 03:02:02 +00:00
Automerger Merge Worker
1398f17b5e Merge "app: allow PROT_EXEC on ashmem objects" am: e2d909ae89
Change-Id: If7fccd01af17fbd097a12a47596b7199bb276ab0
2020-02-26 18:54:21 +00:00
Jeffrey Vander Stoep
e2d909ae89 Merge "app: allow PROT_EXEC on ashmem objects" 2020-02-26 18:36:55 +00:00
Roopesh Nataraja
efff8e2820 sepolicy: Add context for ro.boot.product.vendor.sku
ro.boot.product.vendor.sku can be set and read in vendor. This
property can be used to differentiate configuration at runtime.

Bug : 148582757
Test: Set this property in vendor and use it for building
      capabilities via SystemConfig.

Change-Id: I4ac29097f26e2f19b90b0d001820bb9144963d21
2020-02-25 23:50:47 +00:00
Automerger Merge Worker
377443a04d Merge "Allow kernel to write to update_engine_data_file" am: cc62c64eea
Change-Id: I22cde9f98a892947bc744b0345c6a755bf274632
2020-02-25 19:16:42 +00:00
Tianjie Xu
cc62c64eea Merge "Allow kernel to write to update_engine_data_file" 2020-02-25 19:06:43 +00:00
Jeff Vander Stoep
789ebf03ba app: allow PROT_EXEC on ashmem objects
This fixes a bug introduced in aosp/1143430 where the permission
should have been included for the newly introduced
ashmem_libcutils_device type.

Test: Build
Bug: 150193534
Change-Id: I5b1ed8d9548f9dab4ad9373f98e21614c07c3d38
2020-02-25 20:00:39 +01:00
Keun young Park
e6e5f32ea0 Add resize2fs to fsck_exec file context
- This allows init to access it.

Bug: 149039306
Test: Flash and confirm that file system can run resize2fs when metadata_csum is enabled.
Change-Id: Id91d8fb6800b254b12eaf93a0e8cb019b55d2702
2020-02-25 08:37:35 -08:00
Automerger Merge Worker
3e54bef43f Merge "Update automotive display service rules" am: d36a0750e4
Change-Id: Ia6ad5c66dd3a736f1af4d5d5cbe996487f3f7a20
2020-02-25 15:58:35 +00:00
Changyeon Jo
d36a0750e4 Merge "Update automotive display service rules" 2020-02-25 15:38:00 +00:00
Automerger Merge Worker
3b590980df Merge "Allow dumpstate to dump NNAPI HAL log on userbuild" am: fb9ff8d5b6
Change-Id: Ib617782e2a1e04546d3b4b39f7bf130e095b5762
2020-02-25 11:10:36 +00:00
Stefano Galarraga
fb9ff8d5b6 Merge "Allow dumpstate to dump NNAPI HAL log on userbuild" 2020-02-25 10:47:38 +00:00
Automerger Merge Worker
e45d2de45f Merge "allow priv_apps to read from incremental_control_file" am: bb4a0467f8
Change-Id: I98fa5f2bfaa72ec281e338c95abb1213ba5c534e
2020-02-25 10:30:45 +00:00
Treehugger Robot
bb4a0467f8 Merge "allow priv_apps to read from incremental_control_file" 2020-02-25 10:16:56 +00:00
Automerger Merge Worker
886b1f54db Merge "traced_perf sepolicy tweaks" am: f173b14363
Change-Id: Ia4fa23f9c76472ac214bc48342bcfc3c05ecc2f9
2020-02-25 04:29:50 +00:00
Treehugger Robot
f173b14363 Merge "traced_perf sepolicy tweaks" 2020-02-25 04:18:25 +00:00
Changyeon Jo
17b38d526d Update automotive display service rules
This change updates sepolicies for automotive display service to make it
available to the vendor processes.

Bug: 149017572
Test: m -j selinux_policy
Change-Id: I48708fe25e260f9302e02749c3777c0ca0d84e4b
Signed-off-by: Changyeon Jo <changyeon@google.com>
2020-02-25 02:02:54 +00:00
Automerger Merge Worker
403c7c3a57 Merge "Use prefixes for binder cache SELinux properties." am: 749e119053
Change-Id: Id67aea768d7f86a2cd409fd99dd25d0bbec8bb5f
2020-02-25 00:41:36 +00:00
Collin Fijalkovich
749e119053 Merge "Use prefixes for binder cache SELinux properties." 2020-02-25 00:24:46 +00:00
Songchun Fan
82ea55def0 allow priv_apps to read from incremental_control_file
Denial messages:

02-21 20:19:41.817  1439  1439 I Binder:1439_3: type=1400 audit(0.0:1851): avc: denied { read } for path=2F2E70656E64696E675F7265616473202864656C6574656429 dev="incremental-fs" ino=2 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:incremental_control_file:s0 tclass=file permissive=1
02-21 20:19:41.817 20337 20337 I Binder:20337_2: type=1400 audit(0.0:1852): avc: denied { getattr } for path=2F2E70656E64696E675F7265616473202864656C6574656429 dev="incremental-fs" ino=2 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:incremental_control_file:s0 tclass=file permissive=1 app=com.android.vending

Test: manual
Change-Id: Ie188f294ea2a6aff71a49a6f17679c3cf810b69d
2020-02-24 18:26:47 +00:00