Commit graph

6289 commits

Author SHA1 Message Date
Daniel Rosenberg
81d2811cbb Merge "Allow access to media_rw_data_file for now." into nyc-dev 2016-03-31 21:00:21 +00:00
Daniel Rosenberg
d25d57a3cd Allow access to media_rw_data_file for now.
With sdcardfs, we no longer have a separate sdcardd acting as
an intermediate between the outside world and /data/media.
Unless we modify sdcardfs to change contexts, we need these.
Added for: adbd, kernel, mediaserver, and shell

Remove this patch if sdcardfs is updated to change the
secontext of fs accesses.

Bug: 27915475
Bug: 27937873

Change-Id: I25edcfc7fb8423b3184db84040bda790a1042724
2016-03-31 20:56:44 +00:00
Daniel Rosenberg
0f3c37aecc Merge "Allow shell and adbd access to media_rw_data_file for now." into nyc-dev 2016-03-31 02:39:06 +00:00
Daniel Rosenberg
bb90999e9a Allow shell and adbd access to media_rw_data_file for now.
With sdcardfs, we no longer have a separate sdcardd acting as
an intermediate between the outside world and /data/media.
Unless we modify sdcardfs to change contexts, we need these.

Remove this patch if sdcardfs is updated to change the
secontext of fs accesses.

Bug: 27925072
Change-Id: I3ad37c0f12836249c83042bdc1111b6360f22b3c
2016-03-30 18:59:13 -07:00
Daniel Cashman
4056af811f Merge "Add cts artifact tag for use in CTS tests." into nyc-dev 2016-03-30 21:20:01 +00:00
Jeff Vander Stoep
94cb11fb2f priv_app: allow safetynet to read exec_type on /system
Bug: 27545805
Change-Id: I6281dd64c51f74b467deb7acd5cd4403696dcff2
2016-03-30 12:40:38 -07:00
dcashman
48a29397d2 Add cts artifact tag for use in CTS tests.
Bug: 21266225
Change-Id: I649c2ae36340d1f2b3db478e90e125c473b47b6e
2016-03-30 08:54:55 -07:00
Daichi Hirono
f19fb0c973 Add mlstrustedobject to appfuse object type.
To write bytes to appfuse file from priv_app, we need to specify
mlstrustedobject.
The CL fixes the following denial.

type=1400 audit(0.0:77): avc: denied { write } for name="10" dev="fuse" ino=10 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:app_fuse_file:s0 tclass=file permissive=0

BUG=23093747

(cherry picked from commit 4d19f98c72)

Change-Id: I9901033bb3349d5def0bd7128db45a1169856dc1
2016-03-29 21:36:37 +09:00
Calin Juravle
f51c05485c Give dex2oat getattr rights on profiles
Similar to profman, dex2oat does more checks on profiles now.
It needs to be able to do stat to test for existance and non-emptiness.

03-28 10:41:06.667  8611  8611 W dex2oat : type=1400 audit(0.0:129):
avc: denied { getattr } for
path="/data/misc/profiles/ref/com.google.android.apps.magazines/primary.prof"
dev="dm-0" ino=636928 scontext=u:r:dex2oat:s0
tcontext=u:object_r:user_profile_data_file:s0 tclass=file permissive=0

Bug: 27860201
Change-Id: I3a7cb396596ae28a375ea98224ada29f093f475e
2016-03-28 22:59:50 +01:00
Calin Juravle
070f562533 Give profman getattr rights on profiles.
We do a bit more work checks in the runtime for the profiles and call
stat on the files to see if they exists and their are not empty.

SElinux error
[  297.842210] type=1400 audit(1459106986.097:7): avc: denied { getattr
} for pid=4504 comm="profman"
path="/data/misc/profiles/cur/0/com.google.android.youtube/primary.prof"
dev="dm-1" ino=636936 scontext=u:r:profman:s0
tcontext=u:object_r:user_profile_data_file:s0:c512,c768 tclass=file
permissive=0

Bug: 27860201
Change-Id: Ic97882e6057a4b5c3a16089b9b99b64bc1a3cd98
2016-03-28 14:23:11 +01:00
Nick Kralevich
ce35cec3a8 Merge "Make sure neverallow rules also cover other property types" into nyc-dev 2016-03-25 23:07:13 +00:00
Mark Salyzyn
ab33c46905 init: logpersist access on debug
(cherry pick from commit 121f5bfd80)

