Commit graph

1526 commits

Author SHA1 Message Date
Andreas Gampe
ffaaed8026 Sepolicy: Fix perfprofd path
am: 99e4f40246

Change-Id: I80eaf2eb1867d99137c1c7afd1708ebaf6a60e35
2017-12-02 22:03:42 +00:00
Andreas Gampe
99e4f40246 Sepolicy: Fix perfprofd path
Corresponds to commit 410cdebaf966746d6667d6d0dd4cee62262905e1 in
system/extras.

Bug: 32286026
Test: m
Change-Id: I1e0934aa5bf4649d598ec460128de6f02711597f
2017-12-01 17:29:36 -08: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
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
Calin Juravle
2b20a162fe Allow system server to getattr profile_data_files
am: acbda50484

Change-Id: I9575610aeae0464661ad23d0eac696915cb0064e
2017-11-30 23:25:13 +00: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
Calin Juravle
acbda50484 Allow system server to getattr profile_data_files
This is needed in order to get the stat-size of the files.

Bug: 30934496
Test: gts-tradefed -m GtsAndroidRuntimeManagerHostTestCases
Change-Id: I1df0ba941e8f9ff13a23df4063acc3c4f1555c1b
2017-11-29 18:35:35 -08:00
Connor O'Brien
f410c694c6 Merge "selinux: set proc_uid_time_in_state type for /proc/uid"
am: 33ba9c54d1

Change-Id: I09d49857f0bffc37090c4429879fb5288cbc9b90
2017-11-30 01:57:33 +00:00
Connor O'Brien
33ba9c54d1 Merge "selinux: set proc_uid_time_in_state type for /proc/uid" 2017-11-30 01:44:02 +00:00
Jeff Vander Stoep
08c68e1a26 Merge "Fix bug map entry"
am: f838a3bc46

Change-Id: Ia2c73bd7b5524da7df7aa96c14dd60e30feecce2
2017-11-30 01:02:38 +00:00
Treehugger Robot
f838a3bc46 Merge "Fix bug map entry" 2017-11-30 00:52:21 +00:00
Jeff Vander Stoep
53950b6595 Fix bug map entry
Tclass was omitted for two entries.

Bug: 69928154
Bug: 69366875
Test: build
Change-Id: Ie12c240b84e365110516bcd786b98dc37295fdb9
2017-11-29 14:48:41 -08:00
Connor O'Brien
ac3c61eb40 selinux: set proc_uid_time_in_state type for /proc/uid
/proc/uid/ provides the same per-uid time_in_state data as
/proc/uid_time_in_state, so apply the same type and let system_server
read directories of this type.

