Commit graph

13181 commits

Author SHA1 Message Date
Tri Vo
30c3c2a85c Files under /vendor must have attribute vendor_file_type.
Label /vendor/etc/selinux/* as vendor_configs_file.

Bug: 62041836
Test: build system/sepolicy
Test: walleye boots
Change-Id: I617a3287860e965c282e9e82b4375ea68dbca785
2018-01-12 00:05:41 +00:00
Tom Cherry
1d2c3f4406 Merge "Add toolbox to vendor partition" 2018-01-11 23:50:46 +00:00
Tom Cherry
b7255bf2bf Add toolbox to vendor partition
Bug: 71861796
Test: no more denials on walleye for shell init scripts
Change-Id: I51eab267c95a915f927b0aaa7db9d678a83093c7
2018-01-11 12:53:09 -08:00
Holly Jiuyu Sun
193b1ab3da Merge "Add EuiccCardManager and EuiccCardController." 2018-01-11 20:44:33 +00:00
Holly Jiuyu Sun
d41ec0edeb Add EuiccCardManager and EuiccCardController.
Bug: 38206971
Test: test on phone
Change-Id: Id34ab2673c7a16744fba77eb5c176e2e8b474299
Merged-In: Id34ab2673c7a16744fba77eb5c176e2e8b474299
2018-01-11 10:32:47 -08: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
Treehugger Robot
70d2bb432a Merge "Whitelist exported platform properties" 2018-01-10 23:26:14 +00:00
Treehugger Robot
73b9d8d8d0 Merge "OWNERS: add Joel" 2018-01-10 19:29:40 +00:00
Treehugger Robot
be7b1b4f8e Merge changes I64b2f1ad,I9db561ee
* changes:
  vold_prepare_subdirs: grant chown
  statsd: annotate boot denials
2018-01-10 19:06:29 +00:00
Jeff Vander Stoep
2f2d8aba34 OWNERS: add Joel
Test: none
Change-Id: I42f2c2a09235d907b020c4924b91a3428f6c9d8e
2018-01-10 08:46:06 -08:00
Jeff Vander Stoep
bdbdb0f25f vold_prepare_subdirs: grant chown
Addresses:
avc: denied { chown } for comm="vold_prepare_su" capability=0
scontext=u:r:vold_prepare_subdirs:s0
tcontext=u:r:vold_prepare_subdirs:s0 tclass=capability

Bug: 71796118
Test: build
Change-Id: I64b2f1ad8d6e0748c5820b8a37a4fc4f4101d1fb
2018-01-10 08:37:42 -08:00
Jeff Vander Stoep
7986777913 statsd: annotate boot denials
Point logspam to its owner.

Bug: 71537285
Test: build
Change-Id: I9db561ee6f2857214b7945b312e6d303630724ea
2018-01-10 08:36:51 -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
yro
e27af27f8a Update statsd sepolicies to avoid selinux violations during cts tests
and pulling metrics

Bug: 63757906
Test: manual testing conducted
Change-Id: Ieba524ee676dfb4a457d39d025d203bf02a70831
2018-01-10 08:32:24 +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
yro
31b11d8ef8 Update priv_app selinux policy to allow gmscore to be able to
communicate with statsd

Test: manual testing conducted
Change-Id: Icd268e258f7cbdd9310baab53fe0c66f4f303d5e
2018-01-09 20:39:09 +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
Etan Cohen
fbb05ff0b4 Merge "[RTT] Update Wi-Fi RTT service name" 2018-01-09 14:42:41 +00:00
Treehugger Robot
64a0f9288d Merge "Adding a traceur_app domain to remove it from shell" 2018-01-09 03:55:34 +00:00
Tom Cherry
e1b73b141b Revert "Add /system/bin/getprop as toolbox_exec"
This reverts commit d711d4d20b.

Reason for revert: Shouldn't have submitted...

Change-Id: I5b88101f381ca59132ec7d24990ea41ac1b84171
2018-01-08 22:36:02 +00:00
Tom Cherry
d711d4d20b Add /system/bin/getprop as toolbox_exec
getprop is broken out from toolbox/toybox, however its permissions
should remain the same, so label it appropriately.

Bug: 36001741
Test: boot bullhead with the new getprop
Change-Id: I4114ea21998da95173d882038bc6aebf39b64d7f
2018-01-08 22:31:26 +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
Treehugger Robot
3680f835b9 Merge "Update neverallow exception." 2018-01-08 17:23:15 +00: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
Tom Cherry
060586362b Merge "Use property_info_checker instead of checkfc and fc_sort for properties" 2018-01-05 20:32:23 +00:00
Etan Cohen
33a4a0e4d3 [RTT] Update Wi-Fi RTT service name
Finalize Wi-Fi RTT service name per API review.

Note: CL 2 of 2 - removing old entry.

Bug: 65108607
Test: integration tests
Change-Id: Id2b3d91ea2ca578a5834a299275df188c68475da
2018-01-05 15:57:07 +00:00
Etan Cohen
a8d9191fb7 [RTT] Update Wi-Fi RTT service name
Finalize Wi-Fi RTT service name per API review.

Note: CL 1 of 2 - adding new entry here, will remove
old entry in next CL.

Bug: 65108607
Test: integration tests
Change-Id: I065ce9d570510180fa8c8f09e1025ac795706405
2018-01-05 15:56:58 +00:00
Chen Xu
fd9f7de71e Merge "Setting up SELinux policy for carrier id" 2018-01-04 21:56:13 +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
Treehugger Robot
2de29263c4 Merge "Update neverallow exception." 2018-01-04 20:03:09 +00:00
fionaxu
2cb8729614 Setting up SELinux policy for carrier id
Bug: 64131637
Test: Manual
Change-Id: I0170c5eb465aa663582e3974348380a8f0c9b27f
2018-01-04 19:15:45 +00:00
Tom Cherry
f68b4c67d7 Use property_info_checker instead of checkfc and fc_sort for properties
1) fc_sort is not needed as there is no reason to sort system
   properties, so this is removed and replaced with a simply copy
2) Use the new property_info_checker instead of checkfc for
   validating property information.  This supports exact match
   properties and will be extended to verify property schemas in the
   future.

Bug: 36001741
Test: verify bullhead's property contexts correct
Test: verify faulty property contexts result in failures
Change-Id: Id9bbf401f385206e6907449a510e3111424ce59e
2018-01-04 09:49:39 -08:00
Joel Galenson
b40eb255a7 Update neverallow exception.
After offline discussions, we decided that this was the proper
exception to the neverallow rule.

Test: Built policy.

Change-Id: Ic1603bfdd803151ccfb79f90195b83b616acc873
2018-01-04 09:36:58 -08:00
Treehugger Robot
0eb0a7bb5b Merge "Allow default drm hal to access allocator hal" 2018-01-04 04:12:19 +00:00
Jeff Tinker
e1a7190f51 Allow default drm hal to access allocator hal
This fixes failing vts drm tests

bug:67675811

Test:vts-tradefed run commandAndExit vts -m VtsHalDrmV1_0Target
Change-Id: I2f7e1c97e8c70fc312ca3c2c901f0a9607b05e83
2018-01-03 23:44:05 +00:00
Treehugger Robot
4dd97a0bb8 Merge "Add file context for keymaster 4.0 service." 2018-01-03 21:08:58 +00:00
Treehugger Robot
41b8271f22 Merge "Fix permission typo" 2018-01-03 19:43:32 +00:00
Shawn Willden
219c66c1f0 Add file context for keymaster 4.0 service.
Test: Boot the device
Change-Id: Ia468941e78803edebe311c73f424a41ac1faeaee
2018-01-03 10:56:06 -07:00
Jeff Vander Stoep
42d82b42ff Fix permission typo
zygote->webview_zygote.

Forgot to ammend local change.

Test: webview_zygote denials are gone.
Change-Id: I02869812feafd127b39e567c28e7278133770e97
2018-01-03 08:46:05 -08:00
Treehugger Robot
05916fca32 Merge "init: allow read of /sys/devices/virtual/block/zram" 2018-01-03 02:34:30 +00:00
Treehugger Robot
db68967551 Merge "webview_zygote: allow listing dirs in /system" 2018-01-03 00:33:37 +00:00
Jeff Vander Stoep
99c65df3ed init: allow read of /sys/devices/virtual/block/zram
Commit erroneously 55039509 removed init's read access to
/sys/devices/virtual/block/zram*. Restore access.

Test: cat /proc/meminfo
    ...
    SwapTotal:        524284 kB
    SwapFree:         524284 kB
    ...
Bug: 71510938

Change-Id: I20268168caa541a7dafa1e32339641095e1e524b
2018-01-03 00:26:57 +00:00
Max Bires
4ea5569f53 Adding a traceur_app domain to remove it from shell
This CL creates a traceur_app domain with userdebug privileges akin to
what shell has with regards to being able to find most services on
device. Previously, traceur was running as shell which was an
unintentional abuse of selinux architecture.

Bug: 68126425
Test: Traceur functions outside of shell user privilege
Change-Id: Ib5090e7e8225ad201b3ec24b506fe2717101d0f1
2018-01-02 15:29:03 -08:00
Jeff Vander Stoep
3588ddd06d webview_zygote: allow listing dirs in /system
For consistency with zygote, allow webview_zygote to list directories
in /system.

Test: Boot Taimen. Verify webiew_zygote denials during boot.
Bug: 70857705
Change-Id: I27eb18c377a5240d7430abf301c1c3af61704d59
2018-01-02 13:15:16 -08:00
Chenbo Feng
756dd574d5 sepolicy: Allow system server to r/w the bpf maps
The system server is responsible for providing the network traffic
stats to Apps and services. Allow it to directly reading the eBPF maps
that stored these information can make the process of getting traffic
stats simplier.

Test: No selinux rule violation of system server reading netd bpf object
Bug: 30950746
Change-Id: I6d9438d1ed7c9bab45a708f5d2a85eb22f5e8170
2018-01-02 11:52:33 -08:00
Chenbo Feng
08f92f9c01 sepolicy: New sepolicy classes and rules about bpf object
Add the new classes for eBPF map and program to limit the access to eBPF
object. Add corresponding rules to allow netd module initialize bpf
programs and maps, use the program and read/wirte to eBPF maps.

Test: no bpf sepolicy violations when device boot
Change-Id: I63c35cd60f1972d4fb36ef2408da8d5f2246f7fd
2018-01-02 11:52:33 -08:00
Chenbo Feng
254ad0da3a sepolicy: Allow mount cgroupv2 and bpf fs
Some necessary sepolicy rule changes for init process to create directory,
mount cgroupv2 module and mount bpf filesystem. Also allow netd to create
and pin bpf object as files and read it back from file under the
directory where bpf filesystem is mounted.

Test: bpf maps show up under /sys/fs/bpf/
Change-Id: I579d04f60d7e20bd800d970cd28cd39fda9d20a0
2018-01-02 11:52:33 -08:00
Ricky Wai
ff3b957e63 Add Network Watchlist data file selinux policy(Used in ConfigUpdater)
Bug: 63908748
Test: Able to boot
Change-Id: I14d8856d7aac7be9d1f26ecf5bfff69ea5ee9607
2018-01-02 18:16:46 +00:00
Treehugger Robot
2f39276e3f Merge "Sepolicy: Introduce perfprofd binder service" 2018-01-02 15:55:29 +00:00