Commit graph

129 commits

Author SHA1 Message Date
dcashman
6843a7932a am 8f81dcad: Only allow system_server to send commands to zygote.
* commit '8f81dcad5bb322a75bc61c8b42f8287e2afeaddc':
  Only allow system_server to send commands to zygote.
2015-03-09 20:55:41 +00:00
dcashman
8f81dcad5b Only allow system_server to send commands to zygote.
Add neverallow rules to ensure that zygote commands are only taken from
system_server.

Also remove the zygote policy class which was removed as an object manager in
commit: ccb3424639821b5ef85264bc5836451590e8ade7

Bug: 19624279

Change-Id: I1c925d7facf19b3953b5deb85d992415344c4c9f
2015-03-09 11:26:56 -07:00
Nick Kralevich
b41eb698ee am 0560e75e: system_server: allow handling app generated unix_stream_sockets
* commit '0560e75e4f03e4637637de8512a4718fe7870df8':
  system_server: allow handling app generated unix_stream_sockets
2015-03-09 15:46:38 +00:00
Nick Kralevich
0560e75e4f system_server: allow handling app generated unix_stream_sockets
Allow system server to handle already open app unix_stream_sockets.
This is needed to support system_server receiving a socket
created using socketpair(AF_UNIX, SOCK_STREAM) and
socketpair(AF_UNIX, SOCK_SEQPACKET). Needed for future Android
functionality.

Addresses the following denial:

  type=1400 audit(0.0:9): avc: denied { read write } for path="socket:[14911]" dev="sockfs" ino=14911 scontext=u:r:system_server:s0 tcontext=u:r:platform_app:s0:c512,c768 tclass=unix_stream_socket permissive=0

Bug: 19648474
Change-Id: I4644e318aa74ada4d98b7f49a41d13a9b9584f39
2015-03-08 23:55:28 -07:00
Nick Kralevich
efb4bdb9f4 am 92b10ddb: Eliminate CAP_SYS_MODULE from system_server
* commit '92b10ddb47caa4c80a626e6c70330439feb4aa30':
  Eliminate CAP_SYS_MODULE from system_server
2015-03-05 22:46:05 +00:00
Nick Kralevich
92b10ddb47 Eliminate CAP_SYS_MODULE from system_server
Right now, the system_server has the CAP_SYS_MODULE capability.  This allows the
system server to install kernel modules.  Effectively, system_server is one
kernel module load away from full root access.

Most devices don't need this capability. Remove this capability from
the core SELinux policy. For devices which require this capability,
they can add it to their device-specific SELinux policy without making
any framework code changes.

In particular, most Nexus devices ship with monolithic kernels, so this
capability isn't needed on those devices.

Bug: 7118228
Change-Id: I7f96cc61da8b2476f45ba9570762145778d68cb3
2015-03-05 14:14:27 -08:00
dcashman
31a8511a79 am 23f33615: Record observed system_server servicemanager service requests.
* commit '23f336156daf61ba07c024af2fe96994605f46eb':
  Record observed system_server servicemanager service requests.
2015-03-03 19:50:02 +00:00
dcashman
23f336156d Record observed system_server servicemanager service requests.
Also formally allow dumpstate access to all services and grant system_server
access to address the following non-system_server_service entries:

avc:  granted  { find } for service=drm.drmManager scontext=u:r:system_server:s0 tcontext=u:object_r:drmserver_service:s0 tclass=service_manager
avc:  granted  { find } for service=nfc scontext=u:r:system_server:s0 tcontext=u:object_r:nfc_service:s0 tclass=service_manager

Bug: 18106000
Change-Id: Iad16b36acf44bce52c4824f8b53c0e7731c25602
2015-03-03 11:38:07 -08:00
Nick Kralevich
cd31111d5e am d99ea5a8: Merge "Revert /proc/net related changes"
* commit 'd99ea5a8af11216fb3e2e315c6310d2af4f02afc':
  Revert /proc/net related changes
