Commit graph

710 commits

Author SHA1 Message Date
Alex Klyubin
1fdee11df2 1/2: Rename domain "system" to "system_server".
This is a follow-up CL to the extraction of "system_app" domain
from the "system" domain which left the "system" domain encompassing
just the system_server.

Since this change cannot be made atomically across different
repositories, it temporarily adds a typealias "server" pointing to
"system_server". Once all other repositories have been switched to
"system_server", this alias will be removed.

Change-Id: I90a6850603dcf60049963462c5572d36de62bc00
2013-09-17 08:40:12 -07:00
Stephen Smalley
a770f55b18 Remove dbusd policy; dbusd is no more.
Change-Id: I9652284bd34d07bd47e2e7df66fcbe5db185ab3f
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-09-13 16:16:25 -07:00
Stephen Smalley
1d435de685 Remove bluetoothd policy; bluetoothd is no more.
Change-Id: I153b0aa8a747d6c79839d06fc04b3923eacfa213
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-09-13 16:15:25 -07:00
Stephen Smalley
8840fa7f85 Split system_app from system.
system_app is for apps that run in the system UID, e.g. Settings.
system is for the system_server.
Split them into separate files and note their purpose in the comment
header of each file.

Change-Id: I19369abc728ba2159fd50ae6b230828857e19f10
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-09-13 15:09:11 -07:00
Stephen Smalley
a62d5c6679 Drop obsolete comments about SEAndroidManager.
Change-Id: I6b27418507ebd0113a97bea81f37e4dc1de6da14
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-09-13 13:26:14 -07:00
Stephen Smalley
c0845036cc Remove sys_nice capability from domains.
Remove sys_nice capability from domains; this does not appear to be necessary
and should not be possible in particular for app domains.  If we encounter
specific instances where it should be granted, we can add it back on a
per-domain basis.  Allow it explicitly for the system_server.  Unconfined
domains get it via unconfined_domain() and the rules in unconfined.te.

Change-Id: I9669db80a04a90a22241b2fbc5236a28dcde8c6e
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-09-13 13:06:36 -07:00
Nick Kralevich
d1f448d4a5 Merge changes Icd71c967,I3fd90ad9
* changes:
  Do not permit appdomain to create/write to download_file.
  Remove duplicated rules between appdomain and isolated_app.
2013-09-13 19:59:47 +00:00
Stephen Smalley
29326eda65 Drop domain write access to sysfs for the emulator.
3.4 goldfish kernel supports sysfs labeling so we no longer need this.

Change-Id: I77514a8f3102ac8be957c57d95e7de7d5901f69d
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-09-13 18:29:03 +00:00
Stephen Smalley
0f7641d83d Label all files under /sys/qemu_trace with sysfs_writable.
Otherwise we have different security contexts but the same DAC
permissions:
-rw-rw-rw- root     root              u:object_r:sysfs_writable:s0 process_name
-rw-rw-rw- root     root              u:object_r:sysfs:s0 state
-rw-rw-rw- root     root              u:object_r:sysfs:s0 symbol

This change fixes denials such as:
type=1400 msg=audit(1379096020.770:144): avc:  denied  { write } for  pid=85 comm="SurfaceFlinger" name="symbol" dev="sysfs" ino=47 scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:sysfs:s0 tclass=file

Change-Id: I261c7751da3778ee9241ec6b5476e8d9f96ba5ed
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-09-13 14:24:24 -04:00
Stephen Smalley
17454cf805 Do not permit appdomain to create/write to download_file.
The comment says that apps can read downloaded files, but the
file_type_auto_trans() macro expands to permit create/write access.
Also we don't need a type transition when staying in the same type
as the parent directory so we only truly need allow rules here.
Hence, we remove file_type_auto_trans() altogether, and add an allow
rule for search access to the directory.  If create/write access is
truly required, then we can just change the allow rules to use
rw_dir_perms and create_file_perms.

Change-Id: Icd71c9678419442cfd8088317317efd4332f9b4a
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-09-13 16:50:04 +00:00
Stephen Smalley
5b00f22349 Remove duplicated rules between appdomain and isolated_app.
r_dir_file(appdomain, isolated_app) was in both app.te and isolated_app.te;
delete it from isolated_app.te.
binder_call(appdomain, isolated_app) is a subset of binder_call(appdomain, appdomain); delete it.

