Commit graph

14779 commits

Author SHA1 Message Date
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
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
TreeHugger Robot
3c0b8c01f5 Merge "Reland "Allow dexopt to follow /odm/lib(64) symlinks.""" into pi-dev 2018-04-04 05:47:03 +00:00
TreeHugger Robot
f7d4978728 Merge "Allow dumpstate to trace drm hals" into pi-dev 2018-04-04 05:43:28 +00:00
Tri Vo
40e6b79520 Merge changes from topic "proc_sysfs_type" into pi-dev
* changes:
  Test that /proc files have proc_type attribute.
  Assert types labeled in genfs_contexts have correct attributes
2018-04-04 00:08:31 +00:00
Tri Vo
7698c72f35 Test that /proc files have proc_type attribute.
Bug: 74182216
Test: build sailfish, walleye, etc policy
Change-Id: Ia1c6b67ac93ed6e88c50c1527b48275365bf5fd5
Merged-In: Ia1c6b67ac93ed6e88c50c1527b48275365bf5fd5
(cherry picked from commit 4c80c2caa8)
2018-04-03 13:08:08 -07:00
Jeff Vander Stoep
5cfbf08fdb Assert types labeled in genfs_contexts have correct attributes
Types in sysfs should have the sysfs_type attribute, types in
debugfs and tracefs should have the debugfs_type attribute.

TODO: Test that files in procfs have the proc_type attribute.
TODO: Assert these tests in CTS.

Bug: 74182216
Test: build - these are build-time tests.
Change-Id: Icf0ff2a26c05f94da421ba23df0b92d8eef906bf
Merged-In: Icf0ff2a26c05f94da421ba23df0b92d8eef906bf
(cherry picked from commit 1b8284444c)
2018-04-03 12:15:48 -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
TreeHugger Robot
49e7b04ad3 Merge "Selinux: Fix perfprofd policy" into pi-dev 2018-04-03 00:44:35 +00:00
TreeHugger Robot
4d80e2c806 Merge "Allow vendor_init_settable for persist.sys.sf.native_mode" into pi-dev 2018-04-03 00:31:19 +00:00
Jeff Tinker
4f2739bd95 Allow dumpstate to trace drm hals
Change-Id: Id7823a3130443107beb4d97426807a6395cf6930
related-to-bug:74607984
test:adb bugreport and check for drm trace dumps
2018-04-02 17:28:51 -07:00
TreeHugger Robot
ac75fd49f0 Merge "Test frozen sepolicy has not diverged from prebuilts." into pi-dev 2018-04-03 00:14:29 +00:00
Jaekyun Seok
d2a6c235fe Allow vendor_init_settable for persist.sys.sf.native_mode
A default value of persist.sys.sf.native_mode could be set by SoC
partners in some devices including some pixels.
So it should have vendor_init_settable accessibility.

Bug: 74266614
Test: succeeded building and tested with a pixel device with
PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE=true.

Change-Id: I5d7a029f82505983d21dc722541fb55761a8714d
Merged-In: I5d7a029f82505983d21dc722541fb55761a8714d
(cherry picked from commit 0dc3587393)
2018-04-03 07:18:29 +09:00
Andreas Gampe
bda72633b4 Selinux: Fix perfprofd policy
Update for debugfs labeling changes.

Update for simpleperf behavior with stack traces (temp file).

(cherry picked from commit c8fe29ff1e)

Bug: 73175642
Test: m
Test: manual - run profiling, look for logs
Merged-In: Ie000a00ef56cc603f498d48d89001f566c03b661
Change-Id: Ie000a00ef56cc603f498d48d89001f566c03b661
2018-04-02 15:08:14 -07: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
Jiyong Park
c29028f4c3 Reland "Allow dexopt to follow /odm/lib(64) symlinks.""
This reverts commit 942500b910.

Bug: 75287236
Test: boot a device
Merged-In: If81a2d2a46979ffbd536bb95528c3b4ebe3483df
Change-Id: If81a2d2a46979ffbd536bb95528c3b4ebe3483df
(cherry picked from commit a6d9d6b68a)
2018-04-02 23:59:19 +09: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
ce02b00794 Merge "Wifi HAL SIOCSIFHWADDR sepolicy" into pi-dev 2018-03-30 23:51:43 +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
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
TreeHugger Robot
eaee65f043 Merge "Put in sepolicies for Codec2.0 services" into pi-dev 2018-03-30 17:51:38 +00:00
Tri Vo
321e1b059c Test frozen sepolicy has not diverged from prebuilts.
This will test that system/sepolicy/{public/, private/} are identical to
prebuilts if PLATFORM_SEPOLICY_VERSION is not 10000.0.

Bug: 74622750
Test: build policy
Test: correctly catches divergence from prebuilts for frozen policies

Change-Id: I2fa14b672544a021c2d42ad5968dfbac21b72f6a
(cherry picked from commit 81198bb8bb)
2018-03-30 10:13:37 -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
c2e249dd41 Merge "SELinux changes for I/O tracing." into pi-dev 2018-03-30 00:31:59 +00: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
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
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
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
TreeHugger Robot
c417b39f57 Merge "Keystore needs to be able to call apps" into pi-dev 2018-03-29 00:19:13 +00: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
TreeHugger Robot
eee056d512 Merge "Hide some denials." into pi-dev 2018-03-28 20:27:32 +00:00
Joel Galenson
a66d1a4543 Hide some denials.
These denials occur fairly often, causing some logspam.

Bug: 77225170
Test: Boot device.
Change-Id: Icd73a992aee44007d0873743f706758f9a19a112
2018-03-28 19:38:36 +00:00
Alan Stokes
7d4294cb4f Stop O_CREAT logspam in permissive mode.
In permissive mode we get more spurious denials when O_CREAT is used
with an already-existing file. They're harmless so we don't need to
audit them.

Example denials:
denied { add_name } for name="trigger" scontext=u:r:init:s0 tcontext=u:object_r:sysfs_leds:s0 tclass=dir permissive=1
denied { create } for name="trigger" scontext=u:r:init:s0 tcontext=u:object_r:sysfs_leds:s0 tclass=file permissive=1

Bug: 72643420
Bug: 74182216

Test: Device boots, denials gone.
Change-Id: I54b1a0c138ff5167f1d1d12c4b0b9e9afaa5bca0
2018-03-28 15:07:59 +01:00
TreeHugger Robot
b93b448d56 Merge "Allow vendor-init-settable to persist.radio.multisim.config" into pi-dev 2018-03-28 06:06:23 +00:00
Jaekyun Seok
7d3bd8dbc3 Allow vendor-init-settable to persist.radio.multisim.config
A default value of persist.radio.multisim.config can be set by SoC
vendors, and so vendor-init-settable should be allowed to it.

Bug: 73871799
Test: succeeded building and tested with taimen
Change-Id: Ie62b91e7e3d7e05425b742838417f1cab7b3fed4
Merged-In: Ie62b91e7e3d7e05425b742838417f1cab7b3fed4
(cherry picked from commit ac8c6e3d44)
2018-03-28 12:55:30 +09:00
Andreas Gampe
2767f9d359 Statsd: Allow statsd to contact perfprofd in userdebug
Give statsd rights to connect to perfprofd in userdebug.

(cherry picked from commit 488030ee6f)

Bug: 73175642
Test: mmma system/extras/perfprofd
Merged-In: Idea0a6b757d1b16ec2e6c8719e24900f1e5518fd
Change-Id: Idea0a6b757d1b16ec2e6c8719e24900f1e5518fd
2018-03-28 01:29:16 +00:00
Janis Danisevskis
a290f5760e Keystore needs to be able to call apps
The ConfirmationUI API has a callback interface by which confirmation
results are presented to the calling app. This requires keystore to call
into apps.

Test: Device boots and no more denials when call back is delivered to
      apps.
Bug: 63928580
Change-Id: Ie23211aeb74c39956c3c3b8b32843d35afa1315a
2018-03-27 14:23:20 -07:00
Joel Galenson
408584d5fe Use user policy for compatibility tests.
Use the user policy when running the compatibility tests.

Bug: 74344625
Test: Built policy for many devices.  Booted one device.
Test: Delete some compat rules, verify error on userdebug.
Change-Id: Ib2df2dfc06cdf55a839011e9a528e76160a9e436
(cherry picked from commit c148621815)
2018-03-27 10:19:30 -07:00
Tom Cherry
dc3e1dad04 Verify the SELabels used in property_contexts
Verify that the SELabels used in property_contexts correspond to a
real type in the SEPolicy and that this type has the property_type attribute.

Additionally add a check that vendor property_context files do not
duplicate entries in plat property_contexts, and a similar check that
odm property_contexts doesn't duplicate either plat or vendor
property_contexts.

Bug: 74078792
Test: Build property_contexts on bullhead successfully
Test: See failure when using a faulty SELabel in property_contexts
Test: See failure when duplicating label in vendor and plat property_contexts
Change-Id: I4d2338dab68f1c5a8ed110aa7821f0677f61bafb
(cherry picked from commit a15df75ddf)
2018-03-26 16:32:55 -07:00
TreeHugger Robot
a7c52c5f2b Merge "crashdump: cleanup logs" into pi-dev 2018-03-26 22:43:55 +00:00
Jeff Vander Stoep
cc0304cfc2 crashdump: cleanup logs
Suppress WAI denials from crashdump.

Test: build/flash Taimen. Verify no new denials.
Bug: 68319037
Change-Id: If39d057cb020def7afe89fd95e049e45cce2ae16
2018-03-26 13:07:36 -07:00
TreeHugger Robot
28faedb4c4 Merge "Allow system server to access bpf fs" into pi-dev 2018-03-26 19:26:35 +00:00
Primiano Tucci
e9b8bff6c6 perfetto: allow traced to write into FDs received by the client
This allows an optimization that consists in the "perfetto" cmdline
client passing directly the file descriptor for the output trace
to traced (as opposite to having traced streaming back the trace
data to "perfetto" and having that one doing the write() into file).
This reduces sensibly the memory traffic and CPU overhead of traces
with a minor change.

Bug: 73625179
Test: builds + perfetto_integrationtests w/ long_trace.cfg
Change-Id: I81f5a230338ced20dc543fd91c5a0bd0e58725f2
Merged-In: I81f5a230338ced20dc543fd91c5a0bd0e58725f2
(cherry picked from aosp/648831)
2018-03-26 01:01:36 +00:00
Chenbo Feng
88ef20aa71 Allow system server to access bpf fs
The permission to allow system_server to access sys/fs/bpf/ directory
is missing. Add it back so it can get the bpf maps from the bpf_fs.

Test: device boot and no more denial information of system_server try to
searcg in fs_bpf
      atest android.net.cts.TrafficStatsTest
Bug: 75285088

Change-Id: I1040cde6c038eccc4e91c69a10b20aa7a18b19f6
(cherry picked from aosp commit f83bbd17b2)
2018-03-23 18:45:28 -07:00
Tri Vo
e55424941e modprobe: shouldn't load kernel modules from /system
Kernel modules are not permitted to be on /system partition.
That was one of Treble requirements in O:
https://source.android.com/devices/architecture/kernel/modular-kernels#file-locations

Bug: 74069409
Test: pixel/nexus devices don't have LKMs in /system, so this change
shoudl be harmless.
Test: walleye boots without issues from modprobe.
Merged-In: I8b3aeb55aacb3c99e0486224161d09a64bb52cd1
Change-Id: I8b3aeb55aacb3c99e0486224161d09a64bb52cd1

(cherry picked from commit 6ef9f5232e)
2018-03-23 14:16:25 -07:00
TreeHugger Robot
e2b8881fc0 Merge "Allow vendor-init-settable and public-readable to ro.config.low_ram" into pi-dev 2018-03-23 06:32:42 +00:00