2015-02-26 14:32:39 +00:00
Nick Kralevich
5cf3994d8a Revert /proc/net related changes
Revert the tightening of /proc/net access. These changes
are causing a lot of denials, and I want additional time to
figure out a better solution.

Addresses the following denials (and many more):

  avc: denied { read } for comm="SyncAdapterThre" name="stats" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
  avc: denied { read } for comm="facebook.katana" name="iface_stat_fmt" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
  avc: denied { read } for comm="IntentService[C" name="if_inet6" dev="proc" ino=X scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_net:s0 tclass=file
  avc: denied { read } for comm="dumpstate" name="iface_stat_all" dev="proc" ino=X scontext=u:r:dumpstate:s0 tcontext=u:object_r:proc_net:s0 tclass=file

This reverts commit 0f0324cc82
and commit 99940d1af5

Bug: 9496886
Bug: 19034637
Change-Id: I436a6e3638ac9ed49afbee214e752fe2b0112868
2015-02-25 13:35:17 -08:00
Nick Kralevich
f4c0a09bd3 am 437f7139: am 361cdaff: system_server: neverallow dex2oat exec
* commit '437f713936148eb0cf3eb277eab72b07a1d533ca':
  system_server: neverallow dex2oat exec
2015-01-30 21:16:13 +00:00
Nick Kralevich
361cdaff30 system_server: neverallow dex2oat exec
system_server should never be executing dex2oat. This is either
a bug (for example, bug 16317188), or represents an attempt by
system server to dynamically load a dex file, something we don't
want to allow.

This change adds a compile time assertion which will detect
if an allow rule granting this access is ever added.
No new rules are added or deleted as a result of this change.
This neverallow rule is automatically enforced via CTS.

Bug: 16317188
Change-Id: Id783e05d9f48d48642dbb89d9c78be4aae8af70c
2015-01-29 16:57:15 -08:00
dcashman
854ad128c9 am a5119ee7: am 566e8fe2: Record service accesses.
* commit 'a5119ee7900d511278b12d04f436ed25110556cf':
  Record service accesses.
2015-01-20 15:47:20 +00:00
dcashman
566e8fe258 Record service accesses.
Reduce logspam and record further observed service connections.

Bug: 18106000
Change-Id: I9a57e4bb8f1c8e066861719fb208c691498842a8
2015-01-16 17:27:25 -08:00
dcashman
7dc1417b62 am c1142451: am 0d16b5ac: Merge "Remove known system_server service accesses from auditing."
* commit 'c1142451d9d91fba3f4f3910ecbfd0b2263c445d':
  Remove known system_server service accesses from auditing.
2015-01-16 00:03:54 +00:00
dcashman
c631ede7dc Remove known system_server service accesses from auditing.
Address observed  audit logs of the form:
granted  { find } for service=XXX scontext=u:r:YYY:s0:c512,c768 tcontext=u:object_r:XXX_service:s0 tclass=service_manager

in order to record existing relationships with services.

Bug: 18106000
Change-Id: I99a68f329c17ba67ebf3b87729b8405bdc925ef4
2015-01-15 15:12:18 -08:00
Nick Kralevich
5585c30ace am acf209e8: am 99940d1a: remove /proc/net read access from domain.te
* commit 'acf209e8c38e2a2ed7510551961a5812f63a4935':
  remove /proc/net read access from domain.te
2015-01-15 21:34:34 +00:00
dcashman
61e82a2cfc resolved conflicts for merge of e55f2b81 to lmp-mr1-dev-plus-aosp
Change-Id: If8473c40d1b3da93d1f0f74d24f40633b2209f5e
2015-01-14 15:05:04 -08:00
Nick Kralevich
99940d1af5 remove /proc/net read access from domain.te
SELinux domains wanting read access to /proc/net need to
explicitly declare it.

