Commit graph

2722 commits

Author SHA1 Message Date
Tri Vo
32d201709a Merge "dumpstate: remove access to 'proc' and 'sysfs' types." am: 0a2f862715 am: 1452e0a235
am: cf8a45eaf4

Change-Id: Ia07f01de94a598994b2e390c7c2316f1a9290aca
2018-01-23 21:11:18 +00:00
Tom Cherry
590dda5175 Merge "Allow vendor_init without compatible_property to write most properties" am: 873d6ad6fa am: d9957e5439
am: 4f809e771e

Change-Id: I5615b53ea29de37cfc3fae897d56fe967f76600c
2018-01-23 21:09:51 +00:00
Eino-Ville Talvala
972d9e46be Merge "Cameraserver: Allow shell user to use 'cmd media.camera'" am: 0a1c9a9447 am: be06ab0d80
am: 066ddee23c

Change-Id: I713b53287fedfd915bc80917fb38d3ee94049072
2018-01-23 21:09:32 +00:00
Dongwon Kang
1134bd001e Allow mediaextractor to load libraries from apk_data_file
This is an experimental feature only on userdebug and eng build.

Test: play MP4 file. install & uninstall media update apk.
Bug: 67908547
Change-Id: I513cdbfda962f00079e886b7a42f9928e81f6474
2018-01-23 11:21:11 -08:00
Marco Nelissen
e2f4140cef Allow scanning extractor library directory
so we can dlopen the libraries that are there

Test: build&run

Merged-Id: Ia1fa1fd65295cffe6c8a3d31db53bd3339a71855
Change-Id: Ia1fa1fd65295cffe6c8a3d31db53bd3339a71855
2018-01-23 11:21:11 -08:00
Yi Jin
bc24ba7283 Selinux permissions for incidentd project
Bug: 64222712
Test: manual
Change-Id: Ica77ae3c9e535eddac9fccf11710b0bcb3254ab3
2018-01-23 19:08:49 +00:00
Tri Vo
0a2f862715 Merge "dumpstate: remove access to 'proc' and 'sysfs' types." 2018-01-23 19:08:33 +00:00
Tom Cherry
873d6ad6fa Merge "Allow vendor_init without compatible_property to write most properties" 2018-01-23 18:34:34 +00:00
Andrew Scull
8d11ef5a37 Merge "authsecret HAL policies." 2018-01-23 17:43:59 +00:00
Jong Wook Kim
72030486c6 MAC Anonymization: wificond SIOCSIFHWADDR sepolicy
Add sepolicy rules to grant wificond permission to use SIOCSIFHWADDR
ioctl. This permission is needed to dynamically change MAC address of
the device when connecting to wifi networks.

Bug: 63905794
Test: Verified manually that wificond can dynamically change MAC
address.

Change-Id: If2c6b955b0b792f706d8438e8e2e018c0b4cfc31
2018-01-22 20:42:12 -08:00
Tri Vo
218d87c01c dumpstate: remove access to 'proc' and 'sysfs' types.
And grant appropriate permissions to more granular types.

Bug: 29319732
Bug: 65643247
Test: adb bugreport; no new denials to /proc or /sys files.

Change-Id: Ied99546164e79bfa6148822858c165177d3720a5
2018-01-23 03:24:37 +00:00
Eino-Ville Talvala
c41a7bd121 Cameraserver: Allow shell user to use 'cmd media.camera'
Test: atest cts/tests/camera/src/android/hardware/camera2/cts/IdleUidTest.java
Change-Id: Id9adcec4db2e55f2e41ebd1b018ebc40aa0be404
2018-01-22 17:10:12 -08:00
Max Bires
acc900f92f Adding write permissions to traceur am: 35c363897d am: ca824eb278
am: 311c3e1df1

Change-Id: Id3e056483b4726a2765869d0f4f46c093c3937ef
2018-01-23 00:29:28 +00:00
Max Bires
35c363897d Adding write permissions to traceur
Fixing denials that stopped traceur from being able to write to
debugfs_tracing. Also cleaning up general find denials for services that
traceur doesn't have permission to access.

Additionally, labeling /data/local/trace as a trace_data_file in order
to give traceur a UX friendly area to write its traces to now that it
will no longer be a shell user. It will be write/readable by traceur,
and deletable/readable by shell.

Test: Traceur functionality is not being blocked by selinux policy
Bug: 68126425
Change-Id: I201c82975a31094102e90bc81454d3c2a48fae36
2018-01-22 21:06:36 +00:00
Paul Crowley
32611bc969 Merge "Allow access to the metadata partition for metadata encryption." am: 68e31786f0 am: b263aa0093
am: ed14826159

Change-Id: I8e4a46622189d926452134b62a29909169b76b41
2018-01-22 20:19:51 +00:00
Tom Cherry
6473ae8307 Allow vendor_init without compatible_property to write most properties
These property sets will be long term restricted with
compatible_property but allowing them now eases the transition.

Bug: 62875318
Test: boot marlin without audits for setprop in vendor_init
Change-Id: I25ab565bbf137e382c1dfc3b905b38403645f1d2
2018-01-22 19:11:54 +00:00
Paul Crowley
68e31786f0 Merge "Allow access to the metadata partition for metadata encryption." 2018-01-22 18:30:08 +00:00
Badhri Jagan Sridharan
fad103c409 usbd sepolicy am: 4f6eb37f6c am: df3a47eb0d
am: 6e0c52cb6f

Change-Id: Id0f8406c9aa494a8047acd7d8f69e7a9ae721b7f
2018-01-20 03:52:48 +00:00
Badhri Jagan Sridharan
4f6eb37f6c usbd sepolicy
Sepolicy for the usb daemon. (ag/3373886/)