03-25 09:31:22.996     1     1 W init    : type=1400 audit(0.0:8): \
  avc: denied { getattr } for path="/data/misc/logd/logcat.052" \
  dev="dm-2" ino=124778 scontext=u:r:init:s0 \
  tcontext=u:object_r:misc_logd_file:s0 tclass=file permissive=0
. . .

Introduced a new macro not_userdebug_nor_eng()

Change-Id: I9c3a952c265cac096342493598fff7d41604ca45
2016-03-25 14:40:40 -07:00
Mark Salyzyn
6a706e7e2a dumpstate: access to /data/misc/recovery
(cherry pick from commit 4bf9a47ea8)

Bug: 27176738
Change-Id: I70e4b7b54044dd541076eddd39a8e9f5d881badf
2016-03-25 14:32:58 -07:00
Nick Kralevich
45737b9f58 Make sure neverallow rules also cover other property types
There are now individual property files to control access to
properties. Don't allow processes other than init to write
to these property files.

Change-Id: I184b9df4555ae5051f9a2ba946613c6c5d9d4403
2016-03-25 14:09:30 -07:00
Jeffrey Vander Stoep
6b65143f79 Merge "sysfs_uio: declare type in core policy" into nyc-dev 2016-03-25 15:42:39 +00:00
Jeff Vander Stoep
cf37f9ea95 sysfs_uio: declare type in core policy
(cherry picked from commit f2d07904f7)

/dev/uio uio_device is already declared. Accessing uio through /sys
is also common.

Bug: 26990688
Change-Id: I3db941161dae31d3b87f265708abbcd9171a2c1f
2016-03-25 08:32:23 -07:00
Pierre Imai
0b8a181ecd Merge "Remove references to deleted dhcpcd" into nyc-dev 2016-03-25 04:31:21 +00:00
Mark Salyzyn
6705526ddf Merge "Add recovery_persist & recovery_refresh" into nyc-dev 2016-03-24 19:53:14 +00:00
Mark Salyzyn
05806470b7 Add recovery_persist & recovery_refresh
(cherry pick from commit 16fe52c90c)

One time executables. recovery_refresh can be used at any time to
ensure recovery logs in pmsg are re-placed at the end of the FIFO.
recovery_persist takes the recovery logs in pmsg and drops them
into /data/misc/recovery/ directory.

Bug: 27176738
Change-Id: Ife3cf323930fb7a6a5d1704667961f9d42bfc5ac
2016-03-24 12:48:26 -07:00
dcashman
98eff7c3d4 Move sysfs_thermal to global policy and grant access.
sysfs_thermal nodes are common enough to warrant an entry in global
policy and the new HardwarePropertiesManagerService exists explicitly to
expose some of this information.

Address the following denials:
avc: denied { search } for name="thermal" dev="sysfs" ino=17509 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=dir permissive=1
avc: denied { read } for name="temp" dev="sysfs" ino=17848 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=1
avc: denied { open } for path="/sys/devices/virtual/thermal/thermal_zone8/temp" dev="sysfs" ino=17848 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=1
avc: denied { getattr } for path="/sys/devices/virtual/thermal/thermal_zone8/temp" dev="sysfs" ino=17848 scontext=u:r:system_server:s0 tcontext=u:object_r:sysfs_thermal:s0 tclass=file permissive=1

Bug: 27809332
Change-Id: I2dbc737971bf37d197adf0d5ff07cb611199300d
2016-03-24 09:40:39 -07:00
Pierre Imai
c585995185 Remove references to deleted dhcpcd
Change-Id: I0c0bce9cd50a25897f5c4521ee9b4fada6648a59
2016-03-24 09:41:33 +09:00
Nick Kralevich
4ee494cce1 global_macros: Allow directory locking
See https://groups.google.com/d/msg/android-ndk/BbEOA9pnR-I/HgLkGy5qAgAJ

Addresses the following denial:

  avc: denied { lock } for path="/data/data/com.mypackage/files/somefilename" dev="mmcblk0p28" ino=114736 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0

While I'm here, also add lock to w_file_perms.

