Commit graph

2538 commits

Author SHA1 Message Date
Badhri Jagan Sridharan
9b07889452 hal_usb_gadget sepolicy
Bug: 63669128
Test: Checked for avc denail messages.
Change-Id: I057b3cf9ccc945cb943b9cf60fc9cd6c023eddda
2018-01-19 07:59:11 -08:00
Jaekyun Seok
5580de4bdc Merge "Add rcs.publish.status to the whitelist" am: 5971d678e6 am: 006abea25a
am: 0399f1e452

Change-Id: I143916184d8741093139d1d25213f8432fad4c01
2018-01-19 04:50:37 +00:00
Yifan Hong
4e0af024f0 Merge "charger: allow to read /sys/class/power_supply" am: 1dafee26ee am: d39b16ba59
am: 1f5cce99e9

Change-Id: If2858e33bc11c09789eb5155d912a24b6a87a2b6
2018-01-19 04:50:16 +00:00
Jaekyun Seok
5971d678e6 Merge "Add rcs.publish.status to the whitelist" 2018-01-19 03:22:34 +00:00
Treehugger Robot
1dafee26ee Merge "charger: allow to read /sys/class/power_supply" 2018-01-19 03:18:43 +00:00
TreeHugger Robot
205e38fbf9 Merge "Enforce per-app data protections for targetSdk 28+" 2018-01-19 00:56:07 +00:00
Yifan Hong
2d64886d08 charger: allow to read /sys/class/power_supply
Test: charger mode correctly shuts off when unplugged

Change-Id: I06a7ffad67beb9f6d9642c4f53c35067b0dc2b3d
Fixes: 71328882
2018-01-18 16:46:17 -08:00
Jaekyun Seok
34aad97ea9 Add rcs.publish.status to the whitelist
Bug: 72154054
Test: tested with walleye
Change-Id: I35271c6044946c4ec639409c914d54247cfb9f79
2018-01-19 07:35:44 +09:00
Jeff Vander Stoep
6231b4d9fc Enforce per-app data protections for targetSdk 28+
Adds per-app categories to untrusted app domains and their
app data types. Per-app categories are in addition to the
existing per-user categories.

Apps targeting sdk version 28+ will now have the following
characteristics:
Domain: u:r:untrusted_app:s0:c[0-9]+,c[0-9]+,c[0-9],c[0-9]
Data context: u:object_r:app_data_file:s0:c[0-9]+,c[0-9]+,c[0-9],c[0-9]

Whereas apps targeting 27- will look like:
Domain: u:r:untrusted_app_27:s0:c[0-9]+,c[0-9]+
Data context: u:object_r:app_data_file:s0:c[0-9]+,c[0-9]+

To ensure backwards compatibility with previous SDK versions,
the levelFrom=all now enforces categories by dominance instead of
equality. Apps with per-app and per-user categories will continue
to have selinux permissions (but not necessarily unix permissions)
to access app data with only per-user categories, but apps with only
per-user categories will not be able to access the data of apps with
both per-app and per-user categories.

Bug: 63897054
Test: Boot sailfish, run apps, verify no new selinux denials.
Test: cts-tradefed run cts -m CtsSelinuxTargetSdkCurrentTestCases
Test: cts-tradefed run cts -m CtsSelinuxTargetSdk27TestCases
Test: cts-tradefed run cts -m CtsSelinuxTargetSdk25TestCases
Test: adb sideload an OTA and verify that files are correctly labeled.
Change-Id: I64b013874fe87b55f47e817a1279e76ecf86b7c0
2018-01-18 13:32:57 -08:00
Tri Vo
4d8ea7b48e Merge "Mark shell as system_executes_vendor_violators." am: 65565c1cfd am: 6029d32912
am: 236e1b7ee4

Change-Id: I963a4fd6d26f574137d884b92febea1e7f2926c3
2018-01-18 02:36:28 +00:00
Chenbo Feng
ef441de96e Add sepolicy to lock down bpf access am: 566411edf2 am: 6b2a01a651
am: e638b198e0

Change-Id: I8cab5775ea450daa65a72e75828b76b7eb831c90
2018-01-18 02:36:11 +00:00
Roshan Pius
2724e81c9e Merge "sepolicy(hostapd): Add a HIDL interface for hostapd" 2018-01-18 00:49:19 +00:00
Andy Hung
66b4faba12 dumpstate: add media.metrics am: 8b049d5b6f am: 9709a69aa7
am: 5ba720353a