Bug: 63669128
Test: Checked for avc denial messages.
Change-Id: I6e2a4ccf597750c47e1ea90c4d43581de4afa4af
2018-01-20 03:41:21 +00:00
Tri Vo
1ec780732d Remove proc and sysfs access from system_app and platform_app. am: 06d7dca4a1 am: 32205bc52a
am: 0e1770d76b

Change-Id: I30e7650a7468a76075f227d2c3edca08ae046097
2018-01-20 01:46:10 +00:00
Tri Vo
06d7dca4a1 Remove proc and sysfs access from system_app and platform_app.
Bug: 65643247
Test: manual
Test: browse internet
Test: take a picture
Change-Id: I9faff44b7a025c7422404d777113e40842ea26dd
2018-01-20 01:05:21 +00:00
Tao Bao
8ce35f8b3c Add rules for system_update service. am: d7d9cfcad2 am: 3337069241
am: 191f290b2f

Change-Id: I4059dfd1c18eb2530ab4c44a55e649ff782f8ffc
2018-01-19 23:49:10 +00:00
Tao Bao
d7d9cfcad2 Add rules for system_update service.
system_update service manages system update information: system updater
(priv_app) publishes the pending system update info through the service,
while other apps can read the info accordingly (design doc in
go/pi-ota-platform-api).

This CL adds the service type, and grants priv_app to access the service.

Bug: 67437079
Test: Build and flash marlin image. The system_update service works.
Change-Id: I7a3eaee3ecd3e2e16b410413e917ec603566b375
2018-01-19 15:03:21 -08:00
Paul Crowley
ab318e30d3 Allow access to the metadata partition for metadata encryption.
Bug: 63927601
Test: Enable metadata encryption in fstab on Taimen, check boot success.
Change-Id: Id425c47d48f413d6ea44ed170835a52d0af39f9f
2018-01-19 14:45:08 -08:00
Treehugger Robot
38adc92797 Merge "hal_usb_gadget sepolicy" 2018-01-19 21:41:00 +00:00
Svet Ganov
f2dc91378f Merge "No camera for idle uids - selinux" am: 43ef5f21f1 am: 46358bcc26
am: 861c05c428

Change-Id: I2d1ec0c12ccf8d9e9b9360f7c08661cb633fccaf
2018-01-19 19:13:48 +00:00
Treehugger Robot
43ef5f21f1 Merge "No camera for idle uids - selinux" 2018-01-19 19:01:22 +00:00
Badhri Jagan Sridharan
7bee33e665 hal_usb_gadget sepolicy
Bug: 63669128
Test: Checked for avc denail messages.
Change-Id: I057b3cf9ccc945cb943b9cf60fc9cd6c023eddda
Merged-In: I057b3cf9ccc945cb943b9cf60fc9cd6c023eddda
2018-01-19 18:56:16 +00:00
Badhri Jagan Sridharan
46c3fd984c Merge "hal_usb_gadget sepolicy" 2018-01-19 18:52:57 +00:00
Tri Vo
a1cdb11090 Merge "Coredomain can't execute vendor code." am: 0338f7db2d am: 26d3836acc
am: 49cf8918c4

Change-Id: I14e3180a620dc2b8efe4eb38699d4614c6034573
2018-01-19 18:03:40 +00:00
Tri Vo
0338f7db2d Merge "Coredomain can't execute vendor code." 2018-01-19 17:47:33 +00:00
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
Tri Vo
e26da71344 Coredomain can't execute vendor code.
Bug: 62041836
Test: policies for internal devices build successfully

Change-Id: I6856c0ab9975210efd5b4bed17c103ba3364d1ab
2018-01-17 16:18:11 -08: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
Svet Ganov
9139ea1b2a No camera for idle uids - selinux
If a UID is idle (being in the background for more than
cartain amount of time) it should not be able to use the
camera. If the UID becomes idle we generate an eror and
close the cameras for this UID. If an app in an idle UID
tries to use the camera we immediately generate an error.
Since apps already should handle these errors it is safe
to apply this policy to all apps to protect user privacy.

Test: Pass - cts-tradefed run cts -m CtsCameraTestCases
      Added - CameraTest#testCameraAccessForIdleUid

Change-Id: I9ab3d6ec99764a93638746f18912ed60d299015f
2018-01-15 16:12:06 -08: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
Andrew Scull
1aedf4b5f8 authsecret HAL policies.
Bug: 71527305
Test: compile and boot
Change-Id: I91097bd62d99b8dd9eb6f53060badbaf0f4b8b4a
2018-01-10 16:26:44 +00: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
Treehugger Robot
2de29263c4 Merge "Update neverallow exception." 2018-01-04 20:03:09 +00: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
Jeff Vander Stoep
91266c00be Merge "init: allow read of /sys/devices/virtual/block/zram" am: 05916fca32 am: 6df91b7217
am: 8bd43abf06

Change-Id: I097125bcaf96fe6511bf9e36d3dbbefc9bf70e35
2018-01-03 02:46:18 +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
Chenbo Feng
2685846544 sepolicy: New sepolicy classes and rules about bpf object am: 08f92f9c01 am: 7daa05f138
am: 6a0d591368

Change-Id: I9015bafe7d00d6a1e82a7c13611726df90d3a41c
2018-01-02 22:12:13 +00:00
Chenbo Feng
7921ff073b sepolicy: Allow mount cgroupv2 and bpf fs am: 254ad0da3a am: 956e099ec6
am: 13c3ed2836