TODO: fixup the ListeningPortsTest cts test so that it's not
broken.

Bug: 9496886
Change-Id: Ia9f1214348ac4051542daa661d35950eb271b2e4
2015-01-14 22:18:24 +00:00
dcashman
4a89cdfa89 Make system_server_service an attribute.
Temporarily give every system_server_service its own
domain in preparation for splitting it and identifying
special services or classes of services.

Change-Id: I81ffbdbf5eea05e0146fd7fd245f01639b1ae0ef
2015-01-14 13:54:26 -08:00
dcashman
49e7e0c248 am d8800a10: am cd82557d: Restrict service_manager find and list access.
* commit 'd8800a10fa987bac8234d87f1d4ff83d90966053':
  Restrict service_manager find and list access.
2014-12-16 23:01:31 +00:00
dcashman
cd82557d40 Restrict service_manager find and list access.
All domains are currently granted list and find service_manager
permissions, but this is not necessary.  Pare the permissions
which did not trigger any of the auditallow reporting.

Bug: 18106000
Change-Id: Ie0ce8de2af8af2cbe4ce388a2dcf4534694c994a
2014-12-15 10:09:24 -08:00
Nick Kralevich
6eabeb20f9 am c230c292: am c48971f6: allow system_server to set ro.build.fingerprint
* commit 'c230c2926d7ce3ca7348a391ad15adb55d5c74f3':
  allow system_server to set ro.build.fingerprint
2014-11-19 15:30:26 +00:00
Nick Kralevich
c48971f69f allow system_server to set ro.build.fingerprint
Some devices leave "ro.build.fingerprint" undefined at build time,
since they need to build it from the components at runtime.
See 5568772e81
for details.

Allow system_server to set ro.build.fingerprint

Addresses the following denial/error:

  avc:  denied  { set } for property=build.fingerprint scontext=u:r:system_server:s0 tcontext=u:object_r:default_prop:s0 tclass=property_service
  init: sys_prop: permission denied uid:1000  name:ro.build.fingerprint

Bug: 18188956
Change-Id: I98b25773904a7be3e3d2926daa82c1d08f9bcc29
2014-11-18 22:44:31 +00:00
Nick Kralevich
0ff85767a3 am 4d9648e3: am b519949d: system_server: assert app data files never opened directly
* commit '4d9648e3e4bb2f3796d28f9cc95c6d3abd6075a9':
  system_server: assert app data files never opened directly
2014-10-29 17:11:35 +00:00
Nick Kralevich
4d9648e3e4 am b519949d: system_server: assert app data files never opened directly
* commit 'b519949df150ebe4fc9bf3db52542bb5d9238d4e':
  system_server: assert app data files never opened directly
2014-10-28 04:31:29 +00:00
Nick Kralevich
8526aced75 am 491c5368: am 2d1650f4: allow system_server to set kernel scheduling priority
* commit '491c5368f7cdae8f7b94ed620706ed61c092e8d1':
  allow system_server to set kernel scheduling priority
2014-10-24 23:39:24 +00:00
Nick Kralevich
2d1650f407 allow system_server to set kernel scheduling priority
Addresses the following denial:

  avc: denied { setsched } for comm="system_server" scontext=u:r:system_server:s0 tcontext=u:r:kernel:s0 tclass=process permissive=0

It's not clear why system_server is adjusting the scheduling priority
of kernel processes (ps -Z | grep kernel). For now, allow the operation,
although this is likely a kernel bug.

Maybe fix bug 18085992.

Bug: 18085992
Change-Id: Ic10a4da63a2c392d90084eb1106bc5b42f95b855
2014-10-24 14:25:49 -07:00
Nick Kralevich
b519949df1 system_server: assert app data files never opened directly
Add a compile time assertion that app data files are never
directly opened by system_server. Instead, system_server always
expects files to be passed via file descriptors.