Change-Id: I3fd90ad9c8862a0e4dad957425cbfbc9fa97c63f
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-09-13 12:48:10 -04:00
Stephen Smalley
640991bb3c Extend to check indirect allow rules and conditional rules.
$ sepolicy-check -s untrusted_app -t mediaserver -c binder -p call -P out/target/product/manta/root/sepolicy
Match found!

Also removed loading of initial SIDs as that is not required for
this functionality and it leaks memory as it is never freed.
valgrind now reports no leaks.

Change-Id: Ic7a26fd01c57914e4e96db504d669f5367542a35
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-09-12 16:26:06 -04:00
Nick Kralevich
a24a991dd5 Allow apps to execute app_data_files
Fixes the following denial:

<5>[28362.335293] type=1400 audit(1378991198.292:24): avc:  denied  { execute } for  pid=1640 comm="facebook.katana" path="/data/data/com.facebook.katana/app_libs/libfb_jpegturbo.so" dev="mmcblk0p23" ino=652556 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:app_data_file:s0 tclass=file

Change-Id: I4a515610149f06f0c49194feb6bc96e9b3080c12
2013-09-12 12:19:31 -07:00
Alex Klyubin
a2477056ae Permit writing to /dev/random and /dev/urandom.
Apps attempting to write to /dev/random or /dev/urandom currently
succeed, but a policy violation is logged. These two Linux RNG
devices are meant to be written to by arbitrary apps. Thus, there's
no reason to deny this capability.

Bug: 10679705

Change-Id: Ife401f1dd2182889471eef7e90fcc92e96f9c4d6
2013-09-10 12:01:15 -07:00
Alex Klyubin
34a8e12112 Permit installd to unlink all types of data_file_type.
This enables installd to uninstall or clear data of installed apps
whose data directory contains unusual file types, such as FIFO.

Bug: 10680357

(cherry picked from commit 839af9edb5)

Change-Id: I5715f7d6d3214896ad0456d614b052cf5fb79eef
2013-09-10 11:48:03 -07:00
Stephen Smalley
a473e29de0 write_klog also requires write permission to the directory.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-09-10 11:10:02 -04:00
Stephen Smalley
79e084fcc9 Allow access to /data/security/current symbolic link.
Change-Id: Ic500af7b9dac6a9b6401e99c3d162913e9989d9b
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-09-10 11:09:15 -04:00
William Roberts
9af6f1bd59 Drop -d option on insertkeys.py in Android.mk
This breaks the ability for users to have certs in many
directories. Currently the design is to allow keys.conf
to specify arbitrary locations for pem files, relative to
the root of the Android tree. If users want to have a
common prefix on all the keys, then they can export
DEFAULT_SYSTEM_DEV_CERTIFICATE, and make that an environment
variable in their keys.conf file.

Signed-off-by: William Roberts <wroberts@tresys.com>

Change-Id: I23455b891206cab6eca7db08ff3c28283f87c640
Signed-off-by: William Roberts <wroberts@tresys.com>
2013-09-06 09:51:27 +00:00
Geremy Condra
21d13e9b66 Merge "Fix more long-tail denials." 2013-09-05 23:49:51 +00:00
Geremy Condra
217f8afc18 Fix more long-tail denials.
For additional context-

The denials related to init_tmpfs are of the form:

denied  { read } for  pid=12315 comm=""dboxed_process0"" path=2F6465762F6173686D656D2F64616C76696B2D68656170202864656C6574656429 dev=""tmpfs"" ino=9464 scontext=u:r:isolated_app:s0 tcontext=u:object_r:init_tmpfs:s0 tclass=file

(the path above is "/dev/ashmem/dalvik-heap (deleted)")

The denials related to executing things from the dalvik cache are of the form:

enied  { execute } for  pid=3565 comm=""dboxed_process0"" path=""/data/dalvik-cache/system@app@Chrome.apk@classes.dex"" dev=""mmcblk0p28"" ino=105983 scontext=u:r:isolated_app:s0 tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file

The denials related to isolated_app and the init socket are:

denied  { getattr } for  pid=3824 comm=""Binder_2"" path=""socket:[14059]"" dev=""sockfs"" ino=14059 scontext=u:r:isolated_app:s0 tcontext=u:r:init:s0 tclass=unix_stream_socket

The getopt denials for the aforementioned socket are:

denied  { getopt } for  pid=3824 comm=""Binder_2"" path=""/dev/socket/dumpstate"" scontext=u:r:isolated_app:s0 tcontext=u:r:init:s0 tclass=unix_stream_socket

Change-Id: I3c57702e2af5a779a7618da9aa40930e7f12ee49
2013-09-05 16:45:04 -07:00
Geremy Condra
66826d5e15 Merge "Fix miscellaneous long-tail denials." 2013-09-04 23:26:12 +00:00
Nick Kralevich
2f40a17a42 Revert "Add the ability to write shell files to the untrusted_app domain."
At this point, we still don't understand the root cause of
bug 10290009, or if it's even a real bug.  Rollback
29d0d40668 so we an get a device
in this state and figure out the root cause of this problem.

This reverts commit 29d0d40668.

Bug: 10290009
2013-09-04 16:12:33 -07:00
Geremy Condra
d615ef3477 Fix miscellaneous long-tail denials.
Change-Id: Ie0947f79c63f962220d3c9316c5d5d82f677821f
2013-09-04 16:09:50 -07:00
Geremy Condra
fc2bd01b60 Give Zygote the ability to write app data files.
This fixes another bug encountered while taking bugreports.

Bug: 10498304
Change-Id: Ie33e869ccd28c5461f4f3736c078b2a865aa7cdd
2013-08-30 15:48:56 -07:00
Geremy Condra
81560733a4 Fix denials encountered while getting bugreports.
Bug: 10498304
Change-Id: I312665a2cd09fa16ae3f3978aebdb0da99cf1f74
2013-08-30 15:10:17 -07:00
dcashman
765e95f99f Merge "quash SELinux denial for healthd" 2013-08-29 20:51:59 +00:00
Geremy Condra
3fada57ab4 am cec3c1e4: am e0362602: Add capabilities to Zygote to fix valgrind.
* commit 'cec3c1e44677c790de00cfa7f8901bcbe8a59c82':
  Add capabilities to Zygote to fix valgrind.
2013-08-28 16:42:25 -07:00
Geremy Condra
cec3c1e446 am e0362602: Add capabilities to Zygote to fix valgrind.
* commit 'e03626021e341b48665ae55a34493cafafd1a08d':
  Add capabilities to Zygote to fix valgrind.
2013-08-28 16:40:21 -07:00
dcashman
758d033583 quash SELinux denial for healthd
Change-Id: I898bb4ee8fdb95b48e58c98bffdb381b03c719bb
2013-08-28 15:32:35 -07:00
Geremy Condra
e03626021e Add capabilities to Zygote to fix valgrind.
Bug: 10455872
Change-Id: I98885e8cd1e4f9ab0d3e2af6d79b078a000db539
2013-08-27 18:47:08 -07:00
Geremy Condra
2b8512cc59 Merge "Add sepolicy-check, a utility for auditing selinux policy." 2013-08-23 19:01:23 +00:00
Geremy Condra
01aaeb6a82 Add sepolicy-check, a utility for auditing selinux policy.
This is based on Joshua Brindle's sepolicy-inject.

Change-Id: Ie75bd56a2996481592dcfe7ad302b52f381d5b18
2013-08-23 11:57:42 -07:00
Richard Haines
7d7ab56e7d am 81cdd6c6: am 1b46b2fe: Fix insertkeys.py to resolve keys.conf path entries in a portable way
* commit '81cdd6c6b7979baf30c4ae12421ece70ea9628ea':
  Fix insertkeys.py to resolve keys.conf path entries in a portable way
2013-08-20 14:05:47 -07:00
Richard Haines
81cdd6c6b7 am 1b46b2fe: Fix insertkeys.py to resolve keys.conf path entries in a portable way
* commit '1b46b2fe4723b0dda74c2f66a09df8259508fd4b':
  Fix insertkeys.py to resolve keys.conf path entries in a portable way
