Commit graph

6265 commits

Author SHA1 Message Date
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
Daniel Rosenberg
47fb4b9fc4 sepolicy: Add policy for sdcardfs and configfs
Change-Id: I4c318efba76e61b6ab0be9491c352f281b1c2bff
Bug: 19160983
2016-03-07 11:57:08 -08:00
Nick Kralevich
b7c5a67b73 allow binderservice domains to write to a fifo file
Bug: 27511071
Change-Id: I737aa9daac6c78846fe375300c3338e401d733ac
2016-03-07 11:24:38 -08:00
Nick Kralevich
6e4bcbe6da DO NOT MERGE: untrusted_app: drop /proc auditallow
It's unlikely we'll get /proc locked down for the N release, so
delete the auditallow to avoid spamming the logs. Mark this
commit as DO NOT MERGE so we can continue to make progress on this
for future Android releases.

Change-Id: Ibf27bc5cb1b23c21e123aae8a4f190560d0ac2dc
2016-03-07 09:00:34 -08:00
Jeff Sharkey
0cbedfdfbf Merge "Cached ringtone files should be mlstrustedobject." into nyc-dev 2016-03-06 01:30:43 +00:00
Jeff Sharkey
2f829dcd55 Cached ringtone files should be mlstrustedobject.
Both appdomain and priv_app can set the default ringtones, so the
cache files need to be mlstrustedobject.

avc: denied { write } for path="/data/system_de/0/ringtones/ringtone_cache" dev="mmcblk0p44" ino=1602501 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:ringtone_file:s0 tclass=file permissive=0

Bug: 27366059
Change-Id: Ib362f58b180a62bd46800083d6c538426f955b10
2016-03-05 16:59:29 -07:00
Alex Deymo
a52b561859 New postinstall domain and rules to run post-install program.
When using the A/B updater, a device specific hook is sometimes needed
to run after the new partitions are updated but before rebooting into
the new image. This hook is referred to throughout the code as the
"postinstall" step.

This patch creates a new execution domain "postinstall" which
update_engine will use to run said hook. Since the hook needs to run
from the new image (namelly, slot "B"), update_engine needs to
temporarly mount this B partition into /postinstall and then run a
program from there.

Since the new program in B runs from the old execution context in A, we
can't rely on the labels set in the xattr in the new filesystem to
enforce the policies baked into the old running image. Instead, when
temporarily mounting the new filesystem in update_engine, we override
all the new file attributes with the new postinstall_file type by
passing "context=u:object_r:postinstall_file:s0" to the mount syscall.
This allows us to set new rules specific to the postinstall environment
that are consistent with the rules in the old system.

Bug: 27177071
TEST=Deployed a payload with a trivial postinstall script to edison-eng.

(cherry picked from commit 6cb2c893b1)