Bug: 66953705
Test: system_server can read /proc/uid/*/time_in_state files without
denials on sailfish
Change-Id: Iab7fd018c5296e8c0140be81c14e5bae9e0acb0b
Signed-off-by: Connor O'Brien <connoro@google.com>
2017-11-29 12:54:13 -08:00
Calin Juravle
8e4bedd40d Allow system server to open profiles
am: 15da30b6ff

Change-Id: I6a06b84d6319680d73d38ec16ca6e142d79290d1
2017-11-28 23:24:33 +00:00
Calin Juravle
15da30b6ff Allow system server to open profiles
Allow system_server to open profile snapshots for read.
System server never reads the actual content. It passes the descriptor to
to privileged apps which acquire the permissions to inspect the profiles.

Test: installd_dexopt_test
Bug: 30934496
Change-Id: I1d1f07a05261af25f6640040af1500c9a4d5b8d5
2017-11-28 20:18:35 +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
33111652bc Continuation of 9b2e0cbeea
am: df642bef22

Change-Id: I63f0f9b8cfb6e7161b8b89bda377a43d1e114e21
2017-11-22 20:51:06 +00:00
Nick Kralevich
df642bef22 Continuation of 9b2e0cbeea
9b2e0cbeea changed all uses of capability
to global_capability_class_set but accidentally omitted one entry.
Fix the one entry.

Test: policy compiles.
Change-Id: I1bb8c494a2660d9f02783c93b07d4238a2575106
2017-11-22 10:03:35 -08:00
Jiyong Park
07d9f7e0d0 Merge "Label /vendor/priv-app as vendor_app_file"
am: 5086506a99

Change-Id: Icf4ba89621620ac7c624dc1d680bf61f807e163e
2017-11-22 08:07:09 +00:00
Jiyong Park
76311578c9 Label /vendor/priv-app as vendor_app_file
In P, we will be supporting privileged apps in vendor partition, thus
need to label /vendor/priv-app as vendor_app_file so that apps can exist
under the dir.

Bug: 35301609
Test: N/A since there is no /vendor/priv-app yet. Framework change
which is currently in the internal is required.

Change-Id: I86a765ef9da5267113e64a7cbb38ba0abf5c2835
2017-11-22 12:07:08 +09: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
Benjamin Gordon
b9ea282c65 Merge "sepolicy: Add rules for non-init namespaces" 2017-11-21 17:34:40 +00:00
Jeff Vander Stoep
246b807122 Merge "Remove tracking bugs that have been resolved"
am: 11c5700f4b

Change-Id: I10a19ad706d053e1a7a8e9f5d07d7c30aad0a053
2017-11-21 16:50:45 +00:00
Treehugger Robot
11c5700f4b Merge "Remove tracking bugs that have been resolved" 2017-11-21 16:42:19 +00:00
Benjamin Gordon
9b2e0cbeea sepolicy: Add rules for non-init namespaces
In kernel 4.7, the capability and capability2 classes were split apart
from cap_userns and cap2_userns (see kernel commit
8e4ff6f228e4722cac74db716e308d1da33d744f). Since then, Android cannot be
run in a container with SELinux in enforcing mode.

This change applies the existing capability rules to user namespaces as
well as the root namespace so that Android running in a container
behaves the same on pre- and post-4.7 kernels.

This is essentially:
  1. New global_capability_class_set and global_capability2_class_set
     that match capability+cap_userns and capability2+cap2_userns,
     respectively.
  2. s/self:capability/self:global_capability_class_set/g
  3. s/self:capability2/self:global_capability2_class_set/g
  4. Add cap_userns and cap2_userns to the existing capability_class_set
     so that it covers all capabilities.  This set was used by several
     neverallow and dontaudit rules, and I confirmed that the new
     classes are still appropriate.

Test: diff new policy against old and confirm that all new rules add
      only cap_userns or cap2_userns;
      Boot ARC++ on a device with the 4.12 kernel.
Bug: crbug.com/754831

Change-Id: I4007eb3a2ecd01b062c4c78d9afee71c530df95f
2017-11-21 08:34:32 -07:00
Jeff Vander Stoep
378763f218 Remove tracking bugs that have been resolved
Bug: 69175449
Bug: 69197466
Test: build
Change-Id: I11e46b65449cb6f451ecab8d4dff9adc162fe115
2017-11-20 22:14:32 -08:00
Vishnu Nair
063ad62779 Allow system_server to remove files in /data/misc/wmtrace/*
am: df8d4b87ef

Change-Id: Ia617cd27b03de715772eb2d94205422ad8dfe745
2017-11-21 03:18:24 +00:00
Vishnu Nair
df8d4b87ef Allow system_server to remove files in /data/misc/wmtrace/*
Bug: 64831661
Test: adb shell cmd window tracing start && adb shell cmd window tracing stop
Test: adb shell su root dmesg | grep 'avc: '
Change-Id: I1578aac9e102246ec722c78a6e9efb5581259d81
2017-11-20 15:21:56 -08:00
Jeff Vander Stoep
21ce3450cf Allow AOSP processes to read pm_prop
am: 0f5ad4e593

Change-Id: Idcf4b52877a51c2c330a72ba416076c686e29535
2017-11-17 23:19:08 +00:00
Jeff Vander Stoep
0f5ad4e593 Allow AOSP processes to read pm_prop
Exclude vendor processes.

Bug: 69309298
Test: cts-tradefed run cts -m CtsCompilationTestCases
    completed in 33s. 5 passed, 0 failed
Test: runtest frameworks-services -c \
    com.android.server.pm.dex.DexoptOptionsTests \
    --install=".*FrameworksServicesTests.apk"
    OK (5 tests)

Change-Id: Ic02caf373e2214b4b931a724ca8d4f4effbc0741
2017-11-17 13:08:45 -08:00
Tri Vo
5125121273 Merge "shell: neverallow access to 'proc' label."
am: 6faa3a1a54

Change-Id: Ica1a165a67f4db803e69757009a14145bb17c5b9
2017-11-17 20:55:36 +00:00
Tri Vo
6faa3a1a54 Merge "shell: neverallow access to 'proc' label." 2017-11-17 20:51:14 +00:00
Vishnu Nair
dcd0baf627 Merge "Add window trace files SELinux policy rules"
am: 97c86514be

Change-Id: I170162843b04280105c76d4e5d7a8d3f89583588
2017-11-17 19:47:26 +00:00
Treehugger Robot
97c86514be Merge "Add window trace files SELinux policy rules" 2017-11-17 19:27:31 +00:00
Tri Vo
c4ef363006 shell: neverallow access to 'proc' label.
Added access to proc_uptime and proc_asound to address these denials:

avc: denied { read } for name="uptime" dev="proc" ino=4026532080
scontext=u:r:shell:s0 tcontext=u:object_r:proc_uptime:s0 tclass=file
permissive=1

avc: denied { getattr } for path="/proc/asound/version" dev="proc"
ino=4026532017 scontext=u:r:shell:s0 tcontext=u:object_r:proc_asound:s0
tclass=file permissive=1

Bug: 65643247
Test: device boots with no denial from 'shell' domain.
Test: lsmod, ps, top, netstat
Test: No denials triggered from CtsSecurityHostTestCases
Test: external/toybox/run-tests-on-android.sh does not pass, but triggers
no denials from 'shell' domain to 'proc' type.

Change-Id: Ia4c26fd616e33e5962c6707a855dc24e338ec153
2017-11-17 18:39:07 +00:00
Tri Vo
9265291284 Merge "mediaserver: remove access to 'sysfs' type."
am: 499fd01093

Change-Id: Ifdf2102a4305b3aa51607e78a1c6ce529b45d382
2017-11-17 18:06:51 +00:00
Tri Vo
499fd01093 Merge "mediaserver: remove access to 'sysfs' type." 2017-11-17 18:01:30 +00:00
Tri Vo
1bd4443aa6 Merge "system_server: access to /proc/sys/fs/pipe-max-size"
am: 25576730c9

Change-Id: I97842c1a293bc68daa11adffec29514a9afbb868
2017-11-17 17:21:17 +00:00
Vishnu Nair
2d6942d397 Add window trace files SELinux policy rules
- Allow system_server to create and write to /data/misc/wmtrace/*
- Allow surfaceflinger to create and write files from /data/misc/wmtrace/*
- Allow dumpstate to read files from /data/misc/wmtrace/*
permissions are restricted to userdebug or eng builds

Bug: 64831661

Test: adb shell cmd window tracing start && adb shell cmd window tracing stop
Test: adb shell su root service call SurfaceFlinger 1025 i32 1 >/dev/null && adb shell su root service call SurfaceFlinger 1025 i32 0 >/dev/null
Test: adb bugreport ~/tmp.zip && adb shell su root dmesg | grep 'avc: '

Change-Id: I0b15166560739d73d7749201f3ad197dbcf5791c
2017-11-17 17:17:36 +00:00
Treehugger Robot
25576730c9 Merge "system_server: access to /proc/sys/fs/pipe-max-size" 2017-11-17 17:15:01 +00:00
Tri Vo
2ea12cd345 mediaserver: remove access to 'sysfs' type.
Bug: 65643247
Test: cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice
No denials from mediaserver domain to sysfs type are observed.
Change-Id: Icb5c12f04af213452d82e226993fe13085c5c33f
2017-11-16 17:34:14 -08:00
Tri Vo
e7f4934d06 system_server: access to /proc/sys/fs/pipe-max-size
Label /proc/sys/fs/pipe-max-size with new type proc_pipe_conf and give
system_server access to it.

Addresses this denial:
avc: denied { read } for name="pipe-max-size" dev="proc" ino=93817
scontext=u:r:system_server:s0 tcontext=u:object_r:proc:s0 tclass=file
permissive=0

Bug: 69175449
Bug: 69324398
Test: sailfish boots
Test: adb bugreport
Test: craft an unresponsive app, trigger ANR, make sure traces are dumped
into /data/anr
Above denial from system_server not observed, no denials to proc_pipe_conf
observed.
Change-Id: I7c71f05820a4945ba982e29f76e9d9f4458b2b59
2017-11-16 12:30:53 -08:00
Nicolas Geoffray
0181d23f8d Merge "Revert "Revert "Put pm.* property in new pm_prop context"""
am: 0d7e5047ff

Change-Id: I29fd343005136d580763eff843fa94e8e3318c06
2017-11-16 09:44:51 +00:00
Nicolas Geoffray
0d7e5047ff Merge "Revert "Revert "Put pm.* property in new pm_prop context""" 2017-11-16 09:40:57 +00:00
Calin Juravle
5316548f0d Revert "Revert "Put pm.* property in new pm_prop context""
This reverts commit 248b6dc644.

Reason for revert: The dashboard complains that devices don't boot after this revert.

Change-Id: I6a4648b64b096cbaa97c67aae6bc38b76d54cb48
2017-11-16 05:28:14 +00:00
Tom Cherry
7bd0bde4ea Merge "Copy a dontaudit from init to vendor_init"
am: 5984301afd

Change-Id: I7e6c4733471f5954a16f991adddda3657844b47d
2017-11-16 05:27:37 +00:00
Treehugger Robot
5984301afd Merge "Copy a dontaudit from init to vendor_init" 2017-11-16 05:22:44 +00:00
Calin Juravle
e3cec84111 Revert "Put pm.* property in new pm_prop context"
am: 248b6dc644

Change-Id: Ie2990b86b85fbe29565ca7957fbce6b6121abec1
2017-11-16 01:28:47 +00:00
Tom Cherry
63492cd625 Copy a dontaudit from init to vendor_init
Copy init's dontaudit for sysfs:dir write; to calm the below denials:

avc:  denied  { write } for  pid=542 comm="init" name="1da4000.ufshc" dev="sysfs" ino=21752 scontext=u:r:vendor_init:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=1
avc: denied { write } for pid=542 comm="init" name="1da4000.ufshc" dev="sysfs" ino=21752 scontext=u:r:vendor_init:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=1

Bug: 62875318
Test: use pixel + factory reset + vendor_init
Change-Id: I686b51c4f340b3565ea24f00516ebde846be7a89
2017-11-15 14:57:14 -08:00
Calin Juravle
248b6dc644 Revert "Put pm.* property in new pm_prop context"
This reverts commit d1cf3a4056.

Reason for revert: It breaks CTS b/69309298 and other platform tests which read pm.dexopt properties.

Change-Id: I5c7cde041113e9c19bb23218edd99f699fcf4a06
2017-11-15 22:11:35 +00:00
Tri Vo
aff4f7509d Merge "update_verifier: neverallow access to 'sysfs' label."
am: aca97bcb25

Change-Id: I5bb923eecb8fb757d31a8b612f85a49d69cefdab
2017-11-15 18:19:17 +00:00
Tri Vo
aca97bcb25 Merge "update_verifier: neverallow access to 'sysfs' label." 2017-11-15 17:10:56 +00:00
Jeffrey Vander Stoep
ef4f4e9f75 Merge "Add tracking bugs to crash_dump denials"
am: 81e03cb4b5

Change-Id: I8ea9c5c110e0be90bd05a83b3ca94a823e73e847
2017-11-15 03:53:53 +00:00
Tri Vo
7dd4d90628 update_verifier: neverallow access to 'sysfs' label.
Bug: 65643247
Test: aosp_walleye-userdebug builds
Test: aosp_sailfish-userdebug builds
Change-Id: Iaebd368b84259783fbdc4778988bdb7ba0df300b
2017-11-14 19:27:55 -08:00
Jeff Vander Stoep
41401f475a Add tracking bugs to crash_dump denials
avc: denied { search } for name="com.sf.activity" dev="sda35"
ino=1444147 scontext=u:r:crash_dump:s0:c512,c768
tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir
avc: denied { search } for comm="crash_dump64"
name="com.android.bluetooth" dev="sda13" ino=1442292
scontext=u:r:crash_dump:s0 tcontext=u:object_r:bluetooth_data_file:s0
tclass=dir
avc: denied { search } for comm="crash_dump64" name="overlay" dev="dm-1"
ino=938 scontext=u:r:crash_dump:s0
tcontext=u:object_r:vendor_overlay_file:s0 tclass=dir permissive=0

Bug: 68705274
Bug: 68319037
Test: build
Change-Id: I44075ac6bf6447d863373c97ba10eadf59d2d22f
2017-11-14 22:11:15 +00:00
Xin Li
c667a0ed64 Merge commit 'd9664064dd09ae254aa3e6ce28fec5fde68c1fb6' into HEAD
Change-Id: Icec8dfff5cff17cf1b557882db62b148a7218b98
2017-11-14 11:46:58 -08:00
Treehugger Robot
7c6627768b Merge "Allow Instant/V2 apps to load code from /data/data" 2017-11-14 01:08:29 +00:00
Jeffrey Vander Stoep
721b305ebd Merge "Revert "update_verifier: neverallow access to 'sysfs' label."" 2017-11-13 21:34:45 +00:00
Chad Brubaker
7650669fe8 Allow Instant/V2 apps to load code from /data/data
This restriction causes issues with dynamite.

Since untrusted_v2_app was about enforcing this constraint put installed
v2 applications back into the normal untrusted_app domain.

Bug: 64806320
Test: Manual test with app using dynamite module

(cherrypicked from commit fe83681794)

Change-Id: I3abf3ade64aaf689039a515de642759dd39ae6f7
2017-11-13 13:31:42 -08:00
Tri Vo
23e58d1970 Revert "update_verifier: neverallow access to 'sysfs' label."
This reverts commit a61b99bba3.

Reason for revert: breaks aosp_walleye-userdebug

Change-Id: I3246b8cac862b53fc76609df60b90149fbc8098d
2017-11-13 21:24:53 +00:00
Treehugger Robot
f5e53e0c0e Merge "Add tracking bugs to denials" 2017-11-13 21:04:29 +00:00
Tri Vo
a61b99bba3 update_verifier: neverallow access to 'sysfs' label.
Bug: 65643247
Test: walleye-userdebug builds
Change-Id: I12d8239ca85bb68eab76a2d0001a722fea3045c5
2017-11-13 10:29:21 -08:00
Jeff Vander Stoep
29666d125f Add tracking bugs to denials
These denials should not be allowed. Adding a bug number to the
denial properly attributes them to a bug.

Bug: 69197466
avc: denied { fsetid } for comm="update_engine" capability=4
scontext=u:r:update_engine:s0 tcontext=u:r:update_engine:s0
tclass=capability

Bug: 62140539
avc: denied { open }
path="/data/system_de/0/spblob/17a358cf8dff62ea.weaver"
scontext=u:r:vold:s0 tcontext=u:object_r:system_data_file:s0
tclass=file
avc: denied { unlink } for name="17a358cf8dff62ea.weaver"
scontext=u:r:vold:s0 tcontext=u:object_r:system_data_file:s0
tclass=file

Bug: 69175449
avc: denied { read } for name="pipe-max-size" dev="proc"
scontext=u:r:system_server:s0 tcontext=u:object_r:proc:s0 tclass=file

Test: build
Change-Id: I62dc26a9076ab90ea4d4ce1f22e9b195f33ade16
2017-11-13 08:08:17 -08:00
Hakan Kvist
6fe014f8cb Allow update_engine to access /data/misc/update_engine_log
Add label update_engine_log_data_file for log files created by
update engine in directory /data/misc/update_engine_log.

Bug: 65568605
Test: manual
Change-Id: I379db82a0ea540e41cb3b8e03f93d9ce64fac7c9
2017-11-09 14:21:49 -08:00
Tri Vo
aa93dad669 Merge changes from topic "cki_proc_init"
* changes:
  init: label /proc dependencies and remove access to proc
  init: refactor access to proc_* labels.
2017-11-09 22:04:27 +00:00
Jeff Vander Stoep
182dbeb603 Suppress mediaprover access to certain cache dirs
avc: denied { getattr } for comm="sAsyncHandlerTh"
path="/data/cache/recovery" dev="sda13" ino=7086082
scontext=u:r:mediaprovider:s0:c512,c768
tcontext=u:object_r:cache_recovery_file:s0 tclass=dir
avc: denied { getattr } for path="/data/cache/backup"
scontext=u:r:mediaprovider:s0:c512,c768
tcontext=u:object_r:cache_private_backup_file:s0 tclass=dir

Bug: 63038506
Bug: 35197529
Test: build police
Change-Id: I51624c255e622bf712d41ca1bbf190ec3e4fefae
(cherry picked from commit fcf1b2083935bd298a2ece8d6d0c18712865a04b)
2017-11-09 18:39:58 +00:00
Jeff Vander Stoep
63f4677342 Allow vendor apps to use surfaceflinger_service
Vendor apps may only use servicemanager provided services
marked as app_api_service. surfaceflinger_service should be
available to vendor apps, so add this attribute and clean up
duplicate grants.

Addresses:
avc:  denied  { find } scontext=u:r:qtelephony:s0
tcontext=u:object_r:surfaceflinger_service:s0 tclass=service_manager
avc:  denied  { find } scontext=u:r:ssr_detector:s0
tcontext=u:object_r:surfaceflinger_service:s0 tclass=service_manager
avc:  denied  { find } scontext=u:r:qcneservice:s0
tcontext=u:object_r:surfaceflinger_service:s0 tclass=service_manager

Bug: 69064190
Test: build
Change-Id: I00fcf43b0a8bde232709aac1040a5d7f4792fa0f
2017-11-09 15:41:37 +00:00
Tri Vo
84e181bcd7 init: label /proc dependencies and remove access to proc
New types and files labeled with them:
1. proc_abi:
  /proc/sys/abi/swp

2. proc_dirty:
  /proc/sys/vm/dirty_background_ratio
  /proc/sys/vm/dirty_expire_centisecs

3. proc_diskstats:
  /proc/diskstats

4. proc_extra_free_kbytes:
  /proc/sys/vm/extra_free_kbytes

5. proc_hostname:
  /proc/sys/kernel/domainname
  /proc/sys/kernel/hostname

6. proc_hung_task:
  /proc/sys/kernel/hung_task_timeout_secs

7. proc_max_map_count:
  /proc/sys/vm/max_map_count

8. proc_panic:
  /proc/sys/kernel/panic_on_oops

9. proc_sched:
  /proc/sys/kernel/sched_child_runs_first
  /proc/sys/kernel/sched_latency_ns
  /proc/sys/kernel/sched_rt_period_us
  /proc/sys/kernel/sched_rt_runtime_us
  /proc/sys/kernel/sched_tunable_scaling
  /proc/sys/kernel/sched_wakeup_granularity_ns

10. proc_uptime:
  /proc/uptime

Files labeled with already existing types:
1. proc_perf:
  /proc/sys/kernel/perf_event_paranoid

2. proc_sysrq:
  /proc/sys/kernel/sysrq

3. usermodehelper:
  /proc/sys/kernel/core_pipe_limit

Changes to init domain:
1. Removed access to files with 'proc' label.
2. Added access to newly introduced types + proc_kmsg.

Bug: 68949041
Test: walleye boots without denials from u:r:init:s0.
Test: system/core/init/grab-bootchart.sh does not trigger denials from
u:r:init:s0
Change-Id: If1715c3821e277679c320956df33dd273e750ea2
2017-11-08 14:46:09 -08:00
Victor Hsieh
d1cf3a4056 Put pm.* property in new pm_prop context
Test: system server does not crash with this change
Bug: 67415855
Bug: 63920015
Change-Id: I3d0982220743137098dbc683d5c4aded105648c2
2017-11-08 16:57:38 +00:00
Luis Hector Chavez
640e595a68 Allow callers of uevent_kernel_*() access to /proc/sys/kernel/overflowuid
Bug: 62378620
Test: Android in Chrome OS can call uevent_kernel_recv() and not fail
      with EIO.
Test: bullhead networking still works

Change-Id: I4dd5d2148ee1704c4fa23d7fd82d1ade19b58cbd
2017-11-08 01:39:28 +00:00
Tri Vo
19f8b868f0 system_server: neverallow sysfs file access.
Bug: 65643247
Test: build aosp_sailfish-userdebug
Test: build walleye-userdebug from internal
Change-Id: Ic7a212ce226dcfa4b363ed1acd3b2a249cee576b
2017-11-07 04:05:38 +00:00
Jeff Vander Stoep
c394258cfe Remove deprecated aliases
These are no longer used.

Test: build aosp_marlin
Bug: 34980020
Change-Id: I04e4aa2322fcdf5945b99967d88287c353b9a6ae
2017-11-06 17:31:58 +00:00
Tri Vo
5aac163bb7 radio: neverallow access to proc and sysfs types.
Bug: 65643247
Test: build aosp_sailfish-userdebug
Test: build walleye-userdebug from internal
This CL does not change runtime behavior.
Change-Id: I82c520579b986ea2a4a6f030ec60d5345c00b54f
2017-11-03 12:18:47 -07:00
Treehugger Robot
daac339f6a Merge "Don't allow dexoptanalyzer to open app_data_files" 2017-11-02 22:03:49 +00:00
Shubham Ajmera
b8a424994f Don't allow dexoptanalyzer to open app_data_files
Test: manual(installd flow without sepolicy denials)
Bug: 67111829
Change-Id: I7ac1a86e731ec5900eec83608b4765a6818f2fd0
2017-11-02 10:45:09 -07:00
Tri Vo
233c7a6b40 Neverallow coredomain to kernel interface files.
Core domains should not be allowed access to kernel interfaces,
which are not explicitly labeled. These interfaces include
(but are not limited to):

1. /proc
2. /sys
3. /dev
4. debugfs
5. tracefs
6. inotifyfs
7. pstorefs
8. configfs
9. functionfs
10. usbfs
11. binfmt_miscfs

We keep a lists of exceptions to the rule, which we will be gradually shrinking.
This will help us prevent accidental regressions in our efforts to label
kernel interfaces.

Bug: 68159582
Bug: 68792382
Test: build aosp_sailfish-user
Test: build aosp_sailfish-userdebug
Test: CP to internal and build walleye-user
Change-Id: I1b2890ce1efb02a08709a6132cf2f12f9d88fde7
2017-11-02 10:12:27 -07:00
Tri Vo
4200338ec0 Merge "Revert "Neverallow coredomain to kernel interface files."" 2017-11-02 16:36:10 +00:00
Tobias Thierer
83a06805f0 Revert "Neverallow coredomain to kernel interface files."
This reverts commit 502e43f7d9.

Reason for revert: Suspected to have broken a build, see b/68792382

Bug: 68792382
Change-Id: Ib5d465b7a50a73e3d8d8edd4e6b3426a7bde4249
2017-11-02 16:03:36 +00:00
Tri Vo
bf4786cf0e Merge "Neverallow coredomain to kernel interface files." 2017-11-01 22:21:28 +00:00
Nick Kralevich
35e92394f3 whitespace fix.
Test: code compiles.
Change-Id: I2677ebdaf7ca491c60697da9d3ebf5a5d8cb5036
2017-11-01 10:17:39 -07:00
Tri Vo
502e43f7d9 Neverallow coredomain to kernel interface files.
Core domains should not be allowed access to kernel interfaces,
which are not explicitly labeled. These interfaces include
(but are not limited to):

1. /proc
2. /sys
3. /dev
4. debugfs
5. tracefs
6. inotifyfs
7. pstorefs
8. configfs
9. functionfs
10. usbfs
11. binfmt_miscfs

We keep a lists of exceptions to the rule, which we will be gradually shrinking.
This will help us prevent accidental regressions in our efforts to label
kernel interfaces.

Bug: 68159582
Test: bullhead, sailfish can build
Change-Id: I8e466843e1856720f30964546c5c2c32989fa3a5
2017-10-31 16:20:58 -07:00
Paul Crowley
5850a2ae6b Move most of public/vold_prepare_subdirs.te to private
AIUI permissions should be in private unless they need to be public.

Bug: 25861755
Test: Boot device, create and remove a user, observe logs
Change-Id: I6c3521d50dab2d508fce4b614d51e163e7c8f3da
2017-10-25 13:06:25 -07:00
Tom Cherry
621c24cbab add vendor_init.te
First pass at adding vendor_init.te

Bug: 62875318
Test: boot sailfish with vendor_init
Change-Id: I35cc9be324075d8baae866d6de4166c37fddac68
2017-10-25 09:21:30 -07:00
Tom Cherry
8bdb1dab56 Add label for /proc/sys/vm/page-cluster
Test: boot sailfish with no audit when writing to page-cluster
Change-Id: I2bfebdf9342594d66d95daaec92d71195c93ffc8
2017-10-24 13:53:51 -07:00
Tri Vo
71b19aa601 Merge "/proc, /sys access from uncrypt, update_engine, postinstall_dexopt" 2017-10-24 20:36:22 +00:00
Treehugger Robot
8e805857f0 Merge "allow vold_prepare_subdirs to create storaged directories" 2017-10-24 18:14:17 +00:00
Tri Vo
04fb82f232 /proc, /sys access from uncrypt, update_engine, postinstall_dexopt
New types:
1. proc_random
2. sysfs_dt_firmware_android

Labeled:
1. /proc/sys/kernel/random as proc_random.
2. /sys/firmware/devicetree/base/firmware/android/{compatible, fstab,
vbmeta} as sysfs_dt_firmware_android.

Changed access:
1. uncrypt, update_engine, postinstall_dexopt have access to generic proc
and sysfs labels removed.
2. appropriate permissions were added to uncrypt, update_engine,
update_engine_common, postinstall_dexopt.

Bug: 67416435
Bug: 67416336
Test: fake ota go/manual-ab-ota runs without denials
Test: adb sideload runs without denials to new types
Change-Id: Id31310ceb151a18652fcbb58037a0b90c1f6505a
2017-10-24 16:40:45 +00:00
Max Bires
0187b23113 Adding statscompanion_service and a dontaudit for find/add
Instead of removing the denial generating code, a dontaudit and a
service label will be provided so that the team working on this new
feature doesn't have to get slowed up with local revision patches.

The dontaudit should be removed upon resolution of the linked bug.

Bug: 67468181
Test: statscompanion denials aren't audited
Change-Id: Ib4554a7b6c714e7409ea504f5d0b82d5e1283cf7
2017-10-23 16:45:13 -07:00
Treehugger Robot
1ff4148c6a Merge "Revert "Ensure only com.android.shell can run in the shell domain."" 2017-10-23 22:15:57 +00:00
Nick Kralevich
bf0c2a59f8 Revert "Ensure only com.android.shell can run in the shell domain."
The following error is occurring on master:

10-23 16:24:24.785 shell  4884  4884 E SELinux : seapp_context_lookup:  No match for app with uid 2000, seinfo platform, name com.google.android.traceur
10-23 16:24:24.785 shell  4884  4884 E SELinux : selinux_android_setcontext:  Error setting context for app with uid 2000, seinfo platform:targetSdkVersion=23:complete: Success
10-23 16:24:24.785 shell  4884  4884 E Zygote  : selinux_android_setcontext(2000, 0, "platform:targetSdkVersion=23:complete", "com.google.android.traceur") failed
10-23 16:24:24.785 shell  4884  4884 F zygote64: jni_internal.cc:593] JNI FatalError called: frameworks/base/core/jni/com_android_internal_os_Zygote.cpp:648: selinux_android_setcontext failed
10-23 16:24:24.818 shell  4884  4884 F zygote64: runtime.cc:535] Runtime aborting...

Bug: 68126425
Bug: 68032516

This reverts commit 714ee5f293.

Change-Id: I7356c4e4facb1e532bfdeb575acf2d83761a0852
2017-10-23 20:22:07 +00:00
Jin Qian
c0125335e5 allow vold_prepare_subdirs to create storaged directories
Test: Boot device, observe logs
Bug: 63740245
Change-Id: I1068304b12ea90736b7927b7368ba1a213d2fbae
2017-10-23 11:34:47 -07:00
Jin Qian
81d8b0ee01 storaged: move storaged file from DE to CE
Allow vold/system_server to call storaged service

Test: adb shell storaged -u
Bug: 63740245
Change-Id: I88219e32520006db20299468b7a8c7ce0bfa58e0
Merged-In: I88219e32520006db20299468b7a8c7ce0bfa58e0
(cherry picked from commit fa6c3d7c4c)
2017-10-23 08:31:46 -07:00
Treehugger Robot
d1467ad8c8 Merge "priv_app: move logspam suppression to core policy" 2017-10-20 22:54:21 +00:00
Treehugger Robot
917cf072d2 Merge "Fixup neverallow rule" 2017-10-20 22:40:31 +00:00
Tri Vo
8dabc2ce74 Restrict netd fwk policy.
Remove netd access to sysfs_type attribute.

These were moved from vendor to fwk policy:
1. sysfs_net type declaration
2. labeling of /sys/devices/virtual/net with sysfs_net
3. netd access to sysfs_net

Bug: 65643247
Test: can browse internet without netd denials
Test: netd_unit_test, netd_integration_test without netd denials
Merged-In: Ic1b95a098f438c4c6bc969bee801bf7dd1a13f6e
Change-Id: Ic1b95a098f438c4c6bc969bee801bf7dd1a13f6e
(cherry picked from commit e62a56b717)
2017-10-20 22:07:01 +00:00
Max Bires
4a14d16ecb Merge "Relabeling /proc/asound so everything has proc_asound label" 2017-10-20 21:43:45 +00:00
Jeff Vander Stoep
6233848f78 priv_app: move logspam suppression to core policy
No sign of these denials getting cleaned up, so supress them in core
policy.

Test: build
Change-Id: I0320425cb72cbd15cef0762090899491338d4f7c
2017-10-20 13:37:04 -07:00
Nick Kralevich
2ec15e5b27 Fixup neverallow rule
When we removed /data/dalvik-cache execute permission for system_server
(b/37214733, b/31780877), I forgot to fixup this neverallow rule.
Fix rule.

Test: policy compiles.
Change-Id: I38b821a662e0d8304b8390a69a6d9e923211c31e
2017-10-20 13:27:26 -07:00
Nick Kralevich
714ee5f293 Ensure only com.android.shell can run in the shell domain.
Don't allow apps to run with uid=shell or selinux domain=shell unless
the package is com.android.shell.

Add a neverallow assertion (compile time assertion + CTS test) to ensure
no regressions.

Bug: 68032516
Test: policy compiles, device boots, and no obvious problems.
Change-Id: Ic6600fa5608bfbdd41ff53840d904f97d17d6731
2017-10-20 09:58:08 -07:00
Treehugger Robot
d18ff63afb Merge "sepolicy for lazy starting HIDL services" 2017-10-20 06:38:42 +00:00
Max Bires
aae18186e1 Relabeling /proc/asound so everything has proc_asound label
This is to simplify access for hal_audio

Test: ls -Z in /proc/asound correctly shows everything with proc_asound
selinux label

Change-Id: I66ed8babf2363bee27a748147eb358d57a4594c4
2017-10-19 15:51:38 -07:00
Steven Moreland
13c394677d sepolicy for lazy starting HIDL services
Now hwservicemanager can send ctl.interface_start messages
to init.

Note that 'set_prop(ctl.*, "foo")' maps to property context
for ctl.foo.

Bug: 64678982
Test: hwservicemanager can start interfaces
Change-Id: I9ab0bacd0c33edb0dcc4186fa0b7cc28fd8d2f30
2017-10-17 16:36:10 -07:00
Paul Crowley
67dab989b7 vold_prepare_subdirs sets policy in vold-created dirs. am: 5b962cfd7b am: ea8e21ee7f
am: ca709475a0

Change-Id: Ic596a8b65a7c130d518a9ffacf5e9f2dfce4566b
2017-10-17 20:26:08 +00:00
Max Bires
aed69d67f7 Allowing system_server to search sysfs_power dir
rw access to sysfs_power file is not enough; in some cases search access
is also needed

Bug: 67895406
Test: system_server can access memory power statistics
Change-Id: I471e8e60626e6eed35e74e25a0f4be470885a459
2017-10-17 12:45:16 -07:00
Robert Quattlebaum
4799e34d57 resolve merge conflicts of a2d30231 to oc-mr1-dev-plus-aosp
Change-Id: Id7355a7acacfb8ccfe1ef9d562469f914ad3bf2a
2017-10-17 11:18:08 -07:00
Paul Crowley
5b962cfd7b vold_prepare_subdirs sets policy in vold-created dirs.
Bug: 25861755
Test: Boot device, observe logs
Change-Id: I6c13430d42e9794003eb48e6ca219b874112b900
Merged-In: I6c13430d42e9794003eb48e6ca219b874112b900
(cherry picked from commit 47f3ed09d2)
2017-10-17 10:17:20 -07:00
Robert Quattlebaum
fd03d51736 lowpan: Add wpantund to SEPolicy
Bug: b/64399219
Test: Manual
Change-Id: I4f6c7e4e3339ae95e43299bf364edff40d07c796
(cherry picked from commit c8bd93d7e8)
2017-10-16 14:10:40 -07:00
Todd Poynor
ccb981356e PowerUI access to thermalservice am: bbc692c6d9 am: 69b7f7eca2
am: aca0623f07

Change-Id: I3b2885863ab88820b1a74d390b68a8a2ae5d148f
2017-10-16 16:52:51 +00:00
Jeff Vander Stoep
5c43806e99 Merge "system_app: suppress denials for disallowed services" am: fce64b06cc am: 9201edac8b
am: 5885f6cbb2

Change-Id: I6aaec5cfbc4926286fd4de5c29cca26bcb283d93
2017-10-15 03:54:17 +00:00
Jeff Vander Stoep
1730aa924b Merge "Track priv_app firstboot_prop denial" am: 49bb11875a am: 06f6472db0
am: e85f182c25

Change-Id: I92e9bc4ffc7d201e122029375f466c71258a8625
2017-10-15 03:02:04 +00:00
Tri Vo
24f994bba7 Merge "Label system_server's dependencies in sysfs." am: 975efbe5d2 am: fb49dc5211
am: 8269fec076

Change-Id: I8d01d234ea9f72cd9d6b87ebec14dc026eaed6c9
2017-10-15 03:01:00 +00:00
Todd Poynor
bbc692c6d9 PowerUI access to thermalservice
Allow PowerUI / platform_app to use thermalservice for receiving
notifications of thermal events.

Bug: 66698613
Test: PowerNotificationWarningsTest, PowerUITest,
      manual: marlin and <redacted> with artificially low temperature
      threshold and logcat debugging messages
Change-Id: I5428bd5f99424f83ef72d981afaf769bdcd03629
Merged-In: I5428bd5f99424f83ef72d981afaf769bdcd03629
2017-10-14 01:05:58 +00:00
Treehugger Robot
fce64b06cc Merge "system_app: suppress denials for disallowed services" 2017-10-13 22:48:17 +00:00
Treehugger Robot
49bb11875a Merge "Track priv_app firstboot_prop denial" 2017-10-13 22:48:14 +00:00
Jeff Vander Stoep
2d32d81d5a system_app: suppress denials for disallowed services
Dontaudit denials for services that system_app may not use due
to neverallow assertions.

Bug: 67779088
Test: build
Change-Id: I822a7909c86bee5c2fdeec6e13af1a9791883f72
2017-10-13 13:43:34 -07:00
Jeff Vander Stoep
e82c8ab786 Track priv_app firstboot_prop denial
This denial should not be allowed. Add bug information to the denial
to give context.

Bug: 63801215
Test: build
Change-Id: I3dc5ce6a5aa1c6bf74c6fd13cab082c7f263c4e8
2017-10-13 13:02:36 -07:00
Tri Vo
1960215c49 Label system_server's dependencies in sysfs.
New types:
sysfs_android_usb
sysfs_ipv4
sysfs_power
sysfs_rtc
sysfs_switch
sysfs_wakeup_reasons

Labeled:
/sys/class/android_usb, /sys/devices/virtual/android_usb ->sysfs_android_usb
/sys/class/rtc -> sysfs_rtc
/sys/class/switch, /sys/devices/virtual/switch -> sysfs_switch
/sys/power/state, /sys/power/wakeup_count -> sysfs_power
/sys/kernel/ipv4 -> sysfs_ipv4
/sys/kernel/wakeup_reasons -> sysfs_wakeup_reasons

Removed access to sysfs and sysfs_type from system_server and added
appropriate access to new types.

Bug: 65643247
Test: sailfish boots without violation from system_server or to new labels.
Change-Id: I27250fd537d76c8226defa138d84fe2a4ce2d5d5
2017-10-12 14:51:20 -07:00
Jeff Vander Stoep
186d9d3820 Neverallow write access to /sys files for untrusted apps am: 06cef4ff15 am: 1db7eba91f
am: 6c558a5e0a

Change-Id: I18e2111cb0da05c7f58163b0f4e7c17bcc92cd6a
2017-10-12 06:50:21 +00:00
Jeff Vander Stoep
06cef4ff15 Neverallow write access to /sys files for untrusted apps
Test: build aosp_sailfish
Change-Id: Iaefe1df66885d3e78feb600c3d9845bd9fe671a2
2017-10-12 05:04:59 +00:00
Tao Bao
29c909ff34 Create sysfs_dm label. am: 5b4bea438a am: 28dca27ba2
am: a35083e015

Change-Id: Ice4fb08c6d3342d8bfd8afccbbcc939bed4b9eee
2017-10-11 17:09:49 +00:00
Tao Bao
5b4bea438a Create sysfs_dm label.
Prior to this CL, /sys/devices/virtual/block/dm-X was using the generic
sysfs label. This CL creates sysfs_dm label and grants the following
accesses:
 - update_verifier to read sysfs_dm dir and file at
   /sys/devices/virtual/block/dm-X.
 - vold to write sysfs_dm.

Bug: 63440407
Test: update_verifier successfully triggers blocks verification and
      marks a sucessful boot;
Test: No sysfs_dm related denials on sailfish.
Change-Id: I6349412707800f1bd3a2fb94d4fe505558400c95
2017-10-10 14:42:24 -07:00
Nick Kralevich
b59eadbd06 Ensure /sys restrictions for isolated_apps am: 62d3b4f103 am: 8f6a5f57f9
am: 9aa56dfb09

Change-Id: I6da11d0ea1f5689b37a9d08e3534e6bc80b870be
2017-10-10 19:41:50 +00:00
Nick Kralevich
62d3b4f103 Ensure /sys restrictions for isolated_apps
isolated_apps are intended to be strictly limited in the /sys files
which can be read. Add a neverallow assertion to guarantee this on all
Android compatible devices.

Test: policy compiles.
Change-Id: I2980291dcf4e74bb12c81199d61c5eb8a182036c
2017-10-10 10:31:33 -07:00
Dan Cashman
33edd89696 Merge "Remove reboot_data_file." am: f3f194c09a am: 9cac761df7
am: 17491f6b9c

Change-Id: I32dfe7fd082e3d7a60f0787f2c0d559d8ce252c0
2017-10-09 23:50:38 +00:00
Dan Cashman
76d0e4180a Remove reboot_data_file.
Bug: 64687998
Test: Builds.
Change-Id: I7a5b65d34382b8b76e55c523811a0f17dd9c1051
2017-10-09 14:25:10 -07:00
Nick Kralevich
0011fd408c Merge "Revert "Ensure /sys restrictions for isolated_apps"" am: 3e60e38a40 am: 89185f5aa8
am: 3f5bc5022b

Change-Id: I0c442961eab964595ad072ec1a4308a4cc2c6888
2017-10-07 16:35:24 +00:00
Nick Kralevich
3e60e38a40 Merge "Revert "Ensure /sys restrictions for isolated_apps"" 2017-10-07 16:05:25 +00:00
Nick Kralevich
ae48ecbde9 Revert "Ensure /sys restrictions for isolated_apps"
Bullhead and dragon are broken. Revert until I can fix
those builds.

Dragon:

libsepol.report_failure: neverallow on line 113 of system/sepolicy/private/isolated_app.te (or line 26264 of policy.conf) violated by allow isolated_app sysfs_socinfo:file { ioctl read lock open }; 

Bullhead:

libsepol.report_failure: neverallow on line 113 of system/sepolicy/private/isolated_app.te (or line 26283 of policy.conf) violated by allow isolated_app sysfs_power_management:file { ioctl read lock open }; 
libsepol.report_failure: neverallow on line 113 of system/sepolicy/private/isolated_app.te (or line 26283 of policy.conf) violated by allow isolated_app sysfs_socinfo:file { ioctl read lock open }; 
libsepol.report_failure: neverallow on line 113 of system/sepolicy/private/isolated_app.te (or line 26283 of policy.conf) violated by allow isolated_app sysfs_thermal:file { ioctl read lock open }; 
libsepol.check_assertions: 3 neverallow failures occurred 


This reverts commit 579366a0ba.

Change-Id: I1ea4824e226c06628769898299f2e322060d0d06
Test: policy compiles.
2017-10-07 16:03:59 +00:00
Nick Kralevich
91f41549a7 Merge "Ensure /sys restrictions for isolated_apps" am: eb1ae18836 am: a2cf96bcd3
am: 1e6ca6fae5

Change-Id: Ic4bac09bef9e3b42115e9bf0b173831c75ee9938
2017-10-07 15:14:09 +00:00
Treehugger Robot
eb1ae18836 Merge "Ensure /sys restrictions for isolated_apps" 2017-10-07 15:02:21 +00:00
Tri Vo
16ef7ca87c Merge "Extend access to proc/asound/*" am: a045c854c5 am: bd435bf8e9
am: 32f7d8f89e

Change-Id: I3130edd2f3386ee4526bb1976ba7f44fda2289bc
2017-10-06 19:24:36 +00:00
Tri Vo
464f59ae10 Extend access to proc/asound/*
Renamed this type:
proc_asound_cards -> proc_asound

Labeled /proc/asound/devices as proc_asound.

We now use proc_asound type to label files under /proc/asound which we
want to expose to system components.

Bug: 66988327
Test: Pixel 2 boots, can play sound with or without headphones, and
selinux denials to proc_asound are not seen.

Change-Id: I453d9bfdd70eb80931ec9e80f17c8fd0629db3d0
2017-10-06 10:29:03 -07:00
Nick Kralevich
579366a0ba Ensure /sys restrictions for isolated_apps
isolated_apps are intended to be strictly limited in the /sys files
which can be read. Add a neverallow assertion to guarantee this on all
Android compatible devices.

Test: policy compiles.
Change-Id: I47aceefa3f43a7ea9e526f6f0ef377d0b4efbe3a
2017-10-05 18:16:46 +00:00
Marco Nelissen
9496cb0064 Merge "Add drmserver permission for ephemeral apps" am: 5f85a48099 am: 41effcd76e
am: 3d9f84bfee

Change-Id: I57f1df2a00a6b187a1e53485019b629571e41b2c
2017-10-05 02:51:31 +00:00
Marco Nelissen
5f85a48099 Merge "Add drmserver permission for ephemeral apps" 2017-10-05 02:41:05 +00:00
Marco Nelissen
3235963830 Add drmserver permission for ephemeral apps
so they can use MediaExtractor too.

Bug: 67406992
Test: yes
Change-Id: Iaacadc13b1fc032fe31eea1f3ecbbbabb741470a
2017-10-04 16:37:30 -07:00
Nick Kralevich
a9ed5f0d80 Merge "Drop isolated_app auditallow rule." am: dfb7b7e3ad am: f538265983
am: 0b6cf5451d

Change-Id: Ib66a58d8afaaa384f052001aa8de39c778b4ee8e
2017-10-04 23:21:45 +00:00
Nick Kralevich
69ec0f8f24 Drop isolated_app auditallow rule.
This functionality is being used, apparently.

Addresses the following auditallow spam:

  type=1400 audit(0.0:1039): avc: granted { write } for
  comm="Chrome_ProcessL"
  path="/storage/emulated/0/Android/data/com.bleacherreport.android.teamstream/cache/.com.google.Chrome.sk5n91"
  dev="sdcardfs" ino=1877565 scontext=u:r:isolated_app:s0:c512,c768
  tcontext=u:object_r:sdcardfs:s0 tclass=file

Test: policy compiles.
Bug: 32896414
Change-Id: I627e20c38115f1d579e78ca12abfa717d32a155a
2017-10-04 14:17:19 -07:00
Tri Vo
8870186fbb Merge "Remove surfaceflinger access to sysfs." am: 9fdb30fcbb am: 102f9df05b
am: d64b00a93c

Change-Id: I9c4df1e49d17d1bd8f5fc97f54d69167c5f7d86e
2017-10-03 16:27:09 +00:00
Tri Vo
9fdb30fcbb Merge "Remove surfaceflinger access to sysfs." 2017-10-03 16:09:00 +00:00
Etan Cohen
2b01e7536e Merge "[RTT2] policy change for Wi-Fi RTT (v2) framework" am: a7c967e327 am: b6addc7160
am: b6d318fcd7

Change-Id: I44187b972b16c5219bb396d60304a611b434e3f7
2017-10-03 13:50:57 +00:00
Tri Vo
54a2cac5a2 Remove surfaceflinger access to sysfs.
Bug: 65643247
Test: SurfaceFlinger_test passes (except known failures) without selinux
denials
Change-Id: I6ce185f92e5ad64a172da7d7e12167d8da2ebed0
2017-10-02 14:17:14 -07:00
Bowgo Tsai
2429dfdf39 Merge "Removing $(PRODUCT_OUT)/root/root" am: 2f6e66ff09 am: 864b9af9a9
am: 435fd1756a

Change-Id: I0ec4ce41f6c950eee4d87902d6778c5d30da0487
2017-09-30 01:17:48 +00:00
Etan Cohen
4680cd9690 [RTT2] policy change for Wi-Fi RTT (v2) framework
A parallel Wi-Fi RTT service is being added in parallel. Switch-over
will occur once the new service is ready.

Bug: 65014552
Test: integration tests
Change-Id: Ie4b15592140462af70c7092511aee3f603aaa411
2017-09-29 09:42:42 -07:00
Bowgo Tsai
4cc4096a5c Removing $(PRODUCT_OUT)/root/root
Bug: 65570851
Test: boot sailfish
Change-Id: I008bf5386595c614236de44131afcda7d3fd6d98
Merged-In: I008bf5386595c614236de44131afcda7d3fd6d98
(cherry picked from commit 82ca9c2ef4)
2017-09-28 18:12:13 +08:00
Dan Cashman
66bafcd445 Fix build.
(This reverts internal commit: 82ca9c2ef4)
Test: None.

Change-Id: I48bbbe197c8e793bd9888b6ef4dadb2b3466423b
(cherry picked from commit 852aca050d)
2017-09-27 22:25:05 -07:00
Dan Cashman
df5469d864 Sync internal master and AOSP sepolicy.
Bug: 37916906
Test: Builds 'n' boots.
Change-Id: Ia1d86264446ebecc1ca79f32f11354921bc77668
Merged-In: I208ec6a864127a059fb389417a9c6b259d7474cb
2017-09-27 18:55:47 -07:00
Dan Cashman
7d1130f111 Fix build.
(This reverts internal commit: 82ca9c2ef4)
Test: None.

Merged-in: I97ffdd48b64ef5c35267387079204512a093a356
Change-Id: I97ffdd48b64ef5c35267387079204512a093a356
2017-09-27 16:37:54 -07:00
Jeff Vander Stoep
347e1027cf Allow system settings to read /proc/version am: c975bd904f am: 58983a3ef4
am: 4c0933a188

Change-Id: I44aa4737c2fe5293f11370863169aeb21c120dbf
2017-09-27 21:39:41 +00:00
Jeff Vander Stoep
58983a3ef4 Allow system settings to read /proc/version
am: c975bd904f

Change-Id: I576189108f7863076070734b958385d1cd545c5b
2017-09-27 21:34:47 +00:00
Jeff Vander Stoep
c975bd904f Allow system settings to read /proc/version
Used to display kernel version in settings app.

avc: denied { read } for name="version" dev="proc"
scontext=u:r:system_app:s0 tcontext=u:object_r:proc_version:s0
tclass=file permissive=0

Bug: 66985744
Test: kernel version now displayed in settings app.
Change-Id: I53f92f63362b900347fd393a40d70ccf5d220d30
2017-09-27 19:38:23 +00:00
Dan Cashman
852aca050d Fix build.
(This reverts internal commit: 82ca9c2ef4)
Test: None.

Change-Id: I97ffdd48b64ef5c35267387079204512a093a356
2017-09-27 12:32:33 -07:00
Dan Cashman
3e21c5f157 Fix build. Split mediaprovider from priv_app.
This CL was accidentally reverted a second time by commit:
cb5129f9de.  Submit it for the third,
and final, time.

(cherry-pick of 5637587d37
which was in AOSP and internal master but not stage-aosp-master)

Bug: 62102757
Test: Builds and boots.
Change-Id: I0394907e808c737422e644aec452baa3e777cf6f
2017-09-27 12:00:30 -07:00
Dan Cashman
2aa045f1ff resolve merge conflicts of 91d398d8 to stage-aosp-master
Also add missing commit: ca595e1163

Test: I solemnly swear I tested this conflict resolution.
Change-Id: I2a210c3b58565a40117bf3d061e9bf904ed687c2
2017-09-27 09:50:24 -07:00
Dan Cashman
91d398d802 Sync internal master and AOSP sepolicy.
Bug: 37916906
Test: Builds 'n' boots.
Change-Id: Ia1d86264446ebecc1ca79f32f11354921bc77668
Merged-In: I208ec6a864127a059fb389417a9c6b259d7474cb
2017-09-26 14:38:47 -07:00
Tomasz Wasilczyk
6ba6705c51 resolve merge conflicts of c998f319 to stage-aosp-master
Test: after cherry-pick - it builds
Merged-In: I57c0150a52c13f1ce21f9ae2147e3814aad0fb7e
Change-Id: I7da8160a95e09946d283bd849628bd5392410353
2017-09-15 22:04:53 +00:00
Tomasz Wasilczyk
c998f31936 Merge "Move Broadcast Radio HAL to a separate binary." 2017-09-15 20:41:47 +00:00
Tomasz Wasilczyk
26ff5eb6b9 Move Broadcast Radio HAL to a separate binary.
Bug: 63600413
Test: VTS, instrumentation, audit2allow
Test: after cherry-pick - it builds
Change-Id: I57c0150a52c13f1ce21f9ae2147e3814aad0fb7e
(cherry picked from commit 567b947d85)
2017-09-15 10:16:48 -07:00
Tri Vo
82fe6916e3 Merge "Explicitly label logd's dependencies in /proc."
am: cfdbaf3302

Change-Id: I2206c2e99dbfc3c1efd5beee3b73c744187f7c32
2017-09-15 16:55:35 +00:00
Tri Vo
23e90b3e45 Explicitly label logd's dependencies in /proc.
labeled /proc/kmsg as proc_kmsg, changed logd's access from proc to
proc_kmsg, and added a compat mapping.

Bug: 65643247
Test: device boots without selinux denials to the newly introduced proc_kmsg
Test: logd-unit-tests passes
Merged-In: I92c9f5694289eb6a94c4d90f14e2de4d46b5228e
Change-Id: I92c9f5694289eb6a94c4d90f14e2de4d46b5228e
(cherry picked from commit 528da6fe3a)
2017-09-14 22:22:07 +00:00
Tri Vo
87ed5e8dbf Explicitly label logd's dependencies in /proc.
labeled /proc/kmsg as proc_kmsg, changed logd's access from proc to
proc_kmsg, and added a compat mapping.

Bug: 65643247
Test: device boots without selinux denials to the newly introduced proc_kmsg
Test: logd-unit-tests passes

Merged-In: I92c9f5694289eb6a94c4d90f14e2de4d46b5228e
Change-Id: I92c9f5694289eb6a94c4d90f14e2de4d46b5228e
(partial CP of commit 528da6fe3a)
2017-09-14 15:09:33 -07:00
Jin Qian
58858b6145 move e2fs tools from /sbin to /system/bin am: 9b565efcca am: 8b265ddb9f
am: cf3a026f52

Change-Id: Iaae88b3345ebdcfc68282c02341caa8d9e224f9c
2017-09-11 21:31:25 +00:00
Jin Qian
fe9f741c40 allow init to run mke2fs tools to format partitions am: 4de505b6fb am: 5f5f02ee41
am: 6d1ade9340

Change-Id: I58d8669b4ea927ba4ff1f4d549ef487d79caf590
2017-09-11 21:31:20 +00:00
Jin Qian
8b265ddb9f move e2fs tools from /sbin to /system/bin
am: 9b565efcca

Change-Id: I3d797933d7e0762e18734a62d7d6e8e5cc86e555
2017-09-11 20:55:54 +00:00
Jin Qian
5f5f02ee41 allow init to run mke2fs tools to format partitions
am: 4de505b6fb

Change-Id: Ia3b9e772da62866e0020e9699869da3e9d37e2ed
2017-09-11 20:55:51 +00:00
Jin Qian
9b565efcca move e2fs tools from /sbin to /system/bin
Test: let fs_mgr format a damaged /data partition
Bug: 35219933
Change-Id: I379567772c73e52f532a24acf640c21f2bab5c5b
(cherry picked from commit 6d1ecdcb5a)
2017-09-11 18:34:46 +00:00
Jin Qian
4de505b6fb allow init to run mke2fs tools to format partitions
Test: let fs_mgr format a damaged /data partition
Bug: 35219933
Change-Id: If92352ea7a70780e9d81ab10963d63e16b793792
(cherry picked from commit 5f573ab2aa)
2017-09-11 18:34:10 +00:00
Steven Moreland
5b2ebd3b25 Revert "Add screencap domain."
This reverts commit 9216a6adc9.

Bug: 65206688

Merged-In: I8e61b77a1abe9543e4fba77defb8062407676fcf
Change-Id: I8e61b77a1abe9543e4fba77defb8062407676fcf
2017-09-05 10:08:09 -07:00
Steven Moreland
e2e557b238 Revert "Add screencap domain."
am: 60e538377a

Change-Id: Ic262062da2065dddbabaff26f38d779f4e63b95d
2017-09-01 19:45:46 +00:00
Steven Moreland
fa459fc96d Revert "Permissions for screencap saving files to /sdcard/"
am: f606a51e5a

Change-Id: If76f2528ca0edb4f0ad37a85fdc85356ab1e14ae
2017-09-01 19:45:43 +00:00
Steven Moreland
9e0ca36c1a Revert "Add permissions for screencap for dumpstate."
am: 9c571765d1

Change-Id: I5834ea1a451989905c893194857fc77f3bad529e
2017-09-01 19:45:41 +00:00
Steven Moreland
60e538377a Revert "Add screencap domain."
This reverts commit f27bba93d1.

Bug: 65206688

Change-Id: I8e61b77a1abe9543e4fba77defb8062407676fcf
2017-09-01 10:01:20 -07:00
Steven Moreland
f606a51e5a Revert "Permissions for screencap saving files to /sdcard/"
This reverts commit c12c734932.

Bug: 65206688

Change-Id: Ia2a04906f8585bf295b8c75e0b3d09490afb5d24
2017-09-01 10:00:09 -07:00
Steven Moreland
9c571765d1 Revert "Add permissions for screencap for dumpstate."
This reverts commit b5dd44b1ba.

Bug: 65206688

Change-Id: I00431ae7834a562e34e8959446d84a0077834091
2017-09-01 09:59:50 -07:00
Steven Moreland
5b9a78e45f Add permissions for screencap for dumpstate.
am: b5dd44b1ba

Change-Id: Ic8abc28d08483866112dd8075340fe71e82ae653
2017-09-01 03:09:09 +00:00
Steven Moreland
b5dd44b1ba Add permissions for screencap for dumpstate.
screencap domain needs additional permissions for
dumpstate to dump screenshots.

Test: adb shell cmd activity bug-report
Bug: 65206688
Change-Id: I824f345fd90d286454d570576c5888d7719c4c5c
2017-08-31 14:51:19 -07:00
Steven Moreland
fb3fda0ee9 Permissions for screencap saving files to /sdcard/
am: c12c734932

Change-Id: I419f605b03d497d3babd09651b977bc065677c71
2017-08-31 20:22:45 +00:00
Bowgo Tsai
03015901e3 Merge "Moving adbd from rootdir to system/bin"
am: 851d5b64da

Change-Id: Idc8aef8e3d250b7b7f40d0a51a528988f629298c
2017-08-31 06:30:55 +00:00
Steven Moreland
c12c734932 Permissions for screencap saving files to /sdcard/
Before screencap was in its own domain, it was able to do
this by using all of shell's permissions.

The following denials are caused (along with times from running the below test command)
when screencap is invoked to write a file onto the sdcard:
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:23): avc: denied { read } for name="primary" dev="tmpfs" ino=19547 scontext=u:r:screencap:s0 tcontext=u:object_r:storage_file:s0 tclass=lnk_file permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:24): avc: denied { search } for name="/" dev="tmpfs" ino=19529 scontext=u:r:screencap:s0 tcontext=u:object_r:tmpfs:s0 tclass=dir permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:25): avc: denied { search } for name="user" dev="tmpfs" ino=19535 scontext=u:r:screencap:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:26): avc: denied { read } for name="primary" dev="tmpfs" ino=31198 scontext=u:r:screencap:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=lnk_file permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:27): avc: denied { search } for name="/" dev="sdcardfs" ino=1310722 scontext=u:r:screencap:s0 tcontext=u:object_r:sdcardfs:s0 tclass=dir permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:28): avc: denied { write } for name="image.png" dev="sdcardfs" ino=1310764 scontext=u:r:screencap:s0 tcontext=u:object_r:sdcardfs:s0 tclass=file permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:29): avc: denied { open } for path="/storage/emulated/0/image.png" dev="sdcardfs" ino=1310764 scontext=u:r:screencap:s0 tcontext=u:object_r:sdcardfs:s0 tclass=file permissive=1
08-30 21:03:32.009  4986  4986 I screencap: type=1400 audit(0.0:30): avc: denied { write open } for path="/data/media/0/image.png" dev="sda45" ino=1310764 scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
08-30 21:03:32.582  4990  4990 I screencap: type=1400 audit(0.0:31): avc: denied { execute } for name="sh" dev="dm-0" ino=998 scontext=u:r:screencap:s0 tcontext=u:object_r:shell_exec:s0 tclass=file permissive=1
08-30 21:03:32.582  4990  4990 I screencap: type=1400 audit(0.0:32): avc: denied { read open } for path="/system/bin/sh" dev="dm-0" ino=998 scontext=u:r:screencap:s0 tcontext=u:object_r:shell_exec:s0 tclass=file permissive=1
08-30 21:03:32.582  4990  4990 I screencap: type=1400 audit(0.0:33): avc: denied { execute_no_trans } for path="/system/bin/sh" dev="dm-0" ino=998 scontext=u:r:screencap:s0 tcontext=u:object_r:shell_exec:s0 tclass=file permissive=1
08-30 21:03:32.582  4990  4990 I sh      : type=1400 audit(0.0:34): avc: denied { getattr } for path="/system/bin/sh" dev="dm-0" ino=998 scontext=u:r:screencap:s0 tcontext=u:object_r:shell_exec:s0 tclass=file permissive=1
08-30 21:03:32.586  4990  4990 I sh      : type=1400 audit(0.0:35): avc: denied { ioctl } for path="socket:[57515]" dev="sockfs" ino=57515 ioctlcmd=5401 scontext=u:r:screencap:s0 tcontext=u:r:adbd:s0 tclass=unix_stream_socket permissive=1
08-30 21:03:32.586  4990  4990 I sh      : type=1400 audit(0.0:36): avc: denied { getattr } for path="socket:[57515]" dev="sockfs" ino=57515 scontext=u:r:screencap:s0 tcontext=u:r:adbd:s0 tclass=unix_stream_socket permissive=1
08-30 21:03:32.589  4991  4991 I sh      : type=1400 audit(0.0:37): avc: denied { execute_no_trans } for path="/system/bin/am" dev="dm-0" ino=1178 scontext=u:r:screencap:s0 tcontext=u:object_r:system_file:s0 tclass=file permissive=1
08-30 21:03:32.739  4992  4992 I cmd     : type=1400 audit(0.0:38): avc: denied { call } for scontext=u:r:screencap:s0 tcontext=u:r:system_server:s0 tclass=binder permissive=1
08-30 21:03:32.739  4992  4992 I cmd     : type=1400 audit(0.0:39): avc: denied { use } for path="/dev/null" dev="tmpfs" ino=19514 scontext=u:r:system_server:s0 tcontext=u:r:screencap:s0 tclass=fd permissive=1
08-30 21:03:32.739  4992  4992 I cmd     : type=1400 audit(0.0:40): avc: denied { transfer } for scontext=u:r:screencap:s0 tcontext=u:r:system_server:s0 tclass=binder permissive=1
08-30 21:03:32.741   575   575 E SELinux : avc:  denied  { find } for service=activity pid=4992 uid=2000 scontext=u:r:screencap:s0 tcontext=u:object_r:activity_service:s0 tclass=service_manager permissive=1
08-30 21:03:32.749   837   837 I Binder:837_9: type=1400 audit(0.0:41): avc: denied { call } for scontext=u:r:system_server:s0 tcontext=u:r:screencap:s0 tclass=binder permissive=1

If /data/media/ is deleted, the following denials also occur:
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:43): avc: denied { search } for name="0" dev="sda45" ino=1310728 scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:44): avc: denied { read open } for path="/data/media/0" dev="sda45" ino=1310728 scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:48): avc: denied { write } for name="0" dev="sda45" ino=1310728 scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:49): avc: denied { add_name } for name="image.png" scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=dir permissive=1
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:50): avc: denied { create } for name="image.png" scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:51): avc: denied { setattr } for name="image.png" dev="sda45" ino=1310764 scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
08-31 00:45:45.966  8899  8899 I screencap: type=1400 audit(0.0:53): avc: denied { write open } for path="/data/media/0/image.png" dev="sda45" ino=1310764 scontext=u:r:screencap:s0 tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=1
08-31 01:04:29.741  6625  6625 W screencap: type=1400 audit(0.0:23): avc: denied { write } for name="0" dev="sdcardfs" ino=655364 scontext=u:r:screencap:s0 tcontext=u:object_r:sdcardfs:s0 tclass=dir permissive=0

Test: adb shell screencap -p /sdcard/phone.png
Bug: 65206688
Change-Id: I808429b25fa3118fef7931050ab757c9bcd61881
2017-08-30 18:08:28 -07:00
Tomasz Wasilczyk
e325e36570 Merge "Move Broadcast Radio HAL to a separate binary." into oc-mr1-dev
am: 4f6e5b987d

Change-Id: I3054dc9c9c6d43b9d751b5ceca74671112628cfc
2017-08-29 14:10:02 +00:00
Tomasz Wasilczyk
567b947d85 Move Broadcast Radio HAL to a separate binary.
Bug: 63600413
Test: VTS, instrumentation, audit2allow
Change-Id: I57c0150a52c13f1ce21f9ae2147e3814aad0fb7e
2017-08-28 09:44:50 -07:00
Bowgo Tsai
5846c79e80 Moving adbd from rootdir to system/bin
Bug: 63910933
Test: boot sailfish in normal mode, checks adbd is started
Test: boot sailfish in recovery mode, checks adbd is started
Test: boot bullhead in normal mode, checks adbd is started
Test: boot bullhead in recovery mode, checks adbd is started

Change-Id: I35ed78a15a34626fbd3c21d030e2bf51033f7b79
Merged-In: I35ed78a15a34626fbd3c21d030e2bf51033f7b79
(cherry picked from commit e2423d149b)
2017-08-28 17:38:13 +08:00
Mark Salyzyn
3209d827f1 Build Breakage: new *_boot_reason_prop
Test: trust me
Bug: 64687998
Change-Id: I901565222d658917ce5ad7bc280dc4acc0f9e9b7
(cherry picked from commit 267b43a155)
2017-08-25 20:23:06 +00:00
Mark Salyzyn
5249c4277b Merge "Switch /data/misc/reboot/last_reboot_reason to persistent property" am: d27aee3322 am: e028be05dc
am: e5f67cb590

Change-Id: Ie63a32a1b78c63db64a9a3e041c23e0b5953734e
2017-08-25 14:47:56 +00:00
Mark Salyzyn
e028be05dc Merge "Switch /data/misc/reboot/last_reboot_reason to persistent property"
am: d27aee3322

Change-Id: Ia64de6f9da61ce31ae10d8258a3692ce5a0e5815
2017-08-25 14:25:50 +00:00
Jeff Vander Stoep
c5b0b08d02 Merge "Fix label on /dev/input" into oc-mr1-dev
am: 16145a0ce3

Change-Id: Ic912f14595c85a9dc296b4267278910da49eb86e
2017-08-25 01:19:24 +00:00
TreeHugger Robot
16145a0ce3 Merge "Fix label on /dev/input" into oc-mr1-dev 2017-08-25 01:13:26 +00:00
Mark Salyzyn
006c2e9934 Switch /data/misc/reboot/last_reboot_reason to persistent property
Switch from /data/misc/reboot/last_reboot_reason to persistent
Android property persist.sys.boot.reason for indicating why the
device is rebooted or shutdown.

Introduce protection for all boot reason properties

Protect the following properties with these labels

ro.boot.bootreason      u:object_r:bootloader_boot_reason_prop:s0
sys.boot.reason         u:object_r:sys_boot_reason_prop:s0
persist.sys.boot.reason u:object_r:last_boot_reason_prop:s0

Setup the current as-need access rules for each.

ToDo: Remove u:object_r:reboot_data_file after internal fixes.

Test: system/core/bootstat/boot_reason_test.sh
Bug: 64687998
Change-Id: I3771c73933e8ae2d94aee936c7a38b6282611b80
2017-08-24 15:19:30 -07:00
Jeff Vander Stoep
a43209ebd3 Fix label on /dev/input
Commit 780a71e7 changed ueventd's selinux label lookup from /dev/input/
to /dev/input which no longer matches the regex in core policy
file_contexts. Fix the regex to match /dev/input and /dev/input/.

avc: denied { read } for name="input" dev="tmpfs" ino=14092
scontext=u:r:hal_camera_default:s0 tcontext=u:object_r:device:s0
tclass=dir
avc: denied { open } for path="/dev/input" dev="tmpfs"
ino=14092 scontext=u:r:hal_camera_default:s0
tcontext=u:object_r:device:s0 tclass=dir

Change-Id: I8f42f5cd96fc8353bf21d3ee6c3de9e2872f229f
Fixes: 64997761
Fixes: 64954704
Test: no camera HAL denials
2017-08-24 14:33:41 -07:00
Bowgo Tsai
c89e08733b Merge "Moving adbd from rootdir to system/bin" into oc-mr1-dev
am: cf627a49b6

Change-Id: I86aaa7c56cd6a0c6eff73297e9f42eadeeb2c33e
2017-08-18 06:06:54 +00:00
TreeHugger Robot
cf627a49b6 Merge "Moving adbd from rootdir to system/bin" into oc-mr1-dev 2017-08-18 03:52:37 +00:00
Sandeep Patil
a250cf6a55 Merge changes from topic "app_visible_hals" into oc-mr1-dev
am: c5bdf47c9c

Change-Id: I6a782d14a789a9783980504491398c00572bc264
2017-08-17 18:01:19 +00:00
Sandeep Patil
1f525e23fd DO NOT MERGE: use 'expandattribute' for untrusted_app_visible_hwservice
Bug: 62658302
Test: Boot device and observe no new denials

Change-Id: If9a21610897b14a419f276289818127412c29c55
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-08-17 10:49:19 -07:00
Sandeep Patil
b96864eb9b DO NOT MERGE: Add a way to allow untrusted_apps to talk to halserver domains
Vendor HAL extentsions are currently allowed to discover hardware
services that are labelled with 'untrusted_app_visible_hwservice'.
However, the policy doesn't allow these apps to talk to these services.
This CL makes sure that is now possible via the
'untrusted_app_visible_halserver' attribute for vendor domains that host
such a service.

Bug: 64382381
Test: Boot device and observe no new denials.

Change-Id: I1ffc1a62bdf7506a311f5a19acdab8c7caec902b
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-08-17 10:49:08 -07:00
Martijn Coenen
ed6b007455 Merge "Remove display.qservice from service_contexts." am: 109ee5f99c am: 333808edf5 am: f564672689
am: 891f78e0aa

Change-Id: Ib1ea7224da1d6c95b800abfd376f98dc841ec846
2017-08-17 07:54:29 +00:00
Martijn Coenen
891f78e0aa Merge "Remove display.qservice from service_contexts." am: 109ee5f99c am: 333808edf5
am: f564672689

Change-Id: I140a9478fa1e95951a784a499dcae89f7bbbcd73
2017-08-17 07:51:13 +00:00
Martijn Coenen
f564672689 Merge "Remove display.qservice from service_contexts." am: 109ee5f99c
am: 333808edf5

Change-Id: I085967e51ebc74a51a024eed33d4df13e7d65a09
2017-08-17 07:48:43 +00:00