Commit graph

2429 commits

Author SHA1 Message Date
Calin Juravle
6d0b0605ab Merge "Allow system server to record its own profile" am: 6ff840033c
am: 6349325dfc

Change-Id: Id463d93fb7321bebc44495c8f5ebffb0d2aa67f2
2018-05-04 08:20:07 -07:00
Calin Juravle
6ff840033c Merge "Allow system server to record its own profile" 2018-05-04 15:06:24 +00:00
Jeffrey Vander Stoep
b8d870c18b Merge "Revert "FrameworksServicesTests: allow access to test.sys.boot.reason property"" am: bba94f80bb
am: cbae15fd69

Change-Id: I5941463f4252da1c6b77e685b5b4bdd13c53dc1b
2018-05-04 07:35:55 -07:00
Mark Salyzyn
3443cafa98 FrameworksServicesTests: allow access to test.sys.boot.reason property
com.android.server.power.PowerManagerServiceTest#testGetLastShutdownReasonInternal due to "RuntimeException: failed to set system property"

W/roidJUnitRunner: type=1400 audit(0.0:6): avc: denied { write } for name="property_service" dev="tmpfs" ino=13178 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
W/libc    : Unable to set property "test.sys.boot.reason" to "shutdown,thermal": connection failed; errno=13 (Permission denied)

Had to use precise property definition as com.android.phone accesses
test properties as well.

Test: compile
Bug: 78245377
Change-Id: I2cc810846f8615f2a2fae8e0d4f41de585b7abd7
2018-05-04 07:33:56 -07:00
Jeffrey Vander Stoep
bba94f80bb Merge "Revert "FrameworksServicesTests: allow access to test.sys.boot.reason property"" 2018-05-04 14:25:31 +00:00
Jeffrey Vander Stoep
9c6749d772 Revert "FrameworksServicesTests: allow access to test.sys.boot.reason property"
This reverts commit 0ab13a8dff.

Reason for revert: broken presubmit tests
https://sponge.corp.google.com/target?show=FAILED&sortBy=STATUS&id=83e847b2-8e30-4417-9b15-8e66af4b2bc3&target=DeviceBootTest

Change-Id: Id173c8e7fa28ba04070f507098f301f076e4aae7
2018-05-04 06:23:42 +00:00
Calin Juravle
71d8467b75 Allow system server to record its own profile
On userdebug builds we can now profile system server without disabling
selinux. This is the final piece, and allows the system server to save its
own profile.

Test: manual, on a device with system server profiling enabled
Bug: 73313191
Change-Id: Iaf9575d3cda19ae4c38f1e20a8e1b9288b7abc83
2018-05-03 20:15:18 -07:00
yro
db2e6085bb Allow lmkd to log to statsd
Bug: 78603347
Test: build and locally tested
Change-Id: Ib9b041af63d1fac7a689b932e7a2b202fa8d0f83
2018-05-03 16:43:03 -07:00
android-build-prod (mdb)
76f59094b9 Merge "FrameworksServicesTests: allow access to test.sys.boot.reason property" am: 0e055173b1
am: 40f6019c7b

Change-Id: I0792ae4deffa2532315673d824502fc8c03e3651
2018-05-03 16:38:34 -07:00
android-build-prod (mdb)
0e055173b1 Merge "FrameworksServicesTests: allow access to test.sys.boot.reason property" 2018-05-03 23:21:58 +00:00
Yao Chen
78e3ed447a Allow lmkd to log to statsd
Bug: 78603347
Test: build and locally tested
Change-Id: I7e4eb8ebb2c1a0b7d684b471141da991a19bc98d
2018-05-03 16:15:38 -07:00
android-build-prod (mdb)
def10bbc6f Merge "Sepolicy: Fix system server calling perfprofd" am: fc9afc4d2b
am: 9938a72f6e

Change-Id: I35335a2d0d767b5cc6b45d3414129ece987bd93c
2018-05-03 13:27:25 -07:00
android-build-prod (mdb)
fc9afc4d2b Merge "Sepolicy: Fix system server calling perfprofd" 2018-05-03 20:12:40 +00:00
Tri Vo
bfe1e42143 Merge "SELinux type for vendor public libs." am: 59e9d2d8c9
am: 9d99ee2316

Change-Id: I50978971a2cf6221024d91edde0cb85b9415f7be
2018-05-03 13:11:21 -07:00
Andreas Gampe
986b9af4fa Sepolicy: Fix system server calling perfprofd
Give all the right permissions to find and send a message to
perfprofd from the system server.

Bug: 73175642
Test: m
Test: manual
Change-Id: I82b63ec097dcd445d9e8169fe0df4398d62ac184
2018-05-03 10:57:30 -07:00
Mark Salyzyn
0ab13a8dff FrameworksServicesTests: allow access to test.sys.boot.reason property
com.android.server.power.PowerManagerServiceTest#testGetLastShutdownReasonInternal due to "RuntimeException: failed to set system property"

W/roidJUnitRunner: type=1400 audit(0.0:6): avc: denied { write } for name="property_service" dev="tmpfs" ino=13178 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
W/libc    : Unable to set property "test.sys.boot.reason" to "shutdown,thermal": connection failed; errno=13 (Permission denied)

Test: compile
Bug: 78245377
Change-Id: Id21436d281bab27823969a9f7e92318d70b5a2d6
2018-05-03 16:45:36 +00:00
Tri Vo
29497b623e SELinux type for vendor public libs.
Vendor public libs are exposed to apps (not system), and their ABI
stability is guaranteed by vendor. Introducing new selinux type so that
we don't conflate concepts of same-process HAL and vendor public lib.
The former is exposed to all domains, while the latter should only be
acessible by apps.

Bug: 76413554
Test: build-only change, policy builds
Change-Id: I89dad351374f46c7fe2726991eb4c05064c37ed5
2018-05-02 14:51:05 -07:00
android-build-prod (mdb)
5afce15046 Merge "Audit generic debugfs access for removal" am: 65352c904a
am: 810ad5f27b

Change-Id: I8e5cf7eaf9eb290090adfb5c2821a7efdd9e1acf
2018-05-01 23:11:36 -07:00
android-build-prod (mdb)
65352c904a Merge "Audit generic debugfs access for removal" 2018-05-02 06:00:04 +00:00
Jeff Vander Stoep
2fbb456418 adbd: dontaudit sys_resource denials am: 621668568a
am: 19e74c5686

Change-Id: I63873f2ef53e0cf99186029dc702cc2eca78ad54
2018-05-01 16:49:55 -07:00
Jeff Vander Stoep
621668568a adbd: dontaudit sys_resource denials
avc: denied { sys_resource } for comm="adbd" capability=24
scontext=u:r:adbd:s0 tcontext=u:r:adbd:s0 tclass=capability

Test: build aosp_sailfish-userdebug
Bug: 78935353
Change-Id: I094e54cbd61245d368f3164e30222dfdff902ffa
2018-05-01 23:38:13 +00:00
android-build-prod (mdb)
92b6793d11 Merge "Setting up sepolicies for statsd planB of listening to its own socket" 2018-05-01 02:20:46 +00:00
android-build-team Robot
bbb500d705 Merge "Adding labeling for vendor security patch prop am: 5cac1aa99c am: ad3602d262" into pi-dev 2018-04-30 20:42:38 +00:00
android-build-team Robot
b6e1ad6105 Merge "Move automotive HALs sepolicy to system/" into pi-dev
am: 26ee5a8590

Change-Id: Ifc8dfb550ed04335140a7f625dd0cef3fa89148e
2018-04-27 15:19:02 -07:00
android-build-team Robot
26ee5a8590 Merge "Move automotive HALs sepolicy to system/" into pi-dev 2018-04-27 22:11:56 +00:00
Jeff Vander Stoep
72edbb3e83 Audit generic debugfs access for removal
Bug: 78784387
Test: adb bugreport with no "granted" messages.
Change-Id: Iaea67f356a47a9fbf6b8649fc8e8dad772996ba7
2018-04-27 13:46:34 -07:00
Paul Crowley
216687a205 Allow vold_prepare_subdirs to delete more files.
am: 0fe31e04ea