2013-08-20 14:01:54 -07:00
Geremy Condra
bcefbf569b am 553bafef: am 29d0d406: Add the ability to write shell files to the untrusted_app domain.
* commit '553bafeff944973e04a8b09d8b373e539aad6fff':
  Add the ability to write shell files to the untrusted_app domain.
2013-08-16 17:17:08 -07:00
Geremy Condra
553bafeff9 am 29d0d406: Add the ability to write shell files to the untrusted_app domain.
* commit '29d0d40668e686adc91cdfbf0d083e71ed82bac6':
  Add the ability to write shell files to the untrusted_app domain.
2013-08-16 17:14:13 -07:00
Geremy Condra
29d0d40668 Add the ability to write shell files to the untrusted_app domain.
Bug: 10290009
Change-Id: Ic794299261672b36a2b630893b65ab176c3eee6b
(cherry picked from commit eaa4e844e4c8549c9b4808a1272876a6995ca5a7)
2013-08-16 23:09:02 +00:00
The Android Open Source Project
1e9081af0a am b74efd33: (-s ours) Reconcile with klp-release - do not merge
* commit 'b74efd33f79702495dc41f7662515f15e3f079dd':
  Move isolated_app.te / untrusted_app.te into permissive
  Grant fsetid Linux capability to vold.
  Add "shell" to seapp_contexts
2013-08-14 15:14:30 -07:00
The Android Open Source Project
b74efd33f7 Reconcile with klp-release - do not merge
Change-Id: If9a2d360a37a8641a70fb475c7f5422d0cf8b900
2013-08-14 15:10:12 -07:00
Richard Haines
1b46b2fe47 Fix insertkeys.py to resolve keys.conf path entries in a portable way
Currently a path to a key in keys.conf must be fully qualified or have
the -d option appended. This fix will allow paths to have environment
variables that will be expanded. This will give portability to the
entries. For example the following entry will now be resolved correctly:
[@NET_APPS]
ALL : $ANDROID_BUILD_TOP/device/demo_vendor/demo_dev/security/net_apps.x509.pem

Change-Id: If4f169d9ed4f37b6ebd062508de058f3baeafead
Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
2013-08-08 15:13:29 +01:00
The Android Automerger
6db3c2d16e merge in klp-release history after reset to master 2013-08-06 08:17:21 -07:00
Lorenzo Colitti
ab7dfabb61 Fix clatd, broken by selinux policing /dev/tun
Bug: 10175701
Change-Id: I185df22bdbaafd56725760ec6c71340b67455046
2013-08-05 19:53:23 +09:00
The Android Automerger
3411f7855a merge in klp-release history after reset to master 2013-07-30 11:09:43 -07:00
Todd Poynor
32c0dbd212 Merge "healthd: add sepolicy" 2013-07-26 20:42:56 +00:00
The Android Automerger
ebdbc2fe51 merge in klp-release history after reset to master 2013-07-17 06:00:24 -07:00
Alex Klyubin
7cda86eb46 Permit apps to bind TCP/UDP sockets to a hostname
Change-Id: Ided2cf793e94bb58529789c3075f8480c0d0cf4e
2013-07-16 13:45:53 -07:00
Nick Kralevich
08711d34e4 Move isolated_app.te / untrusted_app.te into permissive
OTAs aren't properly labeling /system, which is causing SELinux
breakage. Temporarily put isolated_app.te and untrusted_app.te
into permissive.

Bug: 9878561
Change-Id: Icaf674ad6b3d59cbca3ae796c930c98ab67cae9c
2013-07-16 11:48:25 -07:00
Nick Kralevich
24617fc3b8 Move isolated_app.te / untrusted_app.te into permissive
OTAs aren't properly labeling /system, which is causing SELinux
breakage. Temporarily put isolated_app.te and untrusted_app.te
into permissive.

Bug: 9878561
Change-Id: Icaf674ad6b3d59cbca3ae796c930c98ab67cae9c
2013-07-16 11:34:08 -07:00
Nick Kralevich
59faed058d Allow apps to create listening ports
Bug: 9872463
Change-Id: I47eabeace3387afd24c0fd4bee70e77c0a3586d5
2013-07-16 09:03:58 -07:00
The Android Automerger
73e859c6c3 merge in klp-release history after reset to master 2013-07-16 06:01:08 -07:00