Change-Id: If770834a54da575449a69a14790ecbc2af470867
2018-01-18 00:13:04 +00:00
Tri Vo
65565c1cfd Merge "Mark shell as system_executes_vendor_violators." 2018-01-17 23:46:22 +00:00
Chenbo Feng
566411edf2 Add sepolicy to lock down bpf access
Add a new set of sepolicy for the process that only netd use to load
and run ebpf programs. It is the only process that can load eBPF
programs into the kernel and is only used to do that. Add some
neverallow rules regarding which processes have access to bpf objects.

Test: program successfully loaded and pinned at sys/fs/bpf after device
boot. No selinux violation for bpfloader
Bug: 30950746

Change-Id: Ia6bb1afda29ae0749bdc368e2dfc5faa12e81b2f
2018-01-17 23:19:30 +00:00
Tri Vo
30a3157003 Mark shell as system_executes_vendor_violators.
Bug: 62041836
Test: sailfish sepolicy builds

Change-Id: Iad865fea852ab134dd848688e8870bc71f99788d
2018-01-17 09:39:22 -08:00
Andy Hung
8b049d5b6f dumpstate: add media.metrics
Test: adb bugreport
Bug: 71483452
Change-Id: Ibd98702c1f757f17ada61a906ae4e0ec750aac79
2018-01-17 09:36:20 -08:00
Jaekyun Seok
6033cee6e9 Merge "Fix TODOs of duplicate property names for prefix and exact matching" am: 1757417211 am: d90c40a636
am: a0519b183d

Change-Id: I82ce0c73fb254ef658b4e6153f6aae2a2f9fa1e5
2018-01-17 05:47:04 +00:00
Treehugger Robot
1757417211 Merge "Fix TODOs of duplicate property names for prefix and exact matching" 2018-01-17 05:35:55 +00:00
Andreas Gampe
1fe0948217 Merge "Sepolicy: Allow perfprofd to contact dropbox" am: 163fc775a6 am: 5c8c3cd9e7
am: 9b2f10da30

Change-Id: Ic77d058cc67746d1d18072768efe361484d3fdda
2018-01-17 04:06:20 +00:00
Treehugger Robot
163fc775a6 Merge "Sepolicy: Allow perfprofd to contact dropbox" 2018-01-17 03:57:07 +00:00
Jaekyun Seok
f9d27887eb Fix TODOs of duplicate property names for prefix and exact matching
Duplicate property names are supported now for prefix and exact
matching.

Bug: 38146102
Test: tested on walleye with PRODUCT_COMPATIBLE_PROPERTY=true
Change-Id: Ifd9d32eaece7370d69f121e88d5541f7a2e34458
2018-01-16 22:41:04 +00:00
Tri Vo
19243f69c1 Merge "Introduce system_executes_vendor_violators attribute." am: ba6cd7b1fe am: 1740ddb521
am: a1633f9d4f

Change-Id: Ic6d96559c0678c2a17c953a385c0c7c5fbadf86d
2018-01-16 20:41:03 +00:00
Yifan Hong
4f1bb3ee94 Allow shell to start vendor shell am: 00ab5d86be am: 8fe0a12faf
am: bf7d32846f

Change-Id: Ia7d99d5c945309f612a53dbc5bab25be7c5ff772
2018-01-16 20:22:42 +00:00
Tri Vo
ba6cd7b1fe Merge "Introduce system_executes_vendor_violators attribute." 2018-01-16 20:07:00 +00:00
Yifan Hong
00ab5d86be Allow shell to start vendor shell
Test: adb shell /vendor/bin/sh
Fixes: 65448858
Change-Id: Ic2c9fa9b7e5bed3e1532f4e545f54a857ea99fc6
2018-01-16 18:28:51 +00:00
Tri Vo
282dbf7bbb Introduce system_executes_vendor_violators attribute.
We use this attribute to annotate coredomains that execute vendor code
in a Treble-violating way.

Bug: 62041836
Test: sepolicy builds
Change-Id: Ie6052209b3901eaad8496b8fc9681421d7ee3c1c
2018-01-16 17:43:30 +00:00
Roshan Pius
5bca3e860d sepolicy(hostapd): Add a HIDL interface for hostapd
Change sepolicy permissions to now classify hostapd as a HAL exposing
HIDL interface.

Sepolicy denial for accessing /data/vendor/misc/wifi/hostapd:
12-27 23:40:55.913  4952  4952 W hostapd : type=1400 audit(0.0:19): avc:
denied { write } for name="hostapd" dev="sda13" ino=4587601
scontext=u:r:hal_wifi_hostapd_default:s0
tcontext=u:object_r:system_data_file:s0 tclass=dir permissive=0