Change-Id: I6509562b48706334c31a22325c5ff19c51c7d9e9
2018-04-27 08:49:07 -07:00
Paul Crowley
0fe31e04ea Allow vold_prepare_subdirs to delete more files.
Bug: 78591623
Test: Create a new user with a fingerprint. Reboot. Delete that user.
    Check for denials, files left over in /data/*_{c,d}e/10
Merged-In: Ib818e112a98c5b954ee829e93ebd69c3b12940cf
Change-Id: Ib818e112a98c5b954ee829e93ebd69c3b12940cf
2018-04-26 16:02:06 -07:00
Paul Crowley
8096639792 Allow vold_prepare_subdirs to delete more files.
Bug: 78591623
Test: Create a new user with a fingerprint. Reboot. Delete that user.
    Check for denials, files left over in /data/*_{c,d}e/10
Merged-In: Ib818e112a98c5b954ee829e93ebd69c3b12940cf
Change-Id: Ib818e112a98c5b954ee829e93ebd69c3b12940cf
2018-04-26 15:26:11 -07:00
Max Bires
30d80f0c1c Adding labeling for vendor security patch prop am: 5cac1aa99c
am: ad3602d262

Test: Vendor security patch prop is properly labeled
Bug: 76428542
Change-Id: I034f2f2c9eab3667cfa92ea41b4b5f4afa1c7df7
Merged-In: I034f2f2c9eab3667cfa92ea41b4b5f4afa1c7df7
(cherry picked from commit 15a9fbc277)
2018-04-26 01:36:23 +00:00
yro
64c7a758b4 Setting up sepolicies for statsd planB of listening to its own socket
Test: manual
Bug: 78318738
Change-Id: I45c3511860fbe6a1de45c6930052a8865b38986a
2018-04-25 02:20:36 -07:00
TreeHugger Robot
1818b11242 Merge "Track otapreopt_chroot postinstall_file SELinux denial." into pi-dev 2018-04-25 03:22:47 +00:00
Joel Galenson
aa4d582fbe Merge "Track otapreopt_chroot postinstall_file SELinux denial." am: fd87a92acf
am: d78b112efe

Change-Id: I030048f34578b10559c6e38bb5db2b6eead74e11
2018-04-24 12:30:25 -07:00
Joel Galenson
81f4377aba Track otapreopt_chroot postinstall_file SELinux denial.
Bug: 75287236
Test: Built policy.
Change-Id: I90301c33fd8c20e96cfbb424eaf80978e79c34f0
(cherry picked from commit 5c87b8797b)
2018-04-24 12:22:33 -07:00
Treehugger Robot
fd87a92acf Merge "Track otapreopt_chroot postinstall_file SELinux denial." 2018-04-24 19:21:54 +00:00
Steven Moreland
700337d2ee Merge "Allow dumpstate to be used as a lazy HAL." into pi-dev
am: faef020c89

Change-Id: Ibcce766b28f23960f482e3ff5c3a7361e11f9652
2018-04-24 11:21:34 -07:00
TreeHugger Robot
faef020c89 Merge "Allow dumpstate to be used as a lazy HAL." into pi-dev 2018-04-24 18:14:51 +00:00
Paul Crowley
67861bcc03 Add metadata_file class for root of metadata folder. am: 42bd1638bf
am: b494ab07fb

Change-Id: I25139c13561468d585814daa2f79b35a390730ee
2018-04-24 10:41:23 -07:00
Paul Crowley
1fb3bfba78 Merge "Add metadata_file class for root of metadata folder." into pi-dev 2018-04-24 17:32:52 +00:00
Joel Galenson
5c87b8797b Track otapreopt_chroot postinstall_file SELinux denial.
Bug: 75287236
Test: Built policy.
Change-Id: I90301c33fd8c20e96cfbb424eaf80978e79c34f0
2018-04-24 10:25:22 -07:00
Steven Moreland
0b1797b852 Allow dumpstate to be used as a lazy HAL.
hwservicemanager lost the permission to tell init to
start the dumpstate HAL when dumpstate was given this
permission exclusively.

Bug: 77489941 # problem introduced
Bug: 78509314 # converting dumpstate to lazy hals

Test: convert an instance of dumpstate into a lazy HAL,
    run bugreport, see denial, then add permission, and
    see bugreport start to work again.

Change-Id: I033701d8306200bebc0f250afe3d08f9e6ab98a1
2018-04-24 09:38:15 -07:00
TreeHugger Robot
95758f47ee Merge "Remove some priv_app logspam." into pi-dev 2018-04-24 15:44:55 +00:00
Wei Wang
5154fc1fb2 Merge "Allow dumpstate to kill dumpstate vendor HAL in timeout case" into pi-dev
am: d45dfbff95

Change-Id: I90a0270b7820073bcee257f5a11c1d2407f8d841
2018-04-23 21:27:17 -07:00
Wei Wang
d45dfbff95 Merge "Allow dumpstate to kill dumpstate vendor HAL in timeout case" into pi-dev 2018-04-24 04:24:04 +00:00
Pavel Maltsev
394dbe34a0 Move automotive HALs sepolicy to system/
Bug: 70637118
Test: build, flash and boot bat_land and owl automotive builds

Change-Id: I6db23258de30174d6db09d241e91b08aa5afedef
2018-04-23 15:46:41 -07:00
Howard Ro
c0457cd85f Merge "Allow radio to write to statsd" into pi-dev
am: bcbd8198c4

Change-Id: I636e6fde5589d49d245ab672e7142cf65f831124
2018-04-23 15:32:28 -07:00
Howard Ro
bcbd8198c4 Merge "Allow radio to write to statsd" into pi-dev 2018-04-23 22:23:02 +00:00
TreeHugger Robot
1501463bd0 Merge "Track radio SELinux denial." into pi-dev 2018-04-23 22:18:04 +00:00
Wei Wang
60d1767459 Allow dumpstate to kill dumpstate vendor HAL in timeout case
Bug: 77489941
Test: simulate delay in dumpstate HAL and get BR, see below from dumpstate_log.txt
    dumpstateBoard timed out after 10s, killing dumpstate vendor HAL
    dumpstateBoard failed: Status(EX_TRANSACTION_FAILED): 'DEAD_OBJECT: '
Change-Id: I90ed5cb8fe8da8ad21ae77676433936cb12d9d04
2018-04-23 14:41:25 -07:00
Paul Crowley
42bd1638bf Add metadata_file class for root of metadata folder.
Bug: 77335096
Test: booted device with metadata encryption and without
Change-Id: I5bc5d46deb4e91912725c4887fde0c3a41c9fc91
2018-04-23 14:14:49 -07:00
Joel Galenson
bed48fb621 Track radio SELinux denial. am: 8c0d460907
am: 10d84e190d

Change-Id: I2c0f8d4527293b4f7e81d982edb45e12efb3ea5f
2018-04-23 11:22:13 -07:00
Joel Galenson
b26bc7d642 Track radio SELinux denial.
This should help fix presubmit tests.

Bug: 78456764
Test: Built policy.
Change-Id: I7ec5afa83417770731d309d5a57b8a94afa24453
(cherry picked from commit 8c0d460907)
2018-04-23 11:12:17 -07:00
Joel Galenson
8c0d460907 Track radio SELinux denial.
This should help fix presubmit tests.

Bug: 78456764
Test: Built policy.
Change-Id: I7ec5afa83417770731d309d5a57b8a94afa24453
2018-04-23 09:38:24 -07:00
Lalit Maganti
00c8e3d95a sepolicy: allow shell to read/write traced prop
This is to fix the CTS failures given by the bugs below where devices
where traced is not enabled by default causes test failures.

(cherry picked from commit 673b4db777)

Bug: 78215159
Bug: 78347829
Change-Id: Ib0f6a1cdb770528dbbeb857368534ff5040e464e
2018-04-23 16:18:34 +00:00
yro
af8fb9f739 Allow radio to write to statsd
The corresponding change in aosp is made at aosp/669146

Violation:
04-23 10:51:03.926  2103  2103 W m.android.phone: type=1400 audit(0.0:8): avc: denied { write } for name="statsdw" dev="tmpfs" ino=22538 scontext=u:r:radio:s0 tcontext=u:object_r:statsdw_socket:s0 tclass=sock_file permissive=0

Bug: 78318738
Test: manual
Change-Id: I8aa70b07281df8a732f2f99d4d323961e425feea
2018-04-23 08:38:34 -07:00
Lalit Maganti
917d7d74ef sepolicy: allow shell to read/write traced prop am: 673b4db777
am: 45e5338233

Change-Id: I6aa1a6e91b5c3ff3869ed3dd60c5569aff16662a
2018-04-23 03:28:10 -07:00
Lalit Maganti
673b4db777 sepolicy: allow shell to read/write traced prop
This is to fix the CTS failures given by the bugs below where devices
where traced is not enabled by default causes test failures.

Bug: 78215159
Bug: 78347829
Change-Id: Ib0f6a1cdb770528dbbeb857368534ff5040e464e
2018-04-23 09:55:04 +00:00
yro
cd3c5d816e Merge "Setting up sepolicies for statsd planB of listening to its own socket" into pi-dev
am: 51baefaf2c

Change-Id: I7f7627dadec376fe82a3054eda990dfca08d4cd9
2018-04-20 19:57:19 -07:00
Joel Galenson
8e3d9484f4 Remove some priv_app logspam. am: 9ec59f6cb9
am: e74a878fc2

Change-Id: I2eb83134219db304c7a53e500b751dc7aee494bd
2018-04-20 17:30:09 -07:00
Joel Galenson
f5cfaa098e Remove some priv_app logspam.
avc: denied { search } for name="/" scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:fs_bpf:s0 tclass=dir permissive=0

Bug: 72749888
Test: Boot without seeing the denial.
Change-Id: Iaf3559928473c68066e6a42ba71655a683861901
(cherry picked from commit 9ec59f6cb9)
2018-04-20 15:48:39 -07:00
Joel Galenson
9ec59f6cb9 Remove some priv_app logspam.
avc: denied { search } for name="/" scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:fs_bpf:s0 tclass=dir permissive=0

Bug: 72749888
Test: Boot without seeing the denial.
Change-Id: Iaf3559928473c68066e6a42ba71655a683861901
2018-04-20 15:33:26 -07:00
yro
93c16bda16 Setting up sepolicies for statsd planB of listening to its own socket
Test: manual
Bug: 78318738

Change-Id: Ifa1cbbfdbb5acb713dfeb1d4bf98d1e116e5a89b
2018-04-20 13:57:54 -07:00
Paul Crowley
5f79b334ff Add metadata_file class for root of metadata folder.
Bug: 77335096
Test: booted device with metadata encryption and without
Change-Id: I5bc5d46deb4e91912725c4887fde0c3a41c9fc91
2018-04-20 11:14:49 -07:00
Alan Stokes
8deca65599 Merge "Remove fixed bug from bug_map." am: e03074b4d1
am: 353d1af696

Change-Id: I29d806f96c95719b66f9330f3e360d5d224a0e69
2018-04-20 01:40:12 -07:00
Alan Stokes
e03074b4d1 Merge "Remove fixed bug from bug_map." 2018-04-20 08:28:02 +00:00
Chong Zhang
fad90d552f Merge "Allow system_server to adjust cpuset for media.codec" into pi-dev
am: ad3529a855

Change-Id: I739cc56d8fa130a4d1dca7db55fe1cfd968d0113
2018-04-19 11:23:08 -07:00
TreeHugger Robot
ad3529a855 Merge "Allow system_server to adjust cpuset for media.codec" into pi-dev 2018-04-19 17:40:39 +00:00
Jeff Vander Stoep
df6d77cd45 Protect dropbox service data with selinux am: 4d3ee1a5b6
am: 1874950d21

Change-Id: Id2e5359054ae6d1882b0c99011ee09d1b75fa604
2018-04-18 15:05:34 -07:00
Jeff Vander Stoep
4d3ee1a5b6 Protect dropbox service data with selinux
Create a new label for /data/system/dropbox, and neverallow direct
access to anything other than init and system_server.

While all apps may write to the dropbox service, only apps with
android.permission.READ_LOGS, a signature|privileged|development
permission, may read them. Grant access to priv_app, system_app,
and platform_app, and neverallow access to all untrusted_apps.

Bug: 31681871
Test: atest CtsStatsdHostTestCases
Test: atest DropBoxTest
Test: atest ErrorsTests
Change-Id: Ice302b74b13c4d66e07b069c1cdac55954d9f5df
2018-04-18 19:53:03 +00:00
Tri Vo
5a5894a979 Merge "Sepolicy for rw mount point for vendors." 2018-04-18 19:32:32 +00:00
Alan Stokes
62913dbfd2 Remove fixed bug from bug_map.
Bug: 77816522
Bug: 73947096

Test: Flashed device, no denial seen
Change-Id: Ib2f1fc670c9a76abbb9ff6747fec00fa5bcde5af
2018-04-18 17:11:45 +01:00
Alan Stokes
051b47c865 Merge "Revert "Revert "Add /sys/kernel/memory_state_time to sysfs_power.""" am: a87a8db2ac
am: e6fa185ae6

Change-Id: Ie57c8b2a0d99148b16383a5f4199c10ad7c5210a
2018-04-18 02:47:49 -07:00
TreeHugger Robot
bc9f22a654 Merge "NO PARTIAL RERUN Statsd sepolicy hal_health" into pi-dev 2018-04-17 23:16:44 +00:00
Chong Zhang
ec0160a891 Allow system_server to adjust cpuset for media.codec
Bug: 72841545
Change-Id: I30c1758e631a57f453598e60e6516da1874afcbf
2018-04-17 14:24:57 -07:00
Bookatz
055a958dad NO PARTIAL RERUN
Statsd sepolicy hal_health

Statsd monitors battery capacity, which requires calls to the health
hal.

Fixes: 77923174
Bug: 77916472
Test: run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.HostAtomTests#testFullBatteryCapacity
Merged-In: I2d6685d4b91d8fbc7422dfdd0b6ed96bbddc0886
Change-Id: I767068c60cff6c1baba615d89186705107531c02
2018-04-17 21:23:31 +00:00
Tri Vo
8c1a1b2472 Sepolicy for rw mount point for vendors.
Bug: 64905218
Test: device boots with /mnt/vendor present and selinux label
mnt_vendor_file applied correctly.
Change-Id: Ib34e2859948019d237cf2fe8f71845ef2533ae27
Merged-In: Ib34e2859948019d237cf2fe8f71845ef2533ae27
(cherry picked from commit 210a805b46)
2018-04-17 21:04:15 +00:00
Tri Vo
5fd38baf04 Merge "Sepolicy for rw mount point for vendors." into pi-dev
am: ae0b835c58

Change-Id: I72eb24a252571974b8732facf500a6f23eb9ccf1
2018-04-17 13:42:27 -07:00
TreeHugger Robot
ae0b835c58 Merge "Sepolicy for rw mount point for vendors." into pi-dev 2018-04-17 19:16:56 +00:00
Alan Stokes
19b03639a8 Revert "Revert "Add /sys/kernel/memory_state_time to sysfs_power.""
This reverts commit 12e73685b7.

Reason for revert: Rolling original change forward again, more carefully.

Change-Id: I266b181915c829d743c6d8d0b8c0d70b6bf3d620
2018-04-17 16:02:03 +00:00
TreeHugger Robot
f03783609f Merge "Let vold_prepare_subdirs completely clean deleted user data." into pi-dev 2018-04-17 15:44:13 +00:00
TreeHugger Robot
53b0486de6 Merge "Add bug_map entries for bugs we've seen." into pi-dev 2018-04-17 04:02:40 +00:00
Bookatz
f09f56f65a Merge "Statsd sepolicy hal_health" am: ced43bc823
am: bdc1197af7

Change-Id: Ifdef191044383b589280bbae5d193caac59a8005
2018-04-16 17:19:06 -07:00
Joel Galenson
1a4c83a856 Let vold_prepare_subdirs completely clean deleted user data. am: 254a872cab
am: 397c854db6

Change-Id: I635703793fe5b980087900aa8cfcaacb402c101f
2018-04-16 17:03:10 -07:00
Treehugger Robot
ced43bc823 Merge "Statsd sepolicy hal_health" 2018-04-16 23:51:12 +00:00
Joel Galenson
2bae5b9693 Let vold_prepare_subdirs completely clean deleted user data.
After adding a new user, deleting it, and rebooting, some of the user's data still remained.  This adds the SELinux permissions necessary to remove all of the data.  It fixes the followign denials:

avc: denied { rmdir } for scontext=u:r:vold_prepare_subdirs:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir
avc: denied { unlink } for scontext=u:r:vold_prepare_subdirs:s0 tcontext=u:object_r:system_data_file:s0 tclass=file

Bug: 74866238
Test: Create user, delete user, reboot user, see no denials or
leftover data.

Change-Id: Ibc43bd2552b388a9708bf781b5ad206f21df62dc
(cherry picked from commit 254a872cab)
2018-04-16 16:40:52 -07:00
Joel Galenson
254a872cab Let vold_prepare_subdirs completely clean deleted user data.
After adding a new user, deleting it, and rebooting, some of the user's data still remained.  This adds the SELinux permissions necessary to remove all of the data.  It fixes the followign denials:

avc: denied { rmdir } for scontext=u:r:vold_prepare_subdirs:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir
avc: denied { unlink } for scontext=u:r:vold_prepare_subdirs:s0 tcontext=u:object_r:system_data_file:s0 tclass=file

Bug: 74866238
Test: Create user, delete user, reboot user, see no denials or
leftover data.

Change-Id: Ibc43bd2552b388a9708bf781b5ad206f21df62dc
2018-04-16 16:39:43 -07:00
Joel Galenson
18350e71c7 Merge "Add bug_map entries for bugs we've seen." am: e1ee3535be
am: 2b15785f00

Change-Id: I4112a2adbfc4cd97ac42c09c6c8d8adcbd3bad6a
2018-04-16 16:13:57 -07:00
Joel Galenson
fb0aed7451 Add bug_map entries for bugs we've seen.
This adds numerous bug_map entries to try to annotate all denials
we've seen.

Bug: 78117980
Test: Build
Change-Id: I1da0690e0b4b0a44d673a54123a0b49a0d115a49
(cherry picked from commit f55786cfce)
2018-04-16 15:57:47 -07:00
Jeff Sharkey
b469c30069 Add exFAT support; unify behind "sdcard_type".
We're adding support for OEMs to ship exFAT, which behaves identical
to vfat.  Some rules have been manually enumerating labels related
to these "public" volumes, so unify them all behind "sdcard_type".

Test: atest
Bug: 67822822
Change-Id: I09157fd1fc666ec5d98082c6e2cefce7c8d3ae56
2018-04-16 12:49:10 -06:00
Tri Vo
210a805b46 Sepolicy for rw mount point for vendors.
Bug: 64905218
Test: device boots with /mnt/vendor present and selinux label
mnt_vendor_file applied correctly.
Change-Id: Ib34e2859948019d237cf2fe8f71845ef2533ae27
2018-04-16 11:07:40 -07:00
Joel Galenson
f55786cfce Add bug_map entries for bugs we've seen.
This adds numerous bug_map entries to try to annotate all denials
we've seen.

Bug: 78117980
Test: Build
Change-Id: I1da0690e0b4b0a44d673a54123a0b49a0d115a49
2018-04-16 10:31:38 -07:00
Jeff Sharkey
ea3997beab Merge "Add exFAT support; unify behind "sdcard_type"." am: ba89007178
am: ff0369ad4c

Change-Id: I3d323c85ff019824be74fa6887b0578f308e6251
2018-04-14 16:28:52 -07:00
Jeff Sharkey
ba89007178 Merge "Add exFAT support; unify behind "sdcard_type"." 2018-04-13 23:47:54 +00:00
Treehugger Robot
9935689982 Merge "whitelist test failure that bypassed presubmit" 2018-04-13 23:06:19 +00:00
Jeff Vander Stoep
4c402df7e3 whitelist test failure that bypassed presubmit
avc: denied { read } for comm="batterystats-wo" name="show_stat" dev="sysfs"
scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs:s0 tclass=file

Bug: 77816522
Test: build
Change-Id: I50a9bfe1a9e4df9c84cf4b2b4aedbb8f82ac94cd
(cherry picked from commit 2ccd99a53a)
2018-04-13 14:36:11 -07:00
Joel Galenson
6b51856d0e Merge "Allow some vold_prepare_subdirs denials." into pi-dev
am: cdc68c652d

Change-Id: I7a2898cbbb77d8c2b88c50617e373423df13fe56
2018-04-13 14:24:47 -07:00
Treehugger Robot
bf41ff48cf Merge "Allow some vold_prepare_subdirs denials." 2018-04-13 20:44:44 +00:00
TreeHugger Robot
e1801fa733 Merge "Track storaged SELinux denial." into pi-dev 2018-04-13 20:41:25 +00:00
Jeff Sharkey
000cafc701 Add exFAT support; unify behind "sdcard_type".
We're adding support for OEMs to ship exFAT, which behaves identical
to vfat.  Some rules have been manually enumerating labels related
to these "public" volumes, so unify them all behind "sdcard_type".

Test: atest
Bug: 67822822
Change-Id: I09157fd1fc666ec5d98082c6e2cefce7c8d3ae56
2018-04-13 14:08:10 -06:00
Joel Galenson
2b840913d8 Track storaged SELinux denial.
This should help fix presubmit tests.

Bug: 77634061
Test: Built policy.
Change-Id: Ib9f15c93b71c2b67f25d4c9f949a5e2b3ce93b9c
(cherry picked from commit c6b5a96bb6)
2018-04-13 10:36:12 -07:00
Joel Galenson
fc870ce954 Allow some vold_prepare_subdirs denials.
This addresses the following denials:

avc: denied { fowner } for comm="rm" scontext=u:r:vold_prepare_subdirs:s0 tcontext=u:r:vold_prepare_subdirs:s0 tclass=capability
avc: denied { getattr } for comm="rm" scontext=u:r:vold_prepare_subdirs:s0 tcontext=u:object_r:storaged_data_file:s0 tclass=file
avc: denied { relabelfrom } for comm="vold_prepare_su" name="storaged" scontext=u:r:vold_prepare_subdirs:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir
avc: denied { getattr } for comm="rm" scontext=u:r:vold_prepare_subdirs:s0 tcontext=u:object_r:system_data_file:s0 tclass=file

Bug: 77875245
Test: Boot device.
Test: Mislabel directories used by vold_prepare_subdirs, reboot, and
ensure it can relabel them without denials.
Test: Add user, reboot, delete user, reboot, observe no denials.

(cherry picked from commit 855dd5a856)

Merged-In: Id67bc99f151a6ccb9619bbfb7080452956405121
Change-Id: I2f6b5abfaf81570d03a30f2edf7296b5afd10c9b
2018-04-13 09:47:58 -07:00
Joel Galenson
44b6a7c3e2 Allow some vold_prepare_subdirs denials.
This addresses the following denials:

avc: denied { fowner } for comm="rm" scontext=u:r:vold_prepare_subdirs:s0 tcontext=u:r:vold_prepare_subdirs:s0 tclass=capability
avc: denied { getattr } for comm="rm" scontext=u:r:vold_prepare_subdirs:s0 tcontext=u:object_r:storaged_data_file:s0 tclass=file
avc: denied { relabelfrom } for comm="vold_prepare_su" name="storaged" scontext=u:r:vold_prepare_subdirs:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir
avc: denied { getattr } for comm="rm" scontext=u:r:vold_prepare_subdirs:s0 tcontext=u:object_r:system_data_file:s0 tclass=file

Bug: 77875245
Test: Boot device.
Test: Mislabel directories used by vold_prepare_subdirs, reboot, and
ensure it can relabel them without denials.
Test: Add user, reboot, delete user, reboot, observe no denials.

(cherry picked from commit 855dd5a856)

Merged-In: Id67bc99f151a6ccb9619bbfb7080452956405121
Change-Id: Ic86be1e1afed37602255448e5700811d197403f9
2018-04-13 09:46:00 -07:00
Jaekyun Seok
296734312e Whitelist vendor-init-settable bluetooth_prop and wifi_prop am: 224921d18a
am: 21026c55f9

Change-Id: If61c950aad21beb7887f4fc833c27906624abc1e
2018-04-12 19:36:08 -07:00
Jaekyun Seok
a11b16c9ee Whitelist vendor-init-settable bluetooth_prop and wifi_prop
Values of the following properties are set by SoC vendors on some
devices including Pixels.
- persist.bluetooth.a2dp_offload.cap
- persist.bluetooth.a2dp_offload.enable
- persist.vendor.bluetooth.a2dp_offload.enable
- ro.bt.bdaddr_path
- wlan.driver.status

So they should be whitelisted for compatibility.

Bug: 77633703
Test: succeeded building and tested with Pixels
Change-Id: Ib2b81bcc1fd70ddd571dc7fb2b923b576d62b7d5
Merged-In: Ib2b81bcc1fd70ddd571dc7fb2b923b576d62b7d5
(cherry picked from commit 224921d18a)
2018-04-13 11:08:48 +09:00
Jaekyun Seok
224921d18a Whitelist vendor-init-settable bluetooth_prop and wifi_prop
Values of the following properties are set by SoC vendors on some
devices including Pixels.
- persist.bluetooth.a2dp_offload.cap
- persist.bluetooth.a2dp_offload.enable
- persist.vendor.bluetooth.a2dp_offload.enable
- ro.bt.bdaddr_path
- wlan.driver.status

So they should be whitelisted for compatibility.

Bug: 77633703
Test: succeeded building and tested with Pixels
Change-Id: Ib2b81bcc1fd70ddd571dc7fb2b923b576d62b7d5
2018-04-13 09:25:06 +09:00
TreeHugger Robot
cb336d8965 Merge "Suppress spurious denial" into pi-dev 2018-04-12 19:04:58 +00:00
Bookatz
1300945c12 Statsd sepolicy hal_health
Statsd monitors battery capacity, which requires calls to the health
hal.

Fixes: 77923174
Bug: 77916472
Test: run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.HostAtomTests#testFullBatteryCapacity
Change-Id: I2d6685d4b91d8fbc7422dfdd0b6ed96bbddc0886
2018-04-12 09:34:00 -07:00
Treehugger Robot
45c72ddfcf Merge "priv_app: remove more logspam" 2018-04-12 16:23:20 +00:00
TreeHugger Robot
96805f15b6 Merge "hal_tetheroffload: move hwservice mapping to core policy" into pi-dev 2018-04-12 03:59:29 +00:00
Jeff Vander Stoep
2d39f54cb6 Merge "hal_tetheroffload: move hwservice mapping to core policy" am: e0163411f8
am: e63f0e9c9d

Change-Id: Ib6b1721b59b6df2944584a3236076885c9218930
2018-04-11 17:46:45 -07:00
Treehugger Robot
e0163411f8 Merge "hal_tetheroffload: move hwservice mapping to core policy" 2018-04-12 00:34:22 +00:00
Jeff Vander Stoep
8f126091e0 Merge changes If2413c30,Ic5d7c961 am: 45b4704e01
am: 1382984cfc

Change-Id: Icc3cd3d88873627f93cb59f69083b0c68f1a51ea
2018-04-11 15:06:17 -07:00
Jeff Vander Stoep
c41f5b8465 hal_tetheroffload: move hwservice mapping to core policy
Addresses:
avc: denied { find } for
interface=android.hardware.tetheroffload.config::IOffloadConfig
scontext=u:r:system_server:s0
tcontext=u:object_r:default_android_hwservice:s0
tclass=hwservice_manager

Bug: 77855688
Test: build/boot Sailfish, turn on tethering, no selinux denial
Change-Id: I97cae0928b5311a4da41d19cbd5c863c3137a49f
(cherry picked from commit 3a346ea732)
2018-04-11 15:03:13 -07:00
Jeff Vander Stoep
3a346ea732 hal_tetheroffload: move hwservice mapping to core policy
Addresses:
avc: denied { find } for
interface=android.hardware.tetheroffload.config::IOffloadConfig
scontext=u:r:system_server:s0
tcontext=u:object_r:default_android_hwservice:s0
tclass=hwservice_manager

Bug: 77855688
Test: build/boot Sailfish, turn on tethering, no selinux denial
Change-Id: I97cae0928b5311a4da41d19cbd5c863c3137a49f
2018-04-11 14:52:48 -07:00
Treehugger Robot
45b4704e01 Merge changes If2413c30,Ic5d7c961
* changes:
  Suppress spurious denial
  Suppress spurious denial
2018-04-11 21:51:37 +00:00
Jeff Vander Stoep
7e5ec2bc3d Suppress spurious denial
Addresses:
avc: denied { sys_resource } scontext=u:r:zygote:s0
tcontext=u:r:zygote:s0 tclass=capability

Bug: 77905989
Test: build and flash taimen-userdebug
Change-Id: If2413c3005df02a70661464d695211acbcda4094
(cherry picked from commit 816e744d998cb327fbd20f3124b22398bea2b8e4)
2018-04-11 12:20:32 -07:00
Jeff Vander Stoep
f7a7f7d138 Suppress spurious denial
Addresses:
avc: denied { sys_resource } for comm="ip6tables" capability=24
scontext=u:r:netutils_wrapper:s0 tcontext=u:r:netutils_wrapper:s0
tclass=capability

Bug: 77905989
Test: build and flash taimen-userdebug
Change-Id: Ic5d7c96152b96b55255eeec00b19948f38c1923c
(cherry picked from commit 443a43c981)
2018-04-11 12:19:46 -07:00
Jeff Vander Stoep
443a43c981 Suppress spurious denial
Addresses:
avc: denied { sys_resource } for comm="ip6tables" capability=24
scontext=u:r:netutils_wrapper:s0 tcontext=u:r:netutils_wrapper:s0
tclass=capability

Bug: 77905989
Test: build and flash taimen-userdebug
Change-Id: Ic5d7c96152b96b55255eeec00b19948f38c1923c
2018-04-11 11:08:01 -07:00
Max Bires
a949ddb5ce Merge "Adding ability for priv apps to read traceur fd"
am: 8966b8e53d

Bug: 74435522
Test: traceur can share to betterbug
Change-Id: Ic24196b6a4050696d92f18a6879c569ccf5eaec7
(cherry picked from commit f66fd5226f)
2018-04-10 23:42:00 +00:00
Jeff Vander Stoep
9dc1d5381f priv_app: remove more logspam
avc: denied { read } for name="ext4" dev="sysfs" ino=32709
scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:sysfs:s0
tclass=dir permissive=0 b/72749888
avc: denied { read } for name="state" dev="sysfs" ino=51318
scontext=u:r:priv_app:s0:c512,c768
tcontext=u:object_r:sysfs_android_usb:s0 tclass=file permissive=0
b/72749888

Bug: 72749888
Test: build/boot taimen-userdebug. No more logspam
Change-Id: Ic43d1c8b71e1e5e0e6f9af1e03816c4084120e7e
Merged-In: Ic43d1c8b71e1e5e0e6f9af1e03816c4084120e7e
(cherry picked from commit 558cdf1e99)
2018-04-11 08:20:36 +09:00
Tri Vo
fad493bff9 Add internal types to 27.0[.ignore].cil.
Bug: 69390067
Test: manual run of treble_sepolicy_tests
Change-Id: I1b772a3f7c96875765c75bfc1031f249411c3338
Merged-In: I1b772a3f7c96875765c75bfc1031f249411c3338
(cherry picked from commit 9fbd65200d)
2018-04-11 08:02:06 +09:00
Florian Mayer
ddba04d0bb Merge "Expose filesystem read events in SELinux policy." am: 589226dff9
am: bf685274fd

Change-Id: I2d17d76e68d60454ca53f4448a71fc619bbd5cd7
2018-04-10 14:22:40 -07:00
Florian Mayer
589226dff9 Merge "Expose filesystem read events in SELinux policy." 2018-04-10 21:04:50 +00:00
Max Bires
15a9fbc277 Adding labeling for vendor security patch prop am: 5cac1aa99c
am: ad3602d262

Change-Id: I034f2f2c9eab3667cfa92ea41b4b5f4afa1c7df7
2018-04-10 12:38:45 -07:00
Florian Mayer
7ad383f181 Expose filesystem read events in SELinux policy.
Without this, we only have visibility into writes.

Looking at traces, we realised for many of the files we care about (.dex, .apk)
most filesystem events are actually reads.

See aosp/661782 for matching filesystem permission change.

Bug: 73625480

Change-Id: I6ec71d82fad8f4679c7b7d38e3cb90aff0b9e298
2018-04-10 18:44:20 +01:00
Max Bires
5cac1aa99c Adding labeling for vendor security patch prop
This will allow adb shell getprop ro.vendor.build.security_patch to
properly return the correct build property, whereas previously it was
offlimits due to lack of label.

Test: adb shell getprop ro.vendor.build.security_patch successfully
returns whatever VENDOR_SECURITY_PATCH is defined to be in the Android
.mk files

Change-Id: Ie8427738125fc7f909ad8d51e4b76558f5544d49
2018-04-09 15:34:42 -07:00
Jeff Vander Stoep
c16e920d7e whitelist test failure that bypassed presubmit
am: 2ccd99a53a

Change-Id: I0e4eacb9cce9c995bf773176638a46af0e92af0a
2018-04-09 14:29:49 -07:00
Jeff Vander Stoep
2ccd99a53a whitelist test failure that bypassed presubmit
avc: denied { read } for comm="batterystats-wo" name="show_stat" dev="sysfs"
scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs:s0 tclass=file

Bug: 77816522
Test: build
Change-Id: I50a9bfe1a9e4df9c84cf4b2b4aedbb8f82ac94cd
2018-04-09 14:15:28 -07:00
Alan Stokes
817d1472dc Revert "Add /sys/kernel/memory_state_time to sysfs_power." am: 12e73685b7
am: 2106689095

Change-Id: I7fc2111bde48cc78b2cec9a9ca17101ac69d823a
2018-04-09 11:16:41 -07:00
Alan Stokes
12e73685b7 Revert "Add /sys/kernel/memory_state_time to sysfs_power."
This reverts commit db83323a03.

Reason for revert: breaks some builds due to duplicate genfs entries

Change-Id: I47813bd84ff10074a32cf483501a9337f556e92a
2018-04-09 18:02:53 +00:00
Treehugger Robot
dceea5023c Merge "Add shell:fifo_file permission for audioserver" 2018-04-09 17:54:42 +00:00
Alan Stokes
cd61bc19ec Merge "Add /sys/kernel/memory_state_time to sysfs_power." 2018-04-09 16:29:30 +00:00
Alan Stokes
06bac37f51 Installd doesn't need to create cgroup files.
cgroupfs doesn't allow files to be created, so this can't be needed.

Also remove redundant neverallow and dontaudit rules. These are now
more broadly handled by domain.te.

Bug: 74182216

Test: Denials remain silenced.

Change-Id: If7eb0e59f567695d987272a2fd36dbc251516e9f

(cherry picked from commit 8e8c109350)
2018-04-09 13:49:13 +01:00
Alan Stokes
db83323a03 Add /sys/kernel/memory_state_time to sysfs_power.
This allows system_server to access it for determining battery stats
(see KernelMemoryBandwidthStats.java).

batterystats-wo: type=1400 audit(0.0:429): avc: denied { read } for name="show_stat" dev="sysfs" ino=48071 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0

Bug: 72643420
Bug: 73947096

Test: Denial is no longer present.
Change-Id: Ibe46aee48eb3f78fa5a9d1f36602c082c33036f7

(cherry picked from commit a8b3634d3e)
2018-04-09 10:28:56 +01:00
Alan Stokes
d3b70b8d98 Merge "Installd doesn't need to create cgroup files." into pi-dev
am: 956aba8fc4

Change-Id: I18aaf1a24d9651ae16239e4ef50c90481d52ab3a
2018-04-09 01:11:25 -07:00
Alan Stokes
9b02a9b63e Merge "Add /sys/kernel/memory_state_time to sysfs_power." into pi-dev
am: 404bd98251

Change-Id: Ic9e82e7b1becf03cdbd520f53c1d6bdd9919225d
2018-04-09 01:10:31 -07:00
Alan Stokes
956aba8fc4 Merge "Installd doesn't need to create cgroup files." into pi-dev 2018-04-09 08:03:53 +00:00
Alan Stokes
404bd98251 Merge "Add /sys/kernel/memory_state_time to sysfs_power." into pi-dev 2018-04-09 08:03:20 +00:00
Mikhail Naganov
8ec0df96ec Merge "Add shell:fifo_file permission for audioserver" into pi-dev
am: 2a63d899e3

Change-Id: Ife3f656e0a535b695390a30fdcc11efb070dd2b4
2018-04-06 17:54:10 -07:00
TreeHugger Robot
2a63d899e3 Merge "Add shell:fifo_file permission for audioserver" into pi-dev 2018-04-07 00:39:35 +00:00
Mikhail Naganov
05e12dba34 Add shell:fifo_file permission for audioserver
Bug: 73405145
Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioRecordTest#testRecordNoDataForIdleUids
Change-Id: I09bdb74c9ecc317ea090643635ca26165efa423a
(cherry picked from commit c5815891f8)
Merged-In: I09bdb74c9ecc317ea090643635ca26165efa423a
2018-04-06 15:18:22 -07:00
Mikhail Naganov
c5815891f8 Add shell:fifo_file permission for audioserver
Bug: 73405145
Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioRecordTest#testRecordNoDataForIdleUids
Change-Id: I09bdb74c9ecc317ea090643635ca26165efa423a
2018-04-06 14:55:03 -07:00
Florian Mayer
ead446ed39 Grant traced_probes search on directories. am: ff146962b2
am: 1b433165e4

Change-Id: Icfea6a7041a010be502d31b4082e8bf242abf3de
2018-04-06 09:23:38 -07:00
Florian Mayer
269c9665ae Grant traced_probes search on directories.
This is needed to be able to scan the labels we have
permission on.

Denial:

04-06 12:52:22.674   874   874 W traced_probes: type=1400 audit(0.0:10314): avc: denied { search } for name="backup" dev="sda45" ino=6422529 scontext=u:r:traced_probes:s0 tcontext=u:object_r:backup_data_file:s0 tclass=dir permissive=0

Bug: 73625480

cherry-picked from aosp/658243
Change-Id: I52f3865952004bfc6fe22c488d768276866f8ae1
Merged-In: I52f3865952004bfc6fe22c488d768276866f8ae1
2018-04-06 17:18:27 +01:00
Florian Mayer
ff146962b2 Grant traced_probes search on directories.
This is needed to be able to scan the labels we have
permission on.

Denial:

04-06 12:52:22.674   874   874 W traced_probes: type=1400 audit(0.0:10314): avc: denied { search } for name="backup" dev="sda45" ino=6422529 scontext=u:r:traced_probes:s0 tcontext=u:object_r:backup_data_file:s0 tclass=dir permissive=0

Bug: 73625480
2018-04-06 12:51:41 +00:00
Alan Stokes
8e8c109350 Installd doesn't need to create cgroup files.
cgroupfs doesn't allow files to be created, so this can't be needed.

Also remove redundant neverallow and dontaudit rules. These are now
more broadly handled by domain.te.

Bug: 74182216

Test: Denials remain silenced.

Change-Id: If7eb0e59f567695d987272a2fd36dbc251516e9f
2018-04-06 12:12:22 +01:00
Alan Stokes
a8b3634d3e Add /sys/kernel/memory_state_time to sysfs_power.
This allows system_server to access it for determining battery stats
(see KernelMemoryBandwidthStats.java).

batterystats-wo: type=1400 audit(0.0:429): avc: denied { read } for name="show_stat" dev="sysfs" ino=48071 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0

Bug: 72643420
Bug: 73947096

Test: Denial is no longer present.
Change-Id: Ibe46aee48eb3f78fa5a9d1f36602c082c33036f7
2018-04-06 09:42:20 +00:00
Kweku Adams
0fa3d2766f Allowing incidentd to get stack traces from processes.
Bug: 72177715
Test: flash device and check incident output
Change-Id: I16c172caec235d985a6767642134fbd5e5c23912
(cherry picked from commit 985db6d8dd)
2018-04-05 16:37:05 -07:00
Joel Galenson
0a88809552 Merge "Track storaged SELinux denial." am: 04529dc669
am: 46e4c1890c

Change-Id: Ieb549d5211f6906a8a65715d64f645ddd44155cb
2018-04-05 16:30:51 -07:00
Treehugger Robot
04529dc669 Merge "Track storaged SELinux denial." 2018-04-05 23:12:04 +00:00
Joel Galenson
c6b5a96bb6 Track storaged SELinux denial.
This should help fix presubmit tests.

Bug: 77634061
Test: Built policy.
Change-Id: Ib9f15c93b71c2b67f25d4c9f949a5e2b3ce93b9c
2018-04-05 10:39:03 -07:00
Jeff Vander Stoep
97b66cb520 priv_app: remove more logspam
am: 558cdf1e99

Change-Id: I998cb4d7b507c39ddd027a9e24646303c4765512
2018-04-05 06:12:24 -07:00
Jeff Vander Stoep
558cdf1e99 priv_app: remove more logspam
avc: denied { read } for name="ext4" dev="sysfs" ino=32709
scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:sysfs:s0
tclass=dir permissive=0 b/72749888
avc: denied { read } for name="state" dev="sysfs" ino=51318
scontext=u:r:priv_app:s0:c512,c768
tcontext=u:object_r:sysfs_android_usb:s0 tclass=file permissive=0
b/72749888

Bug: 72749888
Test: build/boot taimen-userdebug. No more logspam
Change-Id: Ic43d1c8b71e1e5e0e6f9af1e03816c4084120e7e
2018-04-04 14:43:48 -07:00
Kweku Adams
49733255fb Allowing incidentd to get stack traces from processes. am: 985db6d8dd
am: 5f98693a77

Change-Id: Iaeaaeb8195e2ffcbf148b1764d57d4e1c7da6f4f
2018-04-04 09:13:58 -07:00
Kweku Adams
985db6d8dd Allowing incidentd to get stack traces from processes.
Bug: 72177715
Test: flash device and check incident output
Change-Id: I16c172caec235d985a6767642134fbd5e5c23912
2018-04-04 16:00:23 +00:00
Jeff Vander Stoep
e8db0b37ad Merge "Rename qtaguid_proc to conform to name conventions" am: 38a84cf8da
am: d093691cda

Change-Id: Ie6ffba47ea2164260d60115a738c57f0e47f04be
2018-04-03 21:53:11 -07:00
Treehugger Robot
38a84cf8da Merge "Rename qtaguid_proc to conform to name conventions" 2018-04-04 02:26:56 +00:00
Nathan Harold
252b015365 Allow getsockopt and setsockopt for Encap Sockets
Because applications should be able to set the receive
timeout on UDP encapsulation sockets, we need to allow
setsockopt(). getsockopt() is an obvious allowance as
well.

Bug: 68689438
Test: compilation
Merged-In: I2eaf72bcce5695f1aee7a95ec03111eca577651c
Change-Id: I2eaf72bcce5695f1aee7a95ec03111eca577651c
2018-04-03 21:52:14 +00:00
Jeff Vander Stoep
bdf2a9c417 Rename qtaguid_proc to conform to name conventions
Test: build
Bug: 68774956
Change-Id: I0f9fd87eb41e67e14f35e49eba13e3d1de745250
2018-04-03 14:47:38 -07:00
Nathan Harold
b232842b35 Allow getsockopt and setsockopt for Encap Sockets
am: ea4eaaf128

Change-Id: I1b1be4cfd4a4c35ffc3e085bebf386a7aefc4fc2
2018-04-03 13:38:06 -07:00
Jeff Vander Stoep
3aa7ca56fd Add untrusted_app_27
This is a partial cherry pick of commit 6231b4d9
'Enforce per-app data protections for targetSdk 28+'.

Untrusted_app_27 remains unreachable, but it's existence
prevents future merge conflicts.

Bug: 63897054
Test: build/boot aosp_walleye-userdebug
Change-Id: I64b013874fe87b55f47e817a1279e76ecf86b7c0
Merged-In: I64b013874fe87b55f47e817a1279e76ecf86b7c0
(cherry picked from commit 6231b4d9fc)
2018-04-03 12:25:51 -07:00
Jeff Vander Stoep
51ebb60113 Remove deprecated tagSocket() permissions am: 0d1e52a50f
am: c1753b7a14

Change-Id: I5ae0c1791c2e588e6cdd177a4f1a8758cb2de3ad
2018-04-03 10:53:35 -07:00
Nathan Harold
ea4eaaf128 Allow getsockopt and setsockopt for Encap Sockets
Because applications should be able to set the receive
timeout on UDP encapsulation sockets, we need to allow
setsockopt(). getsockopt() is an obvious allowance as
well.

Bug: 68689438
Test: compilation
Change-Id: I2eaf72bcce5695f1aee7a95ec03111eca577651c
2018-04-03 10:28:10 -07:00
Jeff Vander Stoep
0d1e52a50f Remove deprecated tagSocket() permissions
tagSocket() now results in netd performing these actions on behalf
of the calling process.

Remove direct access to:
/dev/xt_qtaguid
/proc/net/xt_qtaguid/ctrl

Bug: 68774956
Test: -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AppSecurityTests
    -m CtsNativeNetTestCases
Test: stream youtube, browse chrome
Test: go/manual-ab-ota
Change-Id: I6a044f304c3ec4e7c6043aebeb1ae63c9c5a0beb
2018-04-03 13:56:58 +00:00
yro
bcefa8ba03 Merge "Update sepolicy to have system_server access stats_data" into pi-dev
am: 199637ebce

Change-Id: Ia6ce6b2955e2a848948eb429d29f1887f25fe43b
2018-04-03 00:01:00 +00:00
TreeHugger Robot
199637ebce Merge "Update sepolicy to have system_server access stats_data" into pi-dev 2018-04-02 19:27:16 +00:00
yro
866a240900 Merge "Update sepolicy to have system_server access stats_data" am: 8b11302e89
am: 7718295a7d

Change-Id: I1cd45d3bdc5a5826dd73376b7480375fefb3ca78
2018-03-31 03:01:33 +00:00
yro
7cacc85daf Update sepolicy to have system_server access stats_data
Bug: 75968642
Test: manual testing to check for sepolicy violation
Cherry-picked from aosp/652222

Change-Id: Idc83669feaf9fd17bed26f89dfce33e3f2f5424f
2018-03-30 18:40:30 -07:00
Treehugger Robot
8b11302e89 Merge "Update sepolicy to have system_server access stats_data" 2018-03-31 01:19:49 +00:00
Treehugger Robot
855c6c162a Merge "Allow incidentd to read LAST_KMSG only for userdebug builds" 2018-03-30 23:24:24 +00:00
TreeHugger Robot
6577b988ac Merge "Allow netutils_wrapper to use pinned bpf program" into pi-dev 2018-03-30 23:10:47 +00:00
yro
36dd2a410c Update sepolicy to have system_server access stats_data
Test: manually tested to prevent sepolicy violation
Change-Id: I9ebcc86464a9fc61a49d5c9be40f19f3523b6785
2018-03-30 15:58:58 -07:00
Chenbo Feng
be9b15c512 Allow netutils_wrapper to use pinned bpf program
The netutils_wrapper is a process used by vendor code to update the
iptable rules on devices. When it update the rules for a specific chain.
The iptable module will reload the whole chain with the new rule. So
even the netutils_wrapper do not need to add any rules related to xt_bpf
module, it will still reloading the existing iptables rules about xt_bpf
module and need pass through the selinux check again when the rules are
reloading. So we have to grant it the permission to reuse the pinned
program in fs_bpf when it modifies the corresponding iptables chain so
the vendor module will not crash anymore.

Test: device boot and no more denials from netutils_wrapper
Bug: 72111305
Change-Id: I62bdfd922c8194c61b13e2855839aee3f1e349be
(cherry picked from aosp commit 2623ebcf8e)
2018-03-30 13:54:31 -07:00
Chenbo Feng
563491d40d Merge "Allow netutils_wrapper to use pinned bpf program" am: 4fb1a145d1
am: 4a0c24edcb

Change-Id: I294bd92866c978e605b4a69d06aa54a6c4bfd85a
2018-03-30 20:18:21 +00:00
Treehugger Robot
4fb1a145d1 Merge "Allow netutils_wrapper to use pinned bpf program" 2018-03-30 20:03:19 +00:00
Pawin Vongmasa
514dde5170 Merge "Put in sepolicies for Codec2.0 services" into pi-dev
am: eaee65f043

Change-Id: I2f4c80d5cf5616f39e1659e23d4d162c84dcfb00
2018-03-30 19:05:15 +00:00
TreeHugger Robot
eaee65f043 Merge "Put in sepolicies for Codec2.0 services" into pi-dev 2018-03-30 17:51:38 +00:00
Yi Jin
7312abeb37 Merge "Allow incidentd to read LAST_KMSG only for userdebug builds" into pi-dev
am: 941cc9c8d2

Change-Id: I5fa2ede7234c3c2180ca89a547e15c8dac2d12b1
2018-03-30 17:26:54 +00:00
Yi Jin
76238cd4ef Allow incidentd to read LAST_KMSG only for userdebug builds
Bug: 73354384
Test: manual
Change-Id: Iaaeded69c287eae757aaf68dc18bc5a0c53b94e6
2018-03-30 10:15:24 -07:00
TreeHugger Robot
941cc9c8d2 Merge "Allow incidentd to read LAST_KMSG only for userdebug builds" into pi-dev 2018-03-30 14:54:55 +00:00
Primiano Tucci
5e4ce771e4 Merge "SELinux changes for I/O tracing." into pi-dev
am: c2e249dd41

Change-Id: I53e5669f0b13193b175a7980ab8d5b2d639ca487
2018-03-30 01:24:52 +00:00
Florian Mayer
9fcf22bb81 SELinux changes for I/O tracing.
See also go/perfetto-io-tracing-security.

* Grant CAP_DAC_READ_SEARCH to traced_probes.
* Allow traced_probes to list selected labels.
* Change ext4 and f2fs events to be available on user builds.

Bug: 74584014
Change-Id: I891a0209be981d760a828a69e4831e238248ebad
2018-03-30 00:32:34 +00:00
Primiano Tucci
c2e249dd41 Merge "SELinux changes for I/O tracing." into pi-dev 2018-03-30 00:31:59 +00:00
Joel Galenson
d65e38b238 Merge "Label /proc/sys/kernel/sched_schedstats." into pi-dev
am: aebeae8156

Change-Id: I42a1ee99885b87391ef1aa49b5554a8e16a3d065
2018-03-29 22:48:18 +00:00
Joel Galenson
4b625e4a35 Label /proc/sys/kernel/sched_schedstats.
This allows init to write to it, which it does for atrace.

Bug: 72643420
Test: Boot two devices, observe no denials, test atrace.
Change-Id: I6810e5dcdfaff176bd944317e66d4fe612ccebed
(cherry picked from commit dce07413bc)
2018-03-29 14:57:10 -07:00
TreeHugger Robot
aebeae8156 Merge "Label /proc/sys/kernel/sched_schedstats." into pi-dev 2018-03-29 21:54:07 +00:00
Florian Mayer
8d81905567 SELinux changes for I/O tracing.
See also go/perfetto-io-tracing-security.

* Grant CAP_DAC_READ_SEARCH to traced_probes.
* Allow traced_probes to list selected labels.
* Change ext4 and f2fs events to be available on user builds.

Bug: 74584014
Cherry-picked from aosp/631805
Change-Id: I891a0209be981d760a828a69e4831e238248ebad
Merged-In: I891a0209be981d760a828a69e4831e238248ebad
2018-03-29 21:15:29 +01:00
Joel Galenson
dce07413bc Label /proc/sys/kernel/sched_schedstats.
This allows init to write to it, which it does for atrace.

Bug: 72643420
Test: Boot two devices, observe no denials, test atrace.
Change-Id: I6810e5dcdfaff176bd944317e66d4fe612ccebed
2018-03-29 12:15:48 -07:00
Jeff Vander Stoep
2b0a493db1 Merge "Improve neverallows on /proc and /sys" am: 4bdefb59ca
am: 86b51f42ce

Change-Id: Iabd8574383217c1c41134ed16f728ca00ec20045
2018-03-29 18:25:01 +00:00
Jeff Vander Stoep
3079d01ad8 Improve neverallows on /proc and /sys
Access to these files was removed in Oreo. Enforce that access is not
granted by partners via neverallow rule.

Also disallow most untrusted app access to net.dns.* properties.

Bug: 77225170
Test: system/sepolicy/tools/build_policies.sh
Change-Id: I85b634af509203393dd2d9311ab5d30c65f157c1
(cherry picked from commit 886aa54bab)
2018-03-29 11:11:23 -07:00
Alan Stokes
509cf6ddf9 Merge "Suppress harmless denials for file creation in cgroupfs." into pi-dev
am: fb735122be

Change-Id: I9062ca72c1fa747c0a8078fd0896e35b80fdffde
2018-03-29 17:46:59 +00:00
Chenbo Feng
2623ebcf8e Allow netutils_wrapper to use pinned bpf program
The netutils_wrapper is a process used by vendor code to update the
iptable rules on devices. When it update the rules for a specific chain.
The iptable module will reload the whole chain with the new rule. So
even the netutils_wrapper do not need to add any rules related to xt_bpf
module, it will still reloading the existing iptables rules about xt_bpf
module and need pass through the selinux check again when the rules are
reloading. So we have to grant it the permission to reuse the pinned
program in fs_bpf when it modifies the corresponding iptables chain so
the vendor module will not crash anymore.

Test: device boot and no more denials from netutils_wrapper
Bug: 72111305
Change-Id: I62bdfd922c8194c61b13e2855839aee3f1e349be
2018-03-29 10:26:29 -07:00
Alan Stokes
832a7042b0 Suppress harmless denials for file creation in cgroupfs.
The kernel generates file creation audits when O_CREAT is passed even
if the file already exists - which it always does in the cgroup cases.

We add neverallow rules to prevent mistakenly allowing unnecessary
create access. We also suppress these denials, which just add noise to
the log, for the more common culprits.

Bug: 72643420
Bug: 74182216

Test: Ran build_policies.sh and checked failures were unrelated.
Test: Device still boots, denials gone.
Change-Id: I034b41ca70da1e73b81fe90090e656f4a3b542dc
(cherry picked from commit 92c149d077)
2018-03-29 10:18:54 -07:00
TreeHugger Robot
fb735122be Merge "Suppress harmless denials for file creation in cgroupfs." into pi-dev 2018-03-29 17:18:05 +00:00
Treehugger Robot
4bdefb59ca Merge "Improve neverallows on /proc and /sys" 2018-03-29 17:08:34 +00:00
TreeHugger Robot
2a053462a8 Merge "Statsd: Allow statsd to contact perfprofd in userdebug" into pi-dev 2018-03-29 16:51:29 +00:00
Alan Stokes
92c149d077 Suppress harmless denials for file creation in cgroupfs.
The kernel generates file creation audits when O_CREAT is passed even
if the file already exists - which it always does in the cgroup cases.

We add neverallow rules to prevent mistakenly allowing unnecessary
create access. We also suppress these denials, which just add noise to
the log, for the more common culprits.

Bug: 72643420
Bug: 74182216

Test: Ran build_policies.sh and checked failures were unrelated.
Test: Device still boots, denials gone.
Change-Id: I034b41ca70da1e73b81fe90090e656f4a3b542dc
2018-03-29 13:51:56 +01:00
Pawin Vongmasa
4be2889477 Put in sepolicies for Codec2.0 services
Test: Builds

Bug: 64121714
Bug: 31973802
Change-Id: Id37be8726a8bb297e35bca494964fdbcc48c6a73
2018-03-29 04:42:25 -07:00
Yi Jin
4f69d91244 Allow incidentd to read LAST_KMSG only for userdebug builds
Bug: 73354384
Test: manual
Change-Id: I4fa630624cc247275e11965471461502f451edf4
2018-03-28 15:59:48 -07:00
Jeff Vander Stoep
886aa54bab Improve neverallows on /proc and /sys
Access to these files was removed in Oreo. Enforce that access is not
granted by partners via neverallow rule.

Also disallow most untrusted app access to net.dns.* properties.

Bug: 77225170
Test: system/sepolicy/tools/build_policies.sh
Change-Id: I85b634af509203393dd2d9311ab5d30c65f157c1
2018-03-28 15:56:36 -07:00