Change-Id: I5a753a23f0b03d7d8db14337efd6ea970a90a38b
2018-01-02 22:12:04 +00: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
7494cc133c Add Network Watchlist data file selinux policy(Used in ConfigUpdater) am: ff3b957e63 am: 56a9edb19e
am: a70a3ca0ba

Change-Id: I208790e37ba208f72b02a5caf595d84b34dd8cb2
2018-01-02 18:29:22 +00: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
Andreas Gampe
ee80a1038a Merge "Sepolicy: Introduce perfprofd binder service" am: 2f39276e3f am: d695693d86
am: b4d216d6be

Change-Id: I73505db59fbb5fc0a75f98ebc7499e82ce12534d
2018-01-02 16:07:03 +00:00
Andreas Gampe
aa9711f82b Sepolicy: Introduce perfprofd binder service
Add policy for the perfprofd binder service.

For now, only allow su to talk to it.

Test: m
Change-Id: I690f75460bf513cb326314cce633fa25453515d6
2017-12-28 17:31:21 -08:00
Steven Moreland
4c57d6f661 Merge "Remove sys/class/leds permissions from dumpstate." am: 0b6856f59b am: f3bf89c682
am: 47eecb4c32

Change-Id: I2bfd54c68c26d393a80ee1ee0e2e00854f488999
2017-12-22 22:02:23 +00:00
Treehugger Robot
0b6856f59b Merge "Remove sys/class/leds permissions from dumpstate." 2017-12-22 21:47:01 +00:00
Steven Moreland
a00b74196e Remove sys/class/leds permissions from dumpstate.
These are device specific.

Bug: 70846424
Test: bugreport
Change-Id: Ic22c972f1b09988a8eccf0823dd0d87fc0c0a1f7
2017-12-22 21:46:34 +00:00
Jeffrey Vander Stoep
678082147d Revert "Audit app access to /proc/net/*"
This reverts commit 84f9685972.

Fixes: 70874565
Reason for revert: massive logspam during phone calls.

Change-Id: If00e46535f71209eea999e4d5d499bf40a5f16fd
2017-12-21 20:05:26 -08:00
Joel Galenson
df80940892 Merge "Disallow most coredomains from accessing vendor_files on Treble." am: 6168a12ea9 am: ea3942f0a7
am: 6771dc79ef

Change-Id: Ic563be5ceca453ec9a7489ca462f240bfd0b03c3
2017-12-21 20:56:56 +00:00
Joel Galenson
52e11be07a Disallow most coredomains from accessing vendor_files on Treble.
Test: Built the policy for many devices.
Change-Id: Ic61023dc2d597865504d1a4bc955bd1bc973f83c
2017-12-20 10:05:35 -08:00
Treehugger Robot
d4bb9b7342 Merge "app: move appdomain to public policy" 2017-12-20 17:49:31 +00:00
Tri Vo
298e188b36 Merge "init: tighten sysfs_type permissions" am: 021344cc51 am: 677a6b2ecc
am: ea687901d0

Change-Id: Ic8c50bf2ed16b33acdea8a44ae944c9b6a50f6ae
2017-12-20 17:21:37 +00:00
Tri Vo
021344cc51 Merge "init: tighten sysfs_type permissions" 2017-12-20 17:11:10 +00:00
Jeff Vander Stoep
77b290f303 app: move appdomain to public policy
Vendor-specific app domains depend on the rules in app.te so they
must reside in public policy.

Bug: 70517907
Test: build
Change-Id: If45557a5732a06f78c752779a8182e053beb25a2
Merged-In: If45557a5732a06f78c752779a8182e053beb25a2
(cherry picked from commit 1f4cab8bd4)
2017-12-19 21:31:01 -08:00
Jeffrey Vander Stoep
8cba16480a Merge "app: move appdomain to public policy" 2017-12-20 05:20:14 +00:00
Tony Mak
215fb3efe4 Add selinux policy for CrossProfileAppsService
CrossProfileAppsService allows apps to do limited cross profile
operations, like checking the caller package is installed in
the specified user. It is similar to LauncherAppsService in some sense.

Merged-In: I26e383a57c32c4dc9b779752b20000b283a5bfdc
Change-Id: I26e383a57c32c4dc9b779752b20000b283a5bfdc
Fix: 67765768
Test: Built with ag/3063260. Can boot and verified those APIs are working.
(cherry picked from commit 6536c9e092)
2017-12-20 09:42:37 +09:00
Tri Vo
55039509fd init: tighten sysfs_type permissions
Removes open, read, setattr permissions to sysfs_type.
Adds explicit permissions to:
sysfs_dt_firmware_android
sysfs_vibrator
sysfs_wake_lock

Bug: 65643247
Test: walleye boots without denials to sysfs_type.
Change-Id: I2e344831655c2c8e8e48b07ecce6a2704f2a206a
2017-12-19 16:17:42 -08:00
yro
f10ff7df29 Setting up SELinux policy for statsd and stats service am: 2970845577 am: c9bfbc1686
am: e63570c375

Change-Id: Ia2aaaec0f28a94ff697acb3185d6717c6287247a
2017-12-19 19:31:17 +00:00
Jeff Vander Stoep
1f4cab8bd4 app: move appdomain to public policy
Vendor-specific app domains depend on the rules in app.te so they
must reside in public policy.

Bug: 70517907
Test: build
Change-Id: If45557a5732a06f78c752779a8182e053beb25a2
2017-12-19 08:19:52 -08:00
yro
2970845577 Setting up SELinux policy for statsd and stats service
Bug: 63757906
Test: manual testing conducted
Change-Id: Id03413ce82b5646d4bceddc59e16c7d5ee5bc193
2017-12-19 01:41:48 +00:00
Tri Vo
a4bb05fdbe Merge "perfprofd: allow traversing sysfs directories." am: b73cd9f8df am: 2ee1a51c3c
am: 9ee60ea4a7