This neverallow rule will help prevent accidental regressions and
allow us to perform other security tightening, for example
bug 7208882 - Make an application's home directory 700

Bug: 7208882
Change-Id: I49c725982c4af0b8c76601b2a5a82a5c96df025d
2014-10-23 10:33:54 -07:00
Robin Lee
255d409276 resolved conflicts for merge of bdec09b9 to lmp-mr1-dev-plus-aosp
Change-Id: I9f1dd4fd401df73006f79205557daa17313d36f4
2014-10-16 00:42:08 +01:00
Robin Lee
5871d1bc18 resolved conflicts for merge of 51bfecf4 to lmp-dev-plus-aosp
Change-Id: I8ea400354e33a01d3223b4efced6db76ba00aed6
2014-10-15 23:11:59 +01:00
Robin Lee
51bfecf49d Pull keychain-data policy out of system-data
Migrators should be allowed to write to /data/misc/keychain in order
to remove it. Similarly /data/misc/user should be writable by system
apps.

TODO: Revoke zygote's rights to read from /data/misc/keychain on
behalf of some preloaded security classes.

Bug: 17811821
Change-Id: I9e9c6883cff1dca3755732225404909c16a0e547
2014-10-15 18:02:03 +00:00
Nick Kralevich
86facd9388 am 0ed8f86e: am 2380d05f: allow system_server oemfs read access
* commit '0ed8f86eba294cfc76c283852d0da6542c631c31':
  allow system_server oemfs read access
2014-10-11 04:55:02 +00:00
Nick Kralevich
7fe94a1c79 am 2380d05f: allow system_server oemfs read access
* commit '2380d05f9791b6789b81e28ca8841df1b8b62c6d':
  allow system_server oemfs read access
2014-10-10 23:09:21 +00:00
Nick Kralevich
2380d05f97 allow system_server oemfs read access
Bug: 17954291
Change-Id: Ia904fff65df5142732928561d81ea0ece0c52a8d
2014-10-10 22:59:16 +00:00
dcashman
f37ce3f3e2 Add support for factory reset protection.
Address the following denials:
<12>[  417.732129] type=1400 audit(365340.189:47): avc: denied { read } for pid=1737 comm="Binder_2" name="mmcblk0p18" dev="tmpfs" ino=12406 scontext=u:r:system_server:s0 tcontext=u:object_r:block_device:s0 tclass=blk_file permissive=0
<12>[  417.882126] type=1400 audit(365340.339:48): avc: denied { read } for pid=1737 comm="Binder_2" name="mmcblk0p18" dev="tmpfs" ino=12406 scontext=u:r:system_server:s0 tcontext=u:object_r:block_device:s0 tclass=blk_file permissive=0

(cherrypick of commit 47bd7300a5)

Bug: 16710840
Change-Id: I8cb5b4b17dffe14f0bf05d63eb8f6ab8d5c09f53
2014-09-19 18:58:02 -07:00
Robin Lee
72acd6bbbe Allow system reset_uid, sync_uid, password_uid
Permits the system server to change keystore passwords for users other
than primary.

(cherrypicked from commit de08be8aa0)

Bug: 16233206
Change-Id: I7941707ca66ac25bd122fd22e5e0f639e7af697e
2014-09-11 11:21:56 -07:00
dcashman
43b8bc53ab resolved conflicts for merge of 47bd7300 to lmp-dev-plus-aosp
Change-Id: I9631fb1774893d2eeccd7f1f5a867cb5dd98d53d
2014-09-09 13:56:05 -07:00
dcashman
47bd7300a5 Add support for factory reset protection.
Address the following denials:
<12>[  417.732129] type=1400 audit(365340.189:47): avc: denied { read } for pid=1737 comm="Binder_2" name="mmcblk0p18" dev="tmpfs" ino=12406 scontext=u:r:system_server:s0 tcontext=u:object_r:block_device:s0 tclass=blk_file permissive=0
<12>[  417.882126] type=1400 audit(365340.339:48): avc: denied { read } for pid=1737 comm="Binder_2" name="mmcblk0p18" dev="tmpfs" ino=12406 scontext=u:r:system_server:s0 tcontext=u:object_r:block_device:s0 tclass=blk_file permissive=0