Change-Id: I49a529eecf1ef0524819470876ef7c8c2659c7ef
2016-03-04 15:49:15 -08:00
Stephen Smalley
423fd19d91 Update netlink socket classes.
Define new netlink socket security classes introduced by upstream kernel commit
6c6d2e9bde1c1c87a7ead806f8f5e2181d41a652 ("selinux: update netlink socket
classes").  This was merged in Linux 4.2 and is therefore only required
for Android kernels based on 4.2 or newer (e.g. the android-4.4 branch
of the kernel/common tree).

Add the new socket classes to socket_class_set.
Add an initial set of allow rules although further refinement
will likely be necessary.  Any allow rule previously written
on :netlink_socket may need to be rewritten or duplicated for
one or more of the more specific classes.  For now, we retain
the existing :netlink_socket rules for compatibility on older kernels.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>

(cherry picked from commit 01d95c23ab)

Change-Id: Ic00a0d474730cda91ba3bc387e0cc14482f82114
2016-03-03 13:37:40 -08:00
Tao Bao
acf4e09999 Merge "Add /dev/socket/uncrypt." into nyc-dev 2016-03-03 19:52:46 +00:00
Andreas Gampe
ff755159f4 Merge "Sepolicy: Give Otapreopt right to write A/B artifacts in /data" into nyc-dev 2016-03-03 17:19:16 +00:00
Andreas Gampe
c83614b632 Sepolicy: Give Otapreopt right to write A/B artifacts in /data
For apps installed /data (vs the system image), Otapreopt puts
A/B artifacts alongside the regular oat location with a "b" suffix.

Give Otapreopt the right to create and write such files.

Bug: 25612095
Change-Id: Idf3f0959816f49407036cea9b8e684b26c510e80
2016-03-02 18:37:30 -08:00
Nick Kralevich
b6480a5e3b Merge "delete obsolete aliases" into nyc-dev 2016-03-02 23:35:58 +00:00
Tao Bao
c285cad1a6 Add /dev/socket/uncrypt.
system_server used to communicate with uncrypt via files (e.g.
/cache/recovery/command and /cache/recovery/uncrypt_status). Since A/B
devices may not have /cache partitions anymore, we switch to communicate
via /dev/socket/uncrypt to allow things like factory reset to keep
working.

Bug: 27176738
Change-Id: I73b6d6f1ecdf16fd4f3600b5e524da06f35b5bca
2016-03-02 10:51:13 -08:00
Fyodor Kupolov
79bb5d8f00 Merge "Add NetworkTimeUpdateService" into nyc-dev 2016-03-02 18:18:37 +00:00
Nick Kralevich
c321186e1e delete obsolete aliases
no longer used nor desired.

Change-Id: Iac447fb2291371caa4a8ec255db114d9f7ccdddb
2016-03-02 10:10:21 -08:00
Lorenzo Colitti
5f376c1fed Allow netd to check permissions.
Bug: 27239233
Change-Id: I82e3451542f08de67ad950223be90e37a2d3e899
2016-03-02 23:07:12 +09:00
Lorenzo Colitti
9119f12ee3 Revert "Revert "netd: restrict netd binder access to system_server""
This reverts commit b5594c2781.

Bug: 27239233
Change-Id: I407a2f3a313f3de801080f9bae46f6bac1a803c2
2016-03-02 22:59:09 +09:00
Lorenzo Colitti
f723f5f986 Merge "Revert "netd: restrict netd binder access to system_server"" into nyc-dev 2016-03-02 12:45:59 +00:00
Lorenzo Colitti
b5594c2781 Revert "netd: restrict netd binder access to system_server"
This reverts commit 544579597e.

Change-Id: Idfa0254e66f9517cc26af3c37441b47cbb984bca
2016-03-02 07:53:54 +00:00
Jeff Sharkey
8c09b65d8f Allow Phone to write cached ringtones.
avc: denied { write } for path="/data/system_de/0/ringtones/ringtone_cache" dev="mmcblk0p44" ino=1602501 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:ringtone_file:s0 tclass=file permissive=0

Bug: 27366059
Change-Id: I120a69ac4f58c64db6f169ae4f9942ce357b0b1f
2016-03-01 18:02:03 -07:00
Makoto Onuki
7508224f61 Add new system service "shortcut".
Bug 27325877

Change-Id: Idf2f9ae816e1f3d822a6286a4cf738c14e29a45e
2016-03-01 15:12:11 -08:00
Calin Juravle
837bc42f5f Add SElinux policies to allow foreign dex usage tracking.
This is a special profile folder where apps will leave profile markers
for the dex files they load and don't own. System server will read the
markers and decide which apk should be fully compiled instead of
profile guide compiled.

Apps need only to be able to create (touch) files in this directory.
System server needs only to be able to check wheter or not a file with a
given name exists.

Bug: 27334750
Bug: 26080105

Change-Id: I2256e4aba1ec0e5117de6497123223b9a74f404e
2016-03-01 15:50:08 +00:00
Nick Kralevich
ba12da9572 Allow bluetooth access to the tun device.
Bluetooth uses the tun device for tethering. Allow access.

  STEPS TO REPRODUCE:
  0. Have two devices to test on, say Device A and Device B
  1. On Device A, Go to settings ->Bluetooth .
  2. Turn on the Bluetooth .
  3. Pair it with device B
  4. Tap on the paired device

  OBSERVED RESULTS:
  -Bluetooth share crash is observed with "Bluetooth share has stopped"
  error message
  -Unable to use Bluetooth tethering due to this issue

  EXPECTED RESULTS:
  No crash and Bluetooth devices should be able to connect for tethering

Addresses the following denial:

com.android.bluetooth: type=1400 audit(0.0:131): avc: denied { open }
for comm=425420536572766963652043616C6C path="/dev/tun" dev="tmpfs"
ino=12340 scontext=u:r:bluetooth:s0 tcontext=u:object_r:tun_device:s0
tclass=chr_file permissive=0

Bug: 27372573

(cherry picked from commit 9a1347eee6)

Change-Id: Ibd16e48c09fe80ebb4f3779214de3b4806c12497
2016-02-29 10:05:08 -08:00
Marco Nelissen
50bcd14846 Merge "mediacodec: grant access to surfaceflinger" into nyc-dev 2016-02-28 17:14:56 +00:00
Marco Nelissen
6c53b23da8 mediacodec: grant access to surfaceflinger
avc:  denied  { find } for service=SurfaceFlinger scontext=u:r:mediacodec:s0
tcontext=u:object_r:surfaceflinger_service:s0 tclass=service_manager

Bug: 26990688
Change-Id: Ie7c5f6d879c286375eb52ef4c6b84726aa4f1ba2
2016-02-27 21:27:07 -08:00