Commit Graph

140 Commits

Author SHA1 Message Date
Kris Chen
258442b3d4 Add rules to dump fingerprint hal traces
Bug: 150008549
Test: adb shell am hang
Test: adb bugreport
Change-Id: I0440bb8fd3cc1205a43eca6c7ef5f8d0afc92396
2020-03-03 16:58:58 +08:00
Stefano Galarraga
fb9ff8d5b6 Merge "Allow dumpstate to dump NNAPI HAL log on userbuild" 2020-02-25 10:47:38 +00:00
Kenny Root
4def25f171 Merge "rebootescrow: allow dumpstate to call via binder" 2020-02-11 21:25:29 +00:00
Kenny Root
7ae220742c rebootescrow: allow dumpstate to call via binder
Allow dumpstate to call into rebootescrow to request debug information.

Bug: 148763226
Test: adb bugreport
Change-Id: Ib336cab755998b1ddcd7848b3e544c2e0f09c1aa
2020-02-10 21:28:32 -08:00
Jerry Chang
e8b7cecad3 Merge "sepolicy: new prereboot_data_file type" 2020-02-11 02:49:29 +00:00
Hridya Valsaraju
4ea5709bc4 Allow dumpstate access to /dev/binderfs/binder_logs
These permissions allow dumpstate to access binder logs
from /dev/binderfs.
avc: denied { read } for name="binder_logs" dev="binder" ino=1048580
scontext=u:r:dumpstate:s0 tcontext=u:object_r:binderfs_logs:s0 tclass=dir permissive=0
avc: denied { read } for comm="dumpstate" name="failed_transaction_log"
dev="binder" ino=1048585 scontext=u:r:dumpstate:s0
tcontext=u:object_r:binderfs_logs:s0 tclass=file permissive=1
avc: denied { open } for comm="dumpstate"
path="/dev/binderfs/binder_logs/failed_transaction_log"
dev="binder" ino=1048585 scontext=u:r:dumpstate:s0
tcontext=u:object_r:binderfs_logs:s0 tclass=file permissive=1
avc: denied { getattr } for comm="dumpstate"
path="/dev/binderfs/binder_logs/failed_transaction_log"
dev="binder" ino=1048585 scontext=u:r:dumpstate:s0
tcontext=u:object_r:binderfs_logs:s0 tclass=file permissive=1

Test: adb shell dumpstate
Bug: 136497735
Change-Id: I5ff7223e431aab9baa3527570fff2da71ab6feb0
2020-02-10 12:47:35 -08:00
Jerry Chang
5594f307c8 sepolicy: new prereboot_data_file type
This adds the type and permissions for dumping and appending prereboot
information.

Bug: 145203410
Test: Didn't see denials while dumping and appending prereboot info.
Change-Id: Ic08408b9bebc3648a7668ed8475f96a5302635fa
2020-02-07 10:22:47 +08:00
Martijn Coenen
722026676b Don't audit dumpstate reading /mnt/user, /mnt/installer.
Dumpstate runs 'df', which in turn tries to get attributes on all
mounted filesystems. We don't care much for stats on /mnt/user, since
it's simply a mapping of /data. /mnt/installer is simply a bind mount of
/mnt/user, and we don't need to show that in df either.

Bug: 148761246
Test: atest
CtsSecurityHostTestCases:android.security.cts.SELinuxHostTest#testNoBugreportDenials
Change-Id: Ie71b9cde08eb08bd3a7a3e2659ea71c61ca5ab3b
2020-02-06 09:44:24 +00:00
Stefano Galarraga
a601575307 Allow dumpstate to dump NNAPI HAL log on userbuild
This helps in the investigation of driver-related issues.

Bug: 145388549
Test: Manually, log collected on user build
Change-Id: I40631aac7878f58e399bc583898630055583fc7c
2020-02-05 09:26:23 +00:00
Kiyoung Kim
7be9b32fdb Merge "Allow dumpstate to open and read linkerconfig directory" 2020-02-05 07:58:12 +00:00
Yifan Hong
28d5e87d39 Merge "snapshotctl better logging" 2020-02-04 22:18:33 +00:00
Yifan Hong
589bb6f369 snapshotctl better logging
Test: snapshotctl merge --log-to-file
Bug: 148818798
Change-Id: I0e9c8ebb6632a56670a566f7a541e52e0bd24b08
2020-02-04 10:09:24 -08:00
Kiyoung Kim
608029fb86 Allow dumpstate to open and read linkerconfig directory
To include linkerconfig results into dumpstate, dumpstate needs extra
permission on lnkerconfig directory to search all items within the
directory. This change allows dumpstate to have extra access on
linkerconfig directory.