Change-Id: Id96db4ee34885791e183af2a09f9fb9244ff626a
2017-12-19 01:19:21 +00:00
xshu
96b44bec14 Wifi hal - Firmware dump permissions am: 6ad3c891bc am: 40868b952e
am: 5a90141fbd

Change-Id: I62223088adf7681ba868822efe43264c8fc4c987
2017-12-19 01:04:51 +00:00
Treehugger Robot
b73cd9f8df Merge "perfprofd: allow traversing sysfs directories." 2017-12-19 01:04:17 +00:00
xshu
6ad3c891bc Wifi hal - Firmware dump permissions
we are aiming to improve logging performance by having wifi hal
directly write to the flash.

Wifi hal need to be able to create, write, and delete files in
a directory. This will be restricted to userdebug and eng builds only.

Bug: 70170285
Test: compile, run on device
Change-Id: Id0cd317411f4c393d7529aa31b501046d7350edb
2017-12-18 13:11:02 -08:00
TreeHugger Robot
58bf871783 Merge "Audit app access to /proc/net/*" 2017-12-18 15:15:19 +00:00
Howard Ro
08cc57a515 Revert "Setting up SELinux policy for statsd and stats service" am: d496ea7a61 am: 744e67d7e6
am: 02ca42e1e2

Change-Id: Ib26d526c4de4c80624c1c6d81b5f0952d34b9dae
2017-12-16 02:33:44 +00:00
Howard Ro
d496ea7a61 Revert "Setting up SELinux policy for statsd and stats service"
This reverts commit 5744cbdf8d.

Reason for revert: aosp_dragon-userdebug build broken

Change-Id: I5f8180273c32119ae9839f31610bbca37cd05c65
2017-12-16 02:22:23 +00:00
yro
94dc32ed91 Setting up SELinux policy for statsd and stats service am: 5744cbdf8d am: da67945df9
am: 3d444093c9

Change-Id: I3a9fcc11509f6814ca594a1d619b291ed89a95fc
2017-12-16 01:51:34 +00:00
yro
5744cbdf8d Setting up SELinux policy for statsd and stats service
Test: manual testing conducted see if it interfere's with AOSP