Change-Id: I2568a228099c4e112e4a8b80da3bfcf2e35eb0ea
2016-03-22 09:07:24 -07:00
Vladislav Kuzkokov
9afb407be8 Merge "Allow access to IProxyService to untrusted apps." into nyc-dev 2016-03-22 13:43:18 +00:00
Vladislav Kuzkokov
b9562f1920 Allow access to IProxyService to untrusted apps.
Access to modifying methods of ProxyService is
checked in implementation.

Bug: 27337770
Change-Id: I718ea8f4fd6be940ee9ef57f0571d884a013489b
2016-03-22 14:35:13 +01:00
Daniel Rosenberg
cf8719e7ba Merge "sepolicy: Add policy for sdcardfs and configfs" into nyc-dev 2016-03-22 00:46:48 +00:00
Felipe Leme
92aefee483 Add rules to allow dumpstate to run systrace.
Cherry picked from 610f461ecf (AOSP).

BUG: 27419521
Change-Id: I63108468d75be3ef7f9761107a3df8997f207d07
2016-03-19 00:54:46 +00:00
Nick Kralevich
abead06f60 allow priv_app self:process ptrace
The changes to ptrace in
https://android-review.googlesource.com/#/c/175786/ (removing it from
app.te and only adding it to isolated_app and untrusted_app) broke
WebView crash handling in cases where privileged apps (like gmscore) use
WebView.

The only way to fix this would be to allow priv_app to self-ptrace as
well. :/

Bug: 27697529
Change-Id: Ib9a3810dddc9f4213b6260133cbae23f669ae8dc
2016-03-16 12:59:46 -07:00
Peng Xu
1c50994e1b Create SELinux label for contexhub_service
SELinux label is created for contexthub_service system service.

ContextHub service manages all available context hubs and serves fulfil communication between apps
and underlying context hub hardware.

Change-Id: I8470fedd9c79a00012e1cdb9b548a1b632ba7de6
2016-03-15 15:44:49 -07:00
dcashman
027ec20696 Mark batteryproperties service as app_api_service.
Applications do not explicitly request handles to the batteryproperties
service, but the BatteryManager obtains a reference to it and uses it
for its underlying property queries.  Mark it as an app_api_service so
that all applications may use this API.  Also remove the batterypropreg
service label, as this does not appear to be used and may have been a
duplication of batteryproperties.  As a result, remove the
healthd_service type and replace it with a more specific
batteryproperties_service type.

(cherry-picked from commit: 9ed71eff4b)

Bug: 27442760
Change-Id: I537c17c09145b302728377bf856c1147e4cc37e9
2016-03-14 16:09:42 -07:00
Polina Bondarenko
d79d753ac2 Merge "Renamed hardwareproperties to hardware_properties" into nyc-dev 2016-03-14 17:41:58 +00:00
Daniel Cashman
9404522aeb Merge "Create sysfs_hwrandom type." into nyc-dev 2016-03-14 17:14:26 +00:00
dcashman
85c0f8affa Create sysfs_hwrandom type.
HwRngTest needs access to the hwrandom sysfs files, but untrused_app
does not have access to sysfs.  Give these files their own label and
allow the needed read access.

Bug: 27263241
Change-Id: I718ba485e9e6627bac6e579f746658d85134b24b
2016-03-11 15:44:44 -08:00
Daniel Cashman
5b77283384 Merge "Allow domains to getattr proc lnk_file." into nyc-dev 2016-03-10 22:46:13 +00:00
Josh Gao
5d2fe0e20b Merge "Allow debuggerd to send SIGKILL." into nyc-dev 2016-03-10 22:32:34 +00:00
Nick Kralevich
ff27450644 system_server: clean up duplicate permissions
Remove permissions which are already covered by other permissions.

Found by running:

  sepolicy-analyze path/to/sepolicy dups

No functional change.

Change-Id: I526d1c1111df718b29e8276b024fa0788ad17c71
2016-03-10 14:26:09 -08:00
dcashman
74ae21b31a Allow domains to getattr proc lnk_file.
Many permissions were removed from untrusted_app by the removal of
domain_deprecated, including procfs access. procfs file access was restored,
however, but not completely.  Add the ability to getattr to all domains,
so that other domains which lost domain_deprecated may benefit, as they
will likely need it.