Bug: 148840832
Test: tested from cuttlefish
Change-Id: I955b54ec2cc3d1dcedaa34406e0e0776b6ac12f6
2020-02-04 19:45:19 +09:00
Kiyoung Kim
7e247cb035 Don't audit linkerconfig in dumpstate
dumpstate creates an error log from CTS test because dumpstate does not
have access to linkerconfig directory. As df doesn't need to scan
linkerconfig directory, do not audit this directory in dumpstate
to get attributes.

Bug: 148760417
Test: m -j passed
Test: No sepolicy error from correspoding test
Change-Id: I3c1c3a489584450bd23fbce2d7cc9b09aaf9c002
2020-02-04 15:51:00 +09:00
Steven Moreland
a30464c06e More neverallows for default_android_service.
We don't want to accidentally allow this, and a neverallow also means
that the issue will be found during development, instead of review.

Fixes: 148081219
Test: compile policy only
Change-Id: I57990a2a4ab9e5988b09dae2dd6a710ce8f53800
2020-01-21 11:13:22 -08:00
Ricky Wai
2e17c0558e Don't audit data_mirror in dumpstate
Bug: 146376151
Test: atest SELinuxHostTest#testNoBugreportDenials
Change-Id: Ia94496bcb8f60cd9a828380164ade65cab62bac2
2019-12-19 16:36:24 +00:00
Minchan Kim
8dfe383b2a Allow dumpstate to access PSI statistics
dumpstate need to access /proc/pressure/{cpu,mem,io}

Bug: 141884936
Test: adb bugreport and check bugreport file includes PSI metric
Change-Id: I01e7376206c07c1700d6ffe3690d61a1db8dfe84
Signed-off-by: Minchan Kim <minchan@google.com>
2019-10-01 14:43:55 -07:00
Tom Cherry
c72dc07de2 Merge "Allow dumpstate to read /data/misc/logd always"
am: 4c52cedf22

Change-Id: I32bce2aedcbb2adb4d566410945a98299ea21fc9
2019-07-15 16:43:00 -07:00
Tom Cherry
77f8d4f8ca Allow dumpstate to read /data/misc/logd always
There is no reason to deny dumpstate from reading /data/misc/logd on
user builds.  Logpersist is disallowed from running on those builds,
so there is no harm in copying this directory.

Bug: 136978224
Test: build
Change-Id: Ia58bde10e1f45978975597cd2ea1951a784d3b49
2019-07-08 13:20:10 -07:00
TreeHugger Robot
f325a7db06 Merge "DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5699924) into stage-aosp-master" into stage-aosp-master 2019-07-02 07:41:05 +00:00
Kalesh Singh
113d10baaa Sepolicy for added SystemSuspend HAL to ANR list.
Change-Id: Ib7b647d07c5432ed4cdb674f3c9642cfcb5c9d79
Bug: 135458700
Fixes: 135458700
Test: Trigger ANR dump (adb shell am hang).
grep through logcat for sepolicy denials.
2019-06-28 10:08:22 -07:00
Kevin Chyn
a18c5bdd70 Add rules to dump hal traces
Test: manual
Bug: 126802513

Change-Id: If037483f305e161a158e30f6322d5e25b7770952
Merged-In: If037483f305e161a158e30f6322d5e25b7770952
2019-06-20 00:31:03 +00:00
Kevin Chyn
6d976f4d5d Add rules to dump hal traces
Test: manual
Bug: 126802513