Bug: 16710840
Change-Id: I8cb5b4b17dffe14f0bf05d63eb8f6ab8d5c09f53
2014-09-08 14:27:45 -07:00
Robin Lee
f9ea564a9e am de08be8a: Allow system reset_uid, sync_uid, password_uid
* commit 'de08be8aa006c313e5025ba5f032abf786a39f71':
  Allow system reset_uid, sync_uid, password_uid
2014-08-29 23:55:15 +00:00
Robin Lee
de08be8aa0 Allow system reset_uid, sync_uid, password_uid
Permits the system server to change keystore passwords for users other
than primary.

Bug: 16233206
Change-Id: I7941707ca66ac25bd122fd22e5e0f639e7af697e
2014-08-29 23:48:07 +01:00
Brian Carlstrom
bd6d1f385b am 09eae908: Remove system_server create access from /data/dalvik-cache
* commit '09eae90890d4a2545358b8ba104e1f2a46df1408':
  Remove system_server create access from /data/dalvik-cache
2014-08-29 11:39:57 +00:00
Brian Carlstrom
09eae90890 Remove system_server create access from /data/dalvik-cache
Bug: 16875245

(cherry picked from commit 372d0df796)

Change-Id: I38fa14226ab94df2029ca60d3c8898f46c1824c7
2014-08-28 21:36:27 -07:00
Brian Carlstrom
372d0df796 Remove system_server create access from /data/dalvik-cache
Bug: 16875245
Change-Id: I2487a80896a4a923fb1fa606f537df9f6ad4220a
2014-08-28 21:15:38 -07:00
Sreeram Ramachandran
4a518b8bbf am 997461bd: Allow system_server to talk to netlink directly.
* commit '997461bda5aaedeabf48021e3291293e48501ef7':
  Allow system_server to talk to netlink directly.
2014-07-29 00:56:13 +00:00
Sreeram Ramachandran
997461bda5 Allow system_server to talk to netlink directly.
This is needed for http://ag/512212 to work.

Bug: 15409819
Change-Id: If91fc6891d7ce04060362c6cde8c57462394c4e8
2014-07-28 15:13:34 -07:00
Nick Kralevich
d065f0483c Resync lmp-dev-plus-aosp with master
A DO NOT MERGE change merged from lmp-dev to lmp-dev-plus-aosp.
This is expected, but it's causing unnecessary merge conflicts
when handling AOSP contributions.

Resolve those conflicts.

This is essentially a revert of bf69632724
for lmp-dev-plus-aosp only.

Change-Id: Icc66def7113ab45176ae015f659cb442d53bce5c
2014-07-25 15:19:47 -07:00
Narayan Kamath
7d62aceef4 am aa8e657e: Revert "fix system_server dex2oat exec"
* commit 'aa8e657ef09d70d8ea5657b624022925d92f4711':
  Revert "fix system_server dex2oat exec"
2014-07-25 16:45:35 +00:00
Narayan Kamath
aa8e657ef0 Revert "fix system_server dex2oat exec"
This reverts commit 10370f5ff4.

The underlying issue has been fixed and the system_server
will now go via installd to get stuff compiled, if required.

bug: 16317188

Change-Id: I77a07748a39341f7082fb9fc9792c4139c90516d
2014-07-25 15:37:27 +01:00
Stephen Smalley
9d24d52e97 am ba992496: Define debuggerd class, permissions, and rules.
* commit 'ba992496f01e40a10d9749bb25b6498138e607fb':
  Define debuggerd class, permissions, and rules.
2014-07-24 20:26:34 +00:00