Bug: 27249037
Change-Id: Id3f5e6121548b29d739d5e0fa6ccdbc9f0fc29be
2016-03-10 14:17:44 -08:00
Josh Gao
fd841ad302 Allow debuggerd to send SIGKILL.
Bug: http://b/27367422
Change-Id: I936c16281e06214b35f8d245da8f619dc92ff15f
(cherry picked from commit 48141c3675)
2016-03-10 13:58:40 -08:00
Oleksandr Peletskyi
33fe4784c3 Modified security policy to allow user to get their own icon.
BUG: 27583869
Change-Id: I0a25bd03f3998d48dba355b91140611e38ce7b0d
2016-03-10 14:11:36 +01:00
Jeffrey Vander Stoep
012763fcbc Merge "priv_app: allow access to mediadrmserver_service" into nyc-dev 2016-03-09 18:52:41 +00:00
Jeff Vander Stoep
7aed1b253f priv_app: allow access to mediadrmserver_service
Addresses:
avc:  denied  { find } for service=media.drm pid=6030 uid=10012
scontext=u:r:priv_app:s0:c512,c768
tcontext=u:object_r:mediadrmserver_service:s0 tclass=service_manager

Bug: 27553530
Change-Id: I060de7ee1f66c7a545076b7de8363bebaac61f2c
2016-03-09 10:21:39 -08:00
Makoto Onuki
671127790c Merge "Allow "shortcut manager" icons to be returned to apps" into nyc-dev 2016-03-09 17:37:32 +00:00
Polina Bondarenko
447fd30d21 Renamed hardwareproperties to hardware_properties
Bug: 27531271
Change-Id: I3c5eee86d09696373ab155f93ba6c85da224cb51
2016-03-09 18:13:11 +01:00
Torne (Richard Coles)
e6d67390cc Allow isolated_app to talk to webviewupdate_service.
It's okay for isolated apps to connect to the webview update service to
find out which APK is WebView. This enables isolated renderer processes
to load their code from the WebView APK.

Change-Id: Ia287280a994dbd852b4f630da5548e7b6cf4e08f
2016-03-09 14:36:56 +00:00
Makoto Onuki
085c16914c Allow "shortcut manager" icons to be returned to apps
... and client apps to read them.

A full path looks like this:
/data/system_ce/[user-id]/shortcut_service/bitmaps/[creator-app-package]/[timestamp].png

System server will:
- Create/delete the directories.
- Write/remove PNG files in them.
- Open the PNG files and return file descriptors to client apps

Client apps will:
- Receive file descriptors and read from them.

Bug 27548047

Change-Id: I3d9ac6ab0c92b2953b84c3c5aabe1f653e6bea6b
2016-03-08 17:09:27 -08:00
Calin Juravle
d6c9947f60 Merge "Give vold setattr/getattr permissions to foreign dex files domain." into nyc-dev 2016-03-08 00:15:32 +00:00
Calin Juravle
cfb36df7c7 Give vold setattr/getattr permissions to foreign dex files domain.
Vold needs to be able to query if the directory exists and
eventually to fix permissions and the owner.

Typical error:
W vold    : type=1400 audit(0.0:485): avc: denied { getattr } 
for path="/data/misc/profiles/cur/11/foreign-dex" dev="dm-2" 
ino=343857 scontext=u:r:vold:s0
tcontext=u:object_r:user_profile_foreign_dex_data_file:s0 tclass=dir 
permissive=0


Bug: 27517932
Change-Id: Iff10c864634baa97cc814916ee7495b262e0c7eb
2016-03-07 23:38:00 +00:00
Makoto Onuki
def5d16e3c Merge "Add new system service "shortcut"." into nyc-dev 2016-03-07 23:08:43 +00:00
dcashman
16cbb57fb8 Allow appdomain to dump info to dumpstate.
Bug: 27511071
Change-Id: I99ea21638a4df8ad1f815d91bb970e1f8f143030
2016-03-07 14:22:34 -08:00
Ruben Brunk
c03ac3c43e Merge "Allow applications to read cgroup objects." into nyc-dev 2016-03-07 22:02:05 +00:00
Ruben Brunk
31a2de9bff Allow applications to read cgroup objects.
- Required to query cpusets information.

Bug: 22855417
Bug: 27381794
Bug: 27498731

Change-Id: I6d192aad2135d99a6c9cdaf97696b0822bd21897
2016-03-07 21:52:00 +00:00