Change-Id: If037483f305e161a158e30f6322d5e25b7770952
2019-06-19 19:55:14 +00:00
TreeHugger Robot
cf48bfd082 Merge "Properly define hal_codec2 and related policies" into qt-dev 2019-05-24 07:21:23 +00:00
Pawin Vongmasa
609c243dd0 Properly define hal_codec2 and related policies
Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 131677974
Change-Id: I59c3d225499a8c53c2ed9f3bd677ff3d7423990b
2019-05-23 03:53:47 -07:00
Nikita Ioffe
1c4a5260c1 selinux: Allow dumpstate send signals to vold
Test: adb bugreport
Test: verified vold stacktrace is present in bugreport
Bug: 132344997
Change-Id: I0ebf7f171d854b9aaf894ccb8c7a5f68f18e692b
Merged-In: I0ebf7f171d854b9aaf894ccb8c7a5f68f18e692b
(cherry picked from commit f7c3d19d29)
2019-05-21 20:39:07 +01:00
Nikita Ioffe
f7c3d19d29 selinux: Allow dumpstate send signals to vold
Test: adb bugreport
Test: verified vold stacktrace is present in bugreport
Bug: 132344997
Change-Id: I0ebf7f171d854b9aaf894ccb8c7a5f68f18e692b
2019-05-21 13:03:55 +01:00
TreeHugger Robot
5f30c238ec Merge "Allow signals to power/thermal HAL from dumpstate" into qt-dev 2019-04-24 20:18:26 +00:00
Wei Wang
addfe4679d Allow signals to power/thermal HAL from dumpstate
Bug: 129711808
Test: Take BR
Change-Id: Ibcb03698a6e2966f4913ddb6e674502bce4df235
2019-04-23 14:22:41 -07:00
Wei Wang
76d93f0ce8 Allow signals to power/thermal HAL from dumpstate
Bug: 129711808
Test: Take BR
Change-Id: Ibcb03698a6e2966f4913ddb6e674502bce4df235
2019-04-23 14:21:03 -07:00
Chong Zhang
785521e211 add mediaswcodec to watchdog and dumpstate
bug: 130887807
test: adb bugreport and check mediaswcodec stack is there
Change-Id: I4a37e4e06c4905f435e96d8b1497e3617e688478
(cherry-picked from https://android-review.googlesource.com/c/platform/system/sepolicy/+/947830)
2019-04-19 12:16:40 -07:00
Chong Zhang
ad3621a7b7 add mediaswcodec to watchdog and dumpstate
bug: 130887807
test: adb bugreport and check mediaswcodec stack is there
Change-Id: I4a37e4e06c4905f435e96d8b1497e3617e688478
2019-04-19 12:13:33 -07:00
Joel Galenson
99149c9fbf Fix denial during bugreport.
Bug: 116711254
Test: Build.
Change-Id: Iafad9228a171796ce7ab18d60697eea396be4efa
Merged-In: I060b0d929a9d147f6327432844106d8270222d18
2019-04-11 09:41:50 -07:00
Joel Galenson
2f26b34f5c Fix typo in I3ede36a8084fdae22d3aedd92703811d279a7829.
Test: Build
Change-Id: I060b0d929a9d147f6327432844106d8270222d18
2019-04-09 17:00:04 -07:00
Benjamin Schwartz
b3ecb4e5b9 Allow signals to hal_power_stats_server from dumpstate
This is needed for bugreport to include ANR trace for the process.

Bug: 128878895
Test: adb bugreport
Change-Id: I92e6952b03ffb047e9fb75b0e44024f2623debb3
2019-04-09 10:25:58 -07:00
Benjamin Schwartz
f9b7a4c992 Allow signals to hal_power_stats_server from dumpstate
This is needed for bugreport to include ANR trace for the process.

Bug: 128878895
Test: adb bugreport
Change-Id: I31a2fceb9c8ec1d8588374bb97f3b518a075ddfb
2019-04-09 09:25:17 -07:00
Joel Galenson
9b37627e50 Fix denial during bugreport.
Bug: 116711254
Test: Take bugreport and see no denial.
Change-Id: I3ede36a8084fdae22d3aedd92703811d279a7829
2019-04-08 09:19:44 -07:00
Roger Wang
49f2954275 Allow dumpstate to dump wlan hal log on userbuild
To check issue on userbuild, wlan hal log
is helpful.

Bug: 122265104
Test: Manully, log collected on user build
Change-Id: I5aa96aa796ca7dfb92e97df3e7be054ff79f6e3d
2019-03-21 12:27:44 +08:00
Joel Galenson
19c90604ad Fix denials during bugreport.
Bug: 124465994
Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t
android.security.cts.SELinuxHostTest#testNoBugreportDenials
Test: Build all policies.

Change-Id: Ic20b1e0fd3a8bdea408d66f33351b1f5ebc5d84c
(cherry picked from commit f24854f8e8)
2019-03-04 14:01:12 -08:00
Joel Galenson
06e63d2aff Hide denials seen during bugreports.
While taking bugreports we sometimes see dumpstate try to find
hwservices.  These are mostly neverallowed by macros, so hide them.

Bug: 116711254
Bug: 123540375
Test: Build.
Change-Id: Ic73a354bdae3d124eccc9477b7862bcad66fa076
2019-02-04 09:04:05 -08:00
Nikita Ioffe
1ab6affc5c Allow dumpstate to write into privileged apps private files
Bug: 123006652
Bug: 111441001
Fix: 123006652
Test: Wrote a test app using BugreportManager, checked denials in logcat
Change-Id: Id1c4b1d166bc70aec833c3d644e8aea6ae94c35a
2019-01-23 23:13:23 +00:00
Joel Galenson
886ba9c9ff Allow dumpstate to read some directories.
This prevents denials while taking a bugreport.

Bug: 116711254
Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t
android.security.cts.SELinuxHostTest#testNoBugreportDenials

Change-Id: I64f441eb66c355d03eaf7755f2e9d3e970305ecd
2019-01-07 12:45:56 -08:00
Joel Galenson
f0264fe2e9 Allow dumpstate to read sysfs_loop files.
This prevents denials while taking a bugreport.

Bug: 116711254
Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t
android.security.cts.SELinuxHostTest#testNoBugreportDenials

Change-Id: Ie190bfa62cf5aa172ebfff8bfd82dea2a7d1a016
2019-01-02 09:23:45 -08:00
Mike Ma
de3a3e4156 Allow dumpstate to dump incidentd
An incident.proto section has been added to the bugreport. Need
appropriate sepolicy changes to allow binder calls and fd access.

Bug: 119417232
Test: adb bugreport. Verify incident.proto is in the proto folder,
      and there are no sepolicy violations.

Change-Id: Iac27cbf283a2e1cb41862c76343c2b639f6c0e1e
2018-12-04 15:42:56 -08:00
Yifan Hong
0d53ef2c91 Add rules to dump health traces
Test: bugreport
Bug: 119809588
Change-Id: Ia688d68120daebc0a4feb51c4745535e1b371594
2018-11-27 17:36:07 -08:00
Joel Galenson
33ded4a69b Allow dumpstate to call mediaswcodec over binder
This prevents denials while taking a bugreport.

Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t
android.security.cts.SELinuxHostTest#testNoBugreportDenials

Change-Id: I381b39fa127f82fcef5d820a04209fd1ba4f63cd
2018-10-22 12:39:28 -07:00
Joel Galenson
49531c81c5 Handle denials caused by taking a bugreport.
apex_service is already in the list of services dumpstate cannot find;
this ensures that the dontaudit list is the same.  We hide the denial
caused by df reading one of its directories.

dumpstate can already call all binder services, so we enable it to
call bufferhubd.

Bug: 116711254
Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t android.security.cts.SELinuxHostTest#testNoBugreportDenials
Change-Id: Ie5acc84326fa504199221df825549479f3cf50e1
2018-10-10 18:17:50 -07:00
Igor Murashkin
72a88b194c iorapd: Add new binder service iorapd.
This daemon is very locked down. Only system_server can access it.

Bug: 72170747
Change-Id: I7b72b9191cb192be96001d84d067c28292c9688f
2018-10-08 15:00:34 -07:00
Martijn Coenen
ac097ac4c7 Add policy for apexd.
apexd is a new daemon for managing APEX packages installed
on the device. It hosts a single binder service, "apexservice".

Bug: 112455435
Test: builds, binder service can be registered,
      apexes can be accessed, verified and mounted
Change-Id: I634ad100f10b2edcd9a9c0df0d33896fa5d4ed97
2018-10-04 07:06:45 +00:00
Nick Kralevich
5e37271df8 Introduce system_file_type
system_file_type is a new attribute used to identify files which exist
on the /system partition. It's useful for allow rules in init, which are
based off of a blacklist of writable files. Additionally, it's useful
for constructing neverallow rules to prevent regressions.

Additionally, add commented out tests which enforce that all files on
the /system partition have the system_file_type attribute. These tests
will be uncommented in a future change after all the device-specific
policies are cleaned up.

Test: Device boots and no obvious problems.
Change-Id: Id9bae6625f042594c8eba74ca712abb09702c1e5
2018-09-27 12:52:09 -07:00