Commit graph

13344 commits

Author SHA1 Message Date
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
Treehugger Robot
8d07a8d595 Merge "system_server: search permission to all of sysfs." 2017-12-30 04:56:53 +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
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
Tri Vo
ce8bc8b00e system_server: search permission to all of sysfs.
This will allow system_server to perfom path resolution on paths like:
/sys/devices/soc/800f000.qcom,spmi/spmi-0/spmi0-00/800f000.qcom,spmi:qcom,pm8998@0:qcom,pm8998_rtc/rtc

Fixes this denial:
avc: denied { search } for pid=947 comm=system_server
name=800f000.qcom,spmi dev=sysfs ino=19891
scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_msm_subsys:s0
tclass=dir permissive=0 b/68003344

Bug: 68003344
Test: walleye boots without the denial above.
Change-Id: Ib282395124c7f2f554681fcc713b9afe189f441c
2017-12-21 22:35:27 +00:00
Treehugger Robot
6168a12ea9 Merge "Disallow most coredomains from accessing vendor_files on Treble." 2017-12-21 17:07:20 +00:00
Tri Vo
89a7b21541 system_server: remove access to /sys/class/leds.
Removing legacy rules. system_server now depends on Lights HAL (which
has its own domain) instead of /sys/class/leds.

Bug: 70846424
Test: sailfish boots; screen, flashlight work fine.

Change-Id: I6f116a599cab26ae71e45f462b33328bc8d43db5
2017-12-20 18:51:26 +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
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
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
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
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
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
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
Treehugger Robot
5872e84f82 Merge "/odm is another vendor partition that can be customied by ODMs" 2017-12-16 00:27:08 +00:00
Jiyong Park
4c3ab18f49 /odm is another vendor partition that can be customied by ODMs
Since /odm is an extension of /vendor, libs in /odm should be treated
just like the ones in /vendor.

Bug: 67890517
Test: none as we don't yet have /odm partition.
Change-Id: I5232baef769c7fa8c7641b462cfa1d7537d3cfdf
2017-12-15 19:07:58 +09: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
Treehugger Robot
40ed4283e4 Merge "Restrict access to uid_concurrent_*_time" 2017-12-13 19:48:47 +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
Treehugger Robot
1fc08a299c Merge "Remove access to 'sysfs' files from healtd and charger." 2017-12-12 23:18:08 +00:00
Treehugger Robot
5b8d279fcd Merge "shell: directory access to sysfs_net" 2017-12-12 23:11:36 +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
Bowgo Tsai
e9ae77355e Switch file context of odm(/.*) to vendor_file
/odm partition is the extension of /vendor partition, so we should not
use system_file for it. Currently there is no ABI between vendor and
odm. We can use 'odm_file' when needed in the future.

Bug: 64240127
Test: boot a device
Change-Id: I4e8300d597aeeba60a255c8d114a54b24bc39470
2017-12-12 10:32:17 +08: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
Tri Vo
3dbe6f25d1 Merge "Label /sys/class/net as sysfs_net." 2017-12-09 21:40:37 +00:00
Treehugger Robot
7e1d3882bc Merge "Sepolicy: Update rules for perfprofd" 2017-12-09 20:31:34 +00:00
Tri Vo
c135f0acd6 Label /sys/class/net as sysfs_net.
We already expect contents of /sys/class/net to be labeled as sysfs_net.
Also label the directory for consistensy since we usually label
/sys/class/foo directories as sysfs_foo.

Bug: 65643247
Test: netd_integration_test
Test: can browse internet without denials to sysfs_net
Change-Id: I9d28ab4baf71df99ae966276532f14684d1abca6
2017-12-08 16:12:52 -08:00
Treehugger Robot
6413f9dadc Merge "Add broadcast radio HAL 2.0 default implementation to the sepolicy." 2017-12-08 23:46:45 +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
Jaegeuk Kim
336424b606 add sload_f2fs permission
Change-Id: Icfcf02a21dace99ab3f466de495db24a88127ad7
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2017-12-08 00:36:31 +00:00
Tomasz Wasilczyk
4f7bb7576a Add broadcast radio HAL 2.0 default implementation to the sepolicy.
Test: VTS
Bug: 69958777
Change-Id: I6db7dd9afc9c7f254a0233ff3144b02e48727038
2017-12-07 09:48:16 -08:00