Change-Id: If47a663557b2ebf825fc082edb838ae085ec66b3
2017-12-16 01:40:45 +00:00
Jeff Vander Stoep
84f9685972 Audit app access to /proc/net/*
Many processes including third party apps are expected to
access /proc/net/xt_qtaguid/stats. Give this file a new label
to avoid spamming the logs and temporarily grant read access to
all processes.

Read-only permission is adequate for all processes based on unix
permissions.
sailfish:/ # ls -laZ /proc/net/xt_qtaguid/stats
-r--r--r--  1 root net_bw_stats u:object_r:proc_net_xt_qtaguid_stats:s0 stats

Bug: 9496886
Bug: 68016944
Bug: 70722355
Test: Build/flash Sailfish. Browse in Chrome and watch videos in youtube.
    No "denied" or "granted" selinux messages observed in the logs.

Change-Id: I29f1ee806c8149988b9b93a950790d14754927ef
2017-12-15 16:34:39 -08:00
Tri Vo
ae20791517 perfprofd: allow traversing sysfs directories.
Bug: 70275668
Test: walleye builds, boots.
This change only expands the existing permissions, so shouldn't regress
runtime behavior.
Change-Id: I36e63f11d78998a88e3f8d1e6913e20762a359af
2017-12-14 00:00:17 +00:00
Marissa Wall
15ba57cce6 Merge "Restrict access to uid_concurrent_*_time" am: 40ed4283e4 am: 5b17322a87
am: 3337c82e7c

Change-Id: Id7dba03c422e4f9a2d094c7b26a773ababe2ab47
2017-12-13 20:27:09 +00:00
Treehugger Robot
40ed4283e4 Merge "Restrict access to uid_concurrent_*_time" 2017-12-13 19:48:47 +00:00
Tom Cherry
cd76b8eb0e Add /dev/__properties__/property_info am: 8b5433a9cc am: c878b4c56a
am: c456286e3c

Change-Id: I73b279fa3f57c321ed39d4b494e413fe2dda900b
2017-12-13 02:55:17 +00:00
Tom Cherry
8b5433a9cc Add /dev/__properties__/property_info
Allow init to create a serialized property_info file and allow all
processes to read it.

Bug: 36001741
Test: boot bullhead, walleye using property_info

Change-Id: Ie51d4c0f0221b128dd087029c811fda15b4d7093
2017-12-13 01:28:15 +00:00
Tri Vo
5765af8ae5 Merge "Remove access to 'sysfs' files from healtd and charger." am: 1fc08a299c am: b10d2964b3
am: 3107b53241

Change-Id: I0ead6aa1ad9faef9034c709b39b739ff7361b888
2017-12-13 00:06:32 +00:00
Tri Vo
e9e17a0180 Merge "shell: directory access to sysfs_net" am: 5b8d279fcd am: cd06968498
am: 049bf53a11

Change-Id: I1dabdfe296398c03e808bbaf997425def1c6af95
2017-12-13 00:05:32 +00:00
Treehugger Robot
1fc08a299c Merge "Remove access to 'sysfs' files from healtd and charger." 2017-12-12 23:18:08 +00:00
Marissa Wall
80ee23f74a Restrict access to uid_concurrent_*_time
Do not let apps read uid_concurrent_active_time and
uid_concurrent_policy_time.

b/68399339

Test: Check that they can't be read from the shell
    without root permissions and system_server was able
    to read them

Change-Id: I6f09ef608607cb9f4084ba403a1e7254b8c49a06
2017-12-12 19:19:04 +00:00
Tri Vo
f34e592984 shell: directory access to sysfs_net
This will allow bionic cts test to list network interfaces in
/sys/class/net.

Bug: 70537905
Test: adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
--gtest_filter=ifaddrs.getifaddrs_interfaces
Change-Id: Ie07425fc54f9101e911962142824697e64d2bc45
2017-12-12 09:41:13 -08:00
Jeff Vander Stoep
a55f2361a9 Restore recovery's ability to format cache and preserve logs am: 87dd195b78 am: f8fe149f47
am: cf4f3a2e62

Change-Id: I4fc382127fa5c9c3ba14f456383ae44a1de4f28a
2017-12-11 20:55:11 +00:00
Jeff Vander Stoep
87dd195b78 Restore recovery's ability to format cache and preserve logs
Commit b8b4f5d6 'Clean up old file-based OTA SELinux rules' removed
many permissions from recovery, a few of which are still required.
Restore these.

[ 2918.409108] type=1400 audit(2327427.540:159): avc:  denied
{ search } for  pid=339 comm="recovery" name="/" dev="mmcblk0p38"
ino=2 scontext=u:r:recovery:s0 tcontext=u:object_r:unlabeled:s0
tclass=dir permissive=0
[ 2586.563071] E:Failed to mount / create /cache/recovery: Permission
denied
[ 2586.780320] E:Can't open /cache/recovery/log: Permission denied
[ 2586.850399] E:Can't open /cache/recovery/last_log: Permission
denied
[ 2586.918979] E:Can't open /cache/recovery/last_install: Permission
denied

[   54.035867] type=1400 audit(59206654.526:12): avc:  denied  { chown }
for  pid=330 comm="recovery" capability=0  scontext=u:r:recovery:s0
tcontext=u:r:recovery:s0 tclass=capability permissive=0a

Bug: 70350029
Test: xunchang to test
Change-Id: I46ab049b8eb600b44c84a61777fade150cadd197
2017-12-11 09:38:14 -08:00
Tri Vo
d276b4349d Remove access to 'sysfs' files from healtd and charger.
We rely on vendors to label all dependencies of healthd/charger under
/sys/class/power_supply with sysfs_batteryinfo type.

Bug: 65643247
Bug: 32659667
Test: boots without denials from healthd, to sysfs_batteryinfo or to
sysfs_msm_subsys.
Test: charging with device turned off works without /sys denials.

Change-Id: I893f309ecad8a0caf7d0b81f5f945725907255c2
2017-12-11 16:31:24 +00:00
Andreas Gampe
36ca6bfc16 Merge "Sepolicy: Update rules for perfprofd" am: 7e1d3882bc am: d9ecc4cac3
am: 10201a1088

Change-Id: I8d8b9453c7a9cd44476d9e714afd65802d5b60b3
2017-12-09 20:43:09 +00:00
Andreas Gampe
e40d676058 Sepolicy: Update rules for perfprofd
Follow along with updates in the selinux policy.

Test: m
Test: manual
Change-Id: I0dfc6af8fbfc9c8b6860490ab16f02a220d41915
2017-12-08 15:21:09 -08:00
Andreas Gampe
a1390f8b2e Merge "Sepolicy: Give perfprofd access to kernel notes" am: f691b12732 am: 73fa36c3c6
am: 3f09245e28

Change-Id: I762af70bd56fea212d4e7a5cf2f0651636065e86
2017-12-08 00:22:53 +00:00
Andreas Gampe
89e02ed37b Merge "Sepolicy: Label kernel notes" am: 1d7fcdd59a am: aee0b123b7
am: 5059b423aa

Change-Id: I4665e89aba12c2a357317f2325ed60c9bfa89773
2017-12-08 00:22:26 +00:00
Andreas Gampe
cf9fd376c8 Merge "Sepolicy: Silence /data/local/tmp access of perfprofd" am: 61f5f287ba am: 95e3e7c54c
am: ae49e57410

Change-Id: Ibca867da2a61e2fb03c8b5b5915a587ba7b732ab
2017-12-07 06:02:27 +00:00
Josh Gao
824201ae40 crash_dump: allow reading from pipes. am: 914a7fb95a am: d7ff4d0b6b
am: ccb67ab8a1

Change-Id: I90783362474e7c695f01aeba869d38add010a954
2017-12-07 06:00:55 +00:00
Tri Vo
9d056a3ba0 Merge "init: remove open, read, write access to 'sysfs' type." am: 9b2dc9cfbb am: 3ed2877372
am: a7f988d041

Change-Id: Icefed59964c5f26c35f80b3828f52e209fe1f009
2017-12-07 06:00:25 +00:00
Treehugger Robot
f691b12732 Merge "Sepolicy: Give perfprofd access to kernel notes" 2017-12-07 00:13:50 +00:00
Treehugger Robot
1d7fcdd59a Merge "Sepolicy: Label kernel notes" 2017-12-07 00:09:25 +00:00
Xin Li
91690c904c Merge "DO NOT MERGE: Merge Oreo MR1 into master" 2017-12-06 23:18:28 +00:00
Andreas Gampe
365dd03cb1 Sepolicy: Give perfprofd access to kernel notes
Simpleperf reads kernel notes.

Bug: 70275668
Test: m
Test: manual
Change-Id: I1a2403c959464586bd52f0398ece0f02e3980fc4
2017-12-06 13:55:06 -08:00
Andreas Gampe
9213fe0217 Sepolicy: Label kernel notes
Label /sys/kernel/notes.

Bug: 70275668
Test: m
Change-Id: Ieb666425d2db13f85225fb902fe06b0bf2335bef
2017-12-06 13:55:06 -08:00
Andreas Gampe
95e3e7c54c Merge "Sepolicy: Silence /data/local/tmp access of perfprofd"
am: 61f5f287ba

Change-Id: I1761f3cd95aaf054414be37b81338e4662906aca
2017-12-06 21:39:44 +00:00
Josh Gao
d7ff4d0b6b crash_dump: allow reading from pipes.
am: 914a7fb95a

Change-Id: I053ba4143c225fc471c6c70afdcc0ce284060f69
2017-12-06 21:39:10 +00:00
Treehugger Robot
61f5f287ba Merge "Sepolicy: Silence /data/local/tmp access of perfprofd" 2017-12-06 21:31:30 +00:00
Josh Gao
914a7fb95a crash_dump: allow reading from pipes.
Bug: http://b/63989615
Test: mma
Change-Id: I41506ecb0400867230502181c1aad7e51ce16d70
2017-12-06 11:05:54 -08:00
Tri Vo
3ed2877372 Merge "init: remove open, read, write access to 'sysfs' type."
am: 9b2dc9cfbb

Change-Id: I1921ca6c85e74935686d10918f0b0fb616e78ace
2017-12-06 19:05:42 +00:00
Treehugger Robot
9b2dc9cfbb Merge "init: remove open, read, write access to 'sysfs' type." 2017-12-06 18:51:09 +00:00
Andreas Gampe
ec5bcd70b0 Sepolicy: Silence /data/local/tmp access of perfprofd
Until simpleperf does not optimistically try /data/local/tmp for
tmp storage, silence the denials.

Bug: 70232908
Test: m
Test: manual
Change-Id: Icbc230dbfbfa6493b4e494185c536a10e3b0ae7b
2017-12-06 10:19:39 -08:00
Tri Vo
0e3235f45d init: remove open, read, write access to 'sysfs' type.
Add write access to:
sysfs_android_usb
sysfs_leds
sysfs_power
sysfs_zram

Add setattr access to:
sysfs_android_usb
sysfs_devices_system_cpu
sysfs_lowmemorykiller
sysfs_power
sysfs_leds
sysfs_ipv4

Bug: 70040773
Bug: 65643247
Change-Id: I68e2e796f5599c9d281897759c8d8eef9363559a
Test: walleye boots with no denials from init to sysfs.
2017-12-06 17:00:59 +00:00
Jason Monk
b1d216387b Add selinux for slice service am: 07131ec803 am: 4021886a4f
am: b8c732d3f7

Change-Id: I6e90eb78684a3483b17e02e0aea1da7fa6f6a4cf
2017-12-05 20:48:25 +00:00
Jason Monk
4021886a4f Add selinux for slice service
am: 07131ec803

Change-Id: Id52c9d602fd05e07d79b39b78c164015eab888b0
2017-12-05 20:23:19 +00:00
Jason Monk
07131ec803 Add selinux for slice service
Test: make/sync
Bug: 68751119
Change-Id: Ie3c60ff68b563cef07f20d15f298d6b62e9356bc
2017-12-05 11:26:08 -05:00
rickywai
43fc504d2c Merge "Add network watchlist service SELinux policy rules" am: e2c271834b am: 2a57b35f91
am: 9e9fc44ad7

Change-Id: Ia7eebb316512b3f6d85241650133c5b1b0641c33
2017-12-04 08:41:07 +00:00
rickywai
2a57b35f91 Merge "Add network watchlist service SELinux policy rules"
am: e2c271834b

Change-Id: If5386ad857ccffa44be29545283e3ee792503572
2017-12-04 08:35:01 +00:00
rickywai
e2c271834b Merge "Add network watchlist service SELinux policy rules" 2017-12-04 08:30:49 +00:00
Tri Vo
45b3625922 Revert "init: remove open, read, write access to 'sysfs' type." am: 423d14bfa1 am: 996487ceda
am: 16462878b2

Change-Id: I6cf0335743030dc5f1932b5934cea72194a41cde
2017-12-01 23:04:44 +00:00
Tri Vo
996487ceda Revert "init: remove open, read, write access to 'sysfs' type."
am: 423d14bfa1

Change-Id: I0cdadf49d68b77c7c6b93738deea4a1e72bc41a3
2017-12-01 22:59:14 +00:00
Tri Vo
423d14bfa1 Revert "init: remove open, read, write access to 'sysfs' type."
This reverts commit c2241a8d16.

Reason for revert: build breakage b/70040773

Change-Id: I6af098ae20c4771a1070800d02c98e5783999a39
2017-12-01 22:31:01 +00:00
Tri Vo
2a9ce73491 init: remove open, read, write access to 'sysfs' type. am: c2241a8d16 am: 317d6b4da2
am: 8f8c0d3b44

Change-Id: Iec602150ddbab0a46c9cc8685eeab64696574070
2017-12-01 19:22:59 +00:00
Tri Vo
317d6b4da2 init: remove open, read, write access to 'sysfs' type.
am: c2241a8d16

Change-Id: I4178c482a6b1241bedbadea1aa721c7b08ae8cb3
2017-12-01 19:18:24 +00:00
Tri Vo
c2241a8d16 init: remove open, read, write access to 'sysfs' type.
Add write access to:
sysfs_android_usb
sysfs_leds
sysfs_power
sysfs_zram

Add setattr access to:
sysfs_android_usb
sysfs_devices_system_cpu
sysfs_lowmemorykiller
sysfs_power
sysfs_leds
sysfs_ipv4

Bug: 65643247
Test: walleye boots with no denials from init to sysfs.

Change-Id: Ibc9a54a5f43f3d53ab7cbb0fdb9589959b31ebde
2017-12-01 19:13:11 +00:00
Joel Galenson
a9601ddd09 Merge "Allow init to create /dev/event-log-tags." am: cea60d7eb5 am: 54d044c12e
am: c8956ea389

Change-Id: I33d6b8706dad92aacd2b68a8589d2cf3d41a05f4
2017-12-01 16:59:25 +00:00
Joel Galenson
54d044c12e Merge "Allow init to create /dev/event-log-tags."
am: cea60d7eb5

Change-Id: I9c0195571c616525fe8daaefc76661d111a57917
2017-12-01 16:52:07 +00:00
Treehugger Robot
cea60d7eb5 Merge "Allow init to create /dev/event-log-tags." 2017-12-01 16:47:10 +00:00
Joel Galenson
0975d73010 Allow init to create /dev/event-log-tags.
Now that creating a symlink automatically sets its context,
init needs permission to create this file.

Bug: 69965807
Test: Booted device and tested wifi and camera.
Change-Id: I41f5ca8f4d877312c9b2a909001fe9cd80c3d458
2017-11-30 15:38:19 -08:00
Ricky Wai
c63529735a Add network watchlist service SELinux policy rules
Bug: 63908748
Test: built, flashed, able to boot
Change-Id: I3cfead1d687112b5f8cd485c8f84083c566fbce2
2017-11-30 15:53:19 +00:00
Tri Vo
3c0a52076f Label /proc/sys/kernel/pid_max as proc_pid_max. am: 4081fd3993 am: ab35e4343b
am: a7351f93f7

Change-Id: Ifee5631ffbb9842f01683612da012286efcfaf5a
2017-11-28 19:19:06 +00:00
Tri Vo
ab35e4343b Label /proc/sys/kernel/pid_max as proc_pid_max.
am: 4081fd3993

Change-Id: Iffd1f51451929b92898fd65da600b6259f85a50e
2017-11-28 18:49:56 +00:00
Tri Vo
4081fd3993 Label /proc/sys/kernel/pid_max as proc_pid_max.
And give shell domain read access to /proc/sys/kernel/pic_max.

Bug: 69569397
Test: adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
--gtest_filter=pthread.pthread_mutex_owner_tid_limit
Change-Id: Ib56c18ed553ad2c2113e6913788a4c00965483cc
2017-11-28 08:42:46 -08:00
Nick Kralevich
45e2cb3741 Clean up old file-based OTA SELinux rules am: b8b4f5d649 am: 6cb6dc8431
am: 55509e91bd

Change-Id: Ic0809700a38f95ed8975b1770b6d430538f13163
2017-11-27 19:00:30 +00:00
Nick Kralevich
6cb6dc8431 Clean up old file-based OTA SELinux rules
am: b8b4f5d649

Change-Id: I68d5ca0bf61c25e54f8d6a6aa77a326c3c0d67bf
2017-11-27 18:53:57 +00:00
Nick Kralevich
b8b4f5d649 Clean up old file-based OTA SELinux rules
Remove a number of SELinux rules which were required to support file
based OTA. After this, we can have a much stronger assertion that files
on /system are immutable. Tighten up the neverallow rules at the same
time.

Bug: 35853185
Bug: 15575013
Bug: 69664758
Test: adb reboot recovery && adb sideload [file]
Change-Id: I22aa208859b8478a2a90e1ed1c0f0d6b62a6664e
2017-11-27 09:01:36 -08:00
TreeHugger Robot
a4eea616d3 Merge "Move platform/vendor data violations to device policy" 2017-11-22 18:27:37 +00:00
Nick Kralevich
b7d018b189 Revert "Clean up old file-based OTA SELinux rules" am: b6a05a93c1 am: 8929a1a98f
am: f4bc3a48be

Change-Id: Iae58c14d8ed1011629316302ecad23a2dee116ae
2017-11-22 17:43:38 +00:00
Nick Kralevich
8929a1a98f Revert "Clean up old file-based OTA SELinux rules"
am: b6a05a93c1

Change-Id: I827b6604f6eed56749e71c6e3451d8693f274bdc
2017-11-22 17:37:50 +00:00
Jeff Vander Stoep
5b557888dd Move platform/vendor data violations to device policy
Sharing data folders by path will be disallowed because it violates
the approved API between platform and vendor components tested by
VTS. Move all violating permissions from core selinux policy to
device specific policy so that we can exempt existing devices from
the ban and enforce it on new devices.

Bug: 34980020
Test: Move permissions. Build and test wifi, wifi AP, nfc, fingerprint
    and Play movies on Marlin and Taimen.
Test: build on Angler, Bullhead, Dragon, Fugu, Marlin, Walleye

(cherry picked from commit ba2130a882)

Change-Id: Iaedbbe31237822cf3348209028bba45ad85465f8
2017-11-22 08:59:08 -08:00
Nick Kralevich
b6a05a93c1 Revert "Clean up old file-based OTA SELinux rules"
Self sideload OTA installation is aborted in #PPR1.171122.001.
Likely cause is the removal of the file-based OTA rules. Revert
the change while I investigate.

This reverts commit 7388575591.

Bug: 35853185
Bug: 69664758
Bug: 15575013

Change-Id: I65ca3bad7251f06df33eae8b2d4bcfada93ae9b8
2017-11-22 14:56:01 +00:00
Michael Wright
d8b864cb41 Revert "Move platform/vendor data violations to device policy"
This reverts commit ba2130a882.

Test: lunch elfin-userdebug && m -j
Change-Id: I83e8a37cac97e2f994fd2defb94888ec73b41f3b
2017-11-22 13:59:40 +00:00
Jeff Vander Stoep
6828bb1db4 Fix CTS regressions am: 6a28b68d54 am: 7dc46564d0
am: d5931d9773

Change-Id: Ic4eb8ed411864915d479c8a520a14119c818f196
2017-11-22 05:04:04 +00:00
Jeff Vander Stoep
7dc46564d0 Fix CTS regressions
am: 6a28b68d54

Change-Id: I774787b48c0b5f6f20313ee6f9c8062db4072e84
2017-11-22 04:58:48 +00:00
Jeffrey Vander Stoep
69420280c9 Merge "Move platform/vendor data violations to device policy" 2017-11-22 04:57:32 +00:00
Jeff Vander Stoep
6a28b68d54 Fix CTS regressions
Commit 7688161 "hal_*_(client|server) => hal(client|server)domain"
added neverallow rules on hal_*_client attributes while simultaneously
expanding these attribute which causes them to fail CTS neverallow
tests. Remove these neverallow rules as they do not impose specific
security properties that we want to enforce.

Modify Other neverallow failures which were imposed on hal_foo
attributes and should have been enforced on hal_foo_server attributes
instead.

Bug: 69566734
Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t \
    android.cts.security.SELinuxNeverallowRulesTest

    CtsSecurityHostTestCases completed in 7s. 627 passed, 1 failed
    remaining failure appears to be caused by b/68133473
Test: build taimen-user/userdebug

Change-Id: I619e71529e078235ed30dc06c60e6e448310fdbc
2017-11-22 04:54:41 +00:00
Nick Kralevich
6edd55d4d5 Merge "Clean up old file-based OTA SELinux rules" am: 4fbbd147c8 am: 5a30dc3636
am: da071ea1d0

Change-Id: I6b400fd0996c103c98bb6f6c00c6ef58cd83d566
2017-11-22 00:56:51 +00:00
Nick Kralevich
5a30dc3636 Merge "Clean up old file-based OTA SELinux rules"
am: 4fbbd147c8

Change-Id: I304c54a480b150a8c910f268ccf84869dfb7e3f5
2017-11-22 00:33:13 +00:00
Nick Kralevich
7388575591 Clean up old file-based OTA SELinux rules
Remove a number of SELinux rules which were required to support file
based OTA. After this, we can have a much stronger assertion that files
on /system are immutable. Tighten up the neverallow rules at the same
time.

Bug: 35853185
Bug: 15575013
Test: adb reboot recovery && adb sideload [file]
Change-Id: I4238d17808bed6a81f47e14eb1797496c07642e2
2017-11-21 14:20:17 -08:00
Jeffrey Vander Stoep
45f7f00ccc Revert "Fix CTS regressions" am: cd69bebf76 am: 51aba79e3a
am: 7a1af95822

Change-Id: I19c63133e7ecf5dbbb9feeac9efc72d627448af2
2017-11-21 20:44:33 +00:00
Jeffrey Vander Stoep
51aba79e3a Revert "Fix CTS regressions"
am: cd69bebf76

Change-Id: I6f3c20144c971d5040ee325e8bc0e9cff70085a0
2017-11-21 20:39:58 +00:00
Jeffrey Vander Stoep
cd69bebf76 Revert "Fix CTS regressions"
This reverts commit ed876a5e96.

Fixes user builds.
libsepol.report_failure: neverallow on line 513 of system/sepolicy/public/domain.te (or line 9149 of policy.conf) violated by allow update_verifier misc_block_device:blk_file { ioctl read write lock append open }; 
libsepol.check_assertions: 1 neverallow failures occurred 
Error while expanding policy
Bug: 69566734
Test: build taimen-user
Change-Id: I969b7539dce547f020918ddc3e17208fc98385c4
2017-11-21 20:27:47 +00:00
Jeff Vander Stoep
989f6b0e04 Fix CTS regressions am: ed876a5e96 am: c76a25c106
am: 32663d46d1

Change-Id: I17de5133481362dc5d8d102745c31fc8b0e797cd
2017-11-21 19:10:03 +00:00
Jeff Vander Stoep
c76a25c106 Fix CTS regressions
am: ed876a5e96

Change-Id: Ic41e1b997968acfd68ade6e9b9901a4dd9b8d2d2
2017-11-21 19:04:54 +00:00
Jeff Vander Stoep
ed876a5e96 Fix CTS regressions
Commit 7688161 "hal_*_(client|server) => hal(client|server)domain"
added neverallow rules on hal_*_client attributes while simultaneously
expanding these attribute which causes them to fail CTS neverallow
tests. Remove these neverallow rules as they do not impose specific
security properties that we want to enforce.

Modify Other neverallow failures which were imposed on hal_foo
attributes and should have been enforced on hal_foo_server attributes
instead.

Bug: 69566734
Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t \
    android.cts.security.SELinuxNeverallowRulesTest

    CtsSecurityHostTestCases completed in 7s. 627 passed, 1 failed
    remaining failure appears to be caused by b/68133473
Change-Id: I83dcb33c3a057f126428f88a90b95f3f129d9f0e
2017-11-21 18:06:20 +00:00
Benjamin Gordon
65214c688a Merge "sepolicy: Add rules for non-init namespaces" am: b9ea282c65 am: d41e616199
am: 44957a90f3

Change-Id: I363639d2cdf70b1772da3d6c7f7c814554063dfc
2017-11-21 17:47:23 +00:00
Benjamin Gordon
d41e616199 Merge "sepolicy: Add rules for non-init namespaces"
am: b9ea282c65

Change-Id: I77676d7adb39747b9195489ef83d72e57cdb3b59
2017-11-21 17:43:02 +00:00