01-02 19:07:16.938  5791  5791 W hostapd : type=1400 audit(0.0:31): avc:
denied { search } for name="net" dev="sysfs" ino=30521
scontext=u:r:hal_wifi_hostapd_default:s0
tcontext=u:object_r:sysfs_net:s0 tclass=dir permissive=0

Bug: 36646171
Test: Device boots up and able to turn on SoftAp.
Change-Id: Ibacfcc938deab40096b54b8d0e608d53ca91b947
2018-01-12 14:05:38 -08:00
Tri Vo
a4e83bc5f3 Merge "Revert "Coredomain can't execute vendor code."" 2018-01-12 18:10:34 +00:00
Tri Vo
d2315bdf6a Revert "Coredomain can't execute vendor code."
This reverts commit 07dd2c9e89.

Reason for revert: albacore build broken

Change-Id: I551b1d8c008f01fb815e42b59d397feb9672b8e6
2018-01-12 18:07:25 +00:00
Andreas Gampe
3fa95acb1e Sepolicy: Allow perfprofd to contact dropbox
Give rights to call dropbox via binder.

Test: m
Test: manual
Change-Id: I968c432a27bc8fbe677a2dd03671908d555f9df6
2018-01-12 09:39:20 -08:00
Tri Vo
cba25d2c0a Merge "Coredomain can't execute vendor code." 2018-01-12 17:16:36 +00:00
Jeff Vander Stoep
89ea84aabb relabel files in /proc/net/xt_qtaguid/ am: 43303c8b89 am: 02dbf4e0a1
am: 2beb891520

Change-Id: Idfe7ef49572476508ef52391f221029d662ffad8
2018-01-11 20:43:04 +00:00
Jeff Vander Stoep
43303c8b89 relabel files in /proc/net/xt_qtaguid/
/proc/net/xt_qtaguid is used by apps to track their network data
use. Limit access to just zygote spawned processes - apps and
system_server, omitting access to isolated_app which is not allowed
to create network sockets.
As Android moves to eBPF for app's network data stats, access to
/proc/net/xt_qtaguid will be removed entirely. Segmenting access off
is the first step.
Bug: 68774956

This change also helps further segment and whitelist access to
files in /proc/net and is a step in the lockdown of /proc/net.
Bug: 9496886

Test: boot Taimen. Walk through setup-wizard. Make phone call and
    video call. Browse web. Watch youtube. Navigate in maps.
Test: cts-tradefed run cts -m CtsAppSecurityHostTestCases -t \
    android.appsecurity.cts.AppSecurityTests
Test: cts-tradefed run cts -m CtsNativeNetTestCases
Test: cts-tradefed run cts -m CtsIncidentHostTestCases -t \
    com.android.server.cts.NetstatsIncidentTest
Test: cts-tradefed run cts -m CtsOsTestCases -t \
    android.os.cts.StrictModeTest
Test: cts-tradefed run cts -m CtsNetTestCases -t \
    android.net.cts.TrafficStatsTest
Test: cts-tradefed run cts -m CtsUsageStatsTestCases -t \
    android.app.usage.cts.NetworkUsageStatsTest
Test: vts-tradefed run vts -m VtsQtaguidTest
Change-Id: Idddd318c56b84564142d37b11dcc225a2f2800ea
2018-01-11 16:46:36 +00:00
Jaekyun Seok
e0909f482c Merge "Whitelist exported platform properties" am: 70d2bb432a am: 42f8d7b27a
am: f00d05634b

Change-Id: Id6276f733fb5d52b2437927e13343d40c7d53007
2018-01-10 23:53:09 +00:00
Tri Vo
07dd2c9e89 Coredomain can't execute vendor code.
Bug: 62041836
Test: sepolicy builds
Change-Id: Ie6052209b3901eaad8496b8fc9681421d7ee3c1c
2018-01-10 10:53:55 -08:00
Jaekyun Seok
e49714542e Whitelist exported platform properties
This CL lists all the exported platform properties in
private/exported_property_contexts.

Additionally accessing core_property_type from vendor components is
restricted.
Instead public_readable_property_type is used to allow vendor components
to read exported platform properties, and accessibility from
vendor_init is also specified explicitly.

Note that whitelisting would be applied only if
PRODUCT_COMPATIBLE_PROPERTY is set on.

Bug: 38146102
Test: tested on walleye with PRODUCT_COMPATIBLE_PROPERTY=true
Change-Id: I304ba428cc4ca82668fec2ddeb17c971e7ec065e
2018-01-10 16:15:25 +00:00
Primiano Tucci
214f47963b Perfetto SELinux policies am: c80f9e037b am: 3ed0362a30
am: 7c5113d79f

Change-Id: I70969b44d0fe8cc732848453bcbb8657df7fd08c
2018-01-10 00:43:53 +00:00
Primiano Tucci
c80f9e037b Perfetto SELinux policies
Perfetto is a performance instrumentation and logging framework,
living in AOSP's /external/pefetto.
Perfetto introduces in the system one binary and two daemons
(the binary can specialize in either depending on the cmdline).

1) traced: unprivileged daemon. This is architecturally similar to logd.
   It exposes two UNIX sockets:
   - /dev/socket/traced_producer : world-accessible, allows to stream
     tracing data. A tmpfs file descriptor is sent via SCM_RIGHTS
     from traced to each client process, which needs to be able to
     mmap it R/W (but not X)
   - /dev/socket/traced_consumer : privilege-accessible (only from:
     shell, statsd). It allows to configure tracing and read the trace
     buffer.
2) traced_probes: privileged daemon. This needs to:
   - access tracingfs (/d/tracing) to turn tracing on and off.
   - exec atrace
   - connect to traced_producer to stream data to traced.

init.rc file:
https://android-review.googlesource.com/c/platform/external/perfetto/+/575382/14/perfetto.rc

Bug: 70942310
Change-Id: Ia3b5fdacbd5a8e6e23b82f1d6fabfa07e4abc405
2018-01-10 00:18:46 +00:00
Luis Hector Chavez
9c72ef8904 Merge "Revert "Allow callers of uevent_kernel_*() access to /proc/sys/kernel/overflowuid"" am: 3ec0dbf7d1 am: df624b3479
am: 45b0aa3308

Change-Id: I9c08801a5fdf232f2e70d2d97e22e7d2e90dcbbb
2018-01-09 20:21:47 +00:00
Max Bires
d4d74acf44 Merge "Adding a traceur_app domain to remove it from shell" am: 64a0f9288d am: b3b9475de0
am: 4e0f65463b

Change-Id: I6fd4ce8b68e91ec4ae71809c056151367991e11b
2018-01-09 20:20:43 +00:00
Treehugger Robot
3ec0dbf7d1 Merge "Revert "Allow callers of uevent_kernel_*() access to /proc/sys/kernel/overflowuid"" 2018-01-09 17:35:31 +00:00
Treehugger Robot
64a0f9288d Merge "Adding a traceur_app domain to remove it from shell" 2018-01-09 03:55:34 +00:00
Joel Galenson
d4a9d2c313 Merge "Update neverallow exception." am: 3680f835b9 am: 084d1cd753
am: 905d53c71f

Change-Id: I4174e730524cb161b745e23c60729e4b839a10a4
2018-01-08 21:35:31 +00:00
Luis Hector Chavez
7ae939e84b Revert "Allow callers of uevent_kernel_*() access to /proc/sys/kernel/overflowuid"
This reverts commit 640e595a68. The
corresponding code in libcutils was removed, so this is now unneeded.

Bug: 71632076
Test: aosp_sailfish still works

Change-Id: I615bab83e9a83bc14439b8ab90c00d3156b0a7c4
2018-01-08 13:09:34 -08:00
Joel Galenson
8d92a9a16c Update neverallow exception.
This fixes an incorrect exception in the neverallow rule.

Test: Built policy for all lunch targets.
Change-Id: I283833131c6f1fd741e934de24c838594ac38a18
2018-01-05 14:46:16 -08:00
Joel Galenson
8966bab5eb Merge "Revert "Update neverallow exception."" am: 70c21a6205 am: f810a0269e
am: 2c5e58f6d7

Change-Id: I138f26d2ddf6f4a06e53854141d5d7a29d982edd
2018-01-04 21:31:07 +00:00
Joel Galenson
70c21a6205 Merge "Revert "Update neverallow exception."" 2018-01-04 21:11:00 +00:00
Joel Galenson
9db566f0c5 Revert "Update neverallow exception."
This reverts commit b40eb255a7.

Change-Id: I04d9e76152ed11ada4cabcc79bb4eec827f8abef
2018-01-04 21:03:05 +00:00
Joel Galenson
aeacc1c8fb Merge "Update neverallow exception." am: 2de29263c4 am: 9519f1b9d3
am: 9a668680b8

Change-Id: I7af8a1f7712e7da94b80e2ef61aed85d2c015e3b
2018-01-04 20:18:14 +00:00