Commit graph

2762 commits

Author SHA1 Message Date
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
c8a58767bb Merge "Allow dumpstate to read property_type" into pi-dev 2018-04-17 01:44:50 +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
TreeHugger Robot
7b90367a7b Merge "Add exFAT support; unify behind "sdcard_type"." into pi-dev 2018-04-16 23:15:22 +00:00
Jaekyun Seok
f99c74ccf8 Allow dumpstate to read property_type
dumpstate needs to read all the system properties for debugging.

Bug: 77277669
Test: succeeded building and tested with taimen
Change-Id: I3603854b3be67d4fc55d74f7925a21bfa59c81ee
Merged-In: I3603854b3be67d4fc55d74f7925a21bfa59c81ee
(cherry picked from commit 4de238e9b9)
2018-04-17 07:44:05 +09:00
TreeHugger Robot
6991a930e1 Merge "Allow vendor_init to write to misc_block_device" into pi-dev 2018-04-16 22:01:16 +00: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
Jeff Vander Stoep
fde3e6a0f7 tombstoned: allow unlinking anr files
Tombstoned unlinks "trace_XX" files if there are too many of them.

avc: denied { unlink } for comm="tombstoned" name="trace_12"
scontext=u:r:tombstoned:s0 tcontext=u:object_r:anr_data_file:s0
tclass=file

Bug: 77970585
Test: Build/boot taimen. adb root; sigquit an app.

(cherry picked from commit eb8f938fd4)

Change-Id: I2f29d12f747d688f8f4e06b48cf72c5109adc2ae
2018-04-16 12:51:35 +01:00
TreeHugger Robot
c9523bd47c Merge "Make traced_probes mlstrustedsubject." into pi-dev 2018-04-13 17:07:30 +00:00
Tom Cherry
1f6018ea62 Allow vendor_init to write to misc_block_device
Vendors may use this to write custom messages to their bootloader, and
as the bootloader is under vendor control, this makes sense to allow.

Bug: 77881566
Test: build
Merged-In: I78f80400e5f386cad1327a9209ee1afc8e334e56
Change-Id: I78f80400e5f386cad1327a9209ee1afc8e334e56
(cherry picked from commit db465285cf)
2018-04-13 10:00:06 -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
Florian Mayer
e3919e95fd Make traced_probes mlstrustedsubject.
Denials:
04-12 12:42:47.795   903   903 W traced_probes: type=1400 audit(0.0:5684): avc: denied { search } for name="1376" dev="proc" ino=204553 scontext=u:r:traced_probes:s0 tcontext=u:r:untrusted_app_27:s0:c512,c768 tclass=dir permissive=0
04-12 12:42:47.795   903   903 W traced_probes: type=1400 audit(0.0:5685): avc: denied { search } for name="1402" dev="proc" ino=204554 scontext=u:r:traced_probes:s0 tcontext=u:r:platform_app:s0:c512,c768 tclass=dir permissive=0
04-12 12:42:47.801   903   903 W traced_probes: type=1400 audit(0.0:5686): avc: denied { search } for name="1496" dev="proc" ino=204557 scontext=u:r:traced_probes:s0 tcontext=u:r:untrusted_app:s0:c85,c256,c512,c768 tclass=dir permissive=0
04-12 12:42:47.805   903   903 W traced_probes: type=1400 audit(0.0:5687): avc: denied { search } for name="1758" dev="proc" ino=204563 scontext=u:r:traced_probes:s0 tcontext=u:r:priv_app:s0:c512,c768 tclass=dir permissive=0

Bug: 77955286

Change-Id: If0985d3ddd7d14c2b139be1c842c9c8df99b90db
2018-04-12 19:05:22 +01:00
Jaekyun Seok
ac2e4cce71 Allow vendor-init-readable for sys.boot_completed and dev.bootcomplete
Bug: 75987246
Test: succeeded builing and tested with taimen
Change-Id: I2d8bc91c305e665ed9c69459e51204117afb3eee
2018-04-12 08:12:25 +09:00
TreeHugger Robot
2e532d4039 Merge "Widen crash_dump dontaudit." into pi-dev 2018-04-11 21:48:23 +00:00
Joel Galenson
a01e93130d Widen crash_dump dontaudit.
We have seen crash_dump denials for radio_data_file,
shared_relro_file, shell_data_file, and vendor_app_file.  This commit
widens an existing dontaudit to include them as well as others that we
might see.

Bug: 77908066
Test: Boot device.
Change-Id: I9ad2a2dafa8e73b13c08d0cc6886274a7c0e3bac
(cherry picked from commit a3b3bdbb2f)
2018-04-11 11:02:06 -07:00
Joel Galenson
e477c781d4 Hide sys_rawio SELinux denials.
We often see the following denials:

avc: denied { sys_rawio } for comm="update_engine" capability=17 scontext=u:r:update_engine:s0 tcontext=u:r:update_engine:s0 tclass=capability permissive=0
avc: denied { sys_rawio } for comm="boot@1.0-servic" capability=17 scontext=u:r:hal_bootctl_default:s0 tcontext=u:r:hal_bootctl_default:s0 tclass=capability permissive=0

These are benign, so we are hiding them.

Bug: 37778617
Test: Boot device.
Change-Id: Iac196653933d79aa9cdeef7670076f0efc97b44a
(cherry picked from commit bf4afae140)
2018-04-11 10:53:36 -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
Yifan Hong
9370b51a95 Merge "hal_health: allow to write kernel logs." into pi-dev 2018-04-06 21:03:34 +00:00
Yifan Hong
306b26710f hal_health: allow to write kernel logs.
This is originally allowed in healthd but the permission
was not transfered to health HAL. A typical health HAL
implementation is likely to write battery info to kernel
logs.

Test: device has battery kernel logs with health HAL
      but without healthd

Bug: 77661605

Change-Id: Ib3b5d3fe6bdb3df2a240c85f9d27b863153805d2
2018-04-06 10:23:39 -07: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
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
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
TreeHugger Robot
49e7b04ad3 Merge "Selinux: Fix perfprofd policy" into pi-dev 2018-04-03 00:44:35 +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
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
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
TreeHugger Robot
ce02b00794 Merge "Wifi HAL SIOCSIFHWADDR sepolicy" into pi-dev 2018-03-30 23:51:43 +00:00
TreeHugger Robot
eaee65f043 Merge "Put in sepolicies for Codec2.0 services" into pi-dev 2018-03-30 17:51:38 +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
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
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
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
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
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
Jaekyun Seok
2c6cacf45f Allow vendor-init-settable and public-readable to ro.config.low_ram
ro.config.low_ram should be set on Android Go devices by SoC vendors,
and the value can be read by vendor components.

Bug: 76132948
Bug: 75987246
Test: succeeded building and tested with taimen
Change-Id: I6ac98fa58cf641da4565d6277898fc5e5e6ceca1
Merged-In: I6ac98fa58cf641da4565d6277898fc5e5e6ceca1
(cherry picked from commit 7dd2e025d8)
2018-03-23 13:15:13 +09:00
Jong Wook Kim
d6d16489f2 Wifi HAL SIOCSIFHWADDR sepolicy
Add sepolicy rule to grant Wifi HAL permission to use SIOCSIFHWADDR
ioctl. This permission is needed to dynamically change MAC address of
the device.

We are moving the implementation of setting the MAC address from
WifiCond to Vendor HAL to give vendors flexibility in supporting
Connected MAC Randomization. Will clean up WifiCond sepolicy afterwards.

Bug: 74347653
Test: Verified manually
Change-Id: I334cefddf385ecb1ee169eb692c4e0060c26d6d9
2018-03-22 13:18:31 -07:00
TreeHugger Robot
bfee690152 Merge "Revert "Allow dexopt to follow /odm/lib(64) symlinks."" into pi-dev 2018-03-22 01:55:34 +00:00
Fyodor Kupolov
c5b15872ac Merge "Added SELinux policy for BinderCallsStatsService" into pi-dev 2018-03-21 23:02:58 +00:00
Fyodor Kupolov
624dc30de4 Added SELinux policy for BinderCallsStatsService
Test: manual
Bug: 75318418
Merged-In: I700c1b8b613dba1c99f4fbffdd905c0052c1b2e7
Change-Id: I700c1b8b613dba1c99f4fbffdd905c0052c1b2e7
2018-03-21 00:50:33 +00:00
Tri Vo
0746a306ee Merge changes from topic "dontaudit_proc_sys" into pi-dev
* changes:
  silence innocuous denials to /proc and /sys
  proc_type attribute for files under /proc.
2018-03-20 23:48:47 +00:00
Tri Vo
f170dfb789 silence innocuous denials to /proc and /sys
Bug: 74182216
Test: build policy
Change-Id: Idf90c1a96943266d52508ce72b8554d8b5c594c9
(cherry picked from commit 09b1d962ef)
2018-03-20 14:22:16 -07:00