Commit graph

748 commits

Author SHA1 Message Date
Nick Kralevich
8758cc5f8b domain.te: allow access to /sys/kernel/debug/tracing/trace_marker
Bug: 9781325
Change-Id: Ib6f6875f690420b59fceb0a32590a2b9ed8dda95
2013-07-11 11:30:20 -07:00
The Android Automerger
7b65cd5d4f merge in klp-release history after reset to master 2013-07-11 06:00:31 -07:00
Nick Kralevich
0c9708b2af domain.te: Add backwards compatibility for unlabeled files
For unlabeled files, revert to DAC rules. This is for backwards
compatibility, as files created before SELinux was in place may
not be properly labeled.

Over time, the number of unlabeled files will decrease, and we can
(hopefully) remove this rule in the future.

To prevent inadvertantly introducing the "relabelto" permission, add
a neverallow domain, and add apps which have a legitimate need to
relabel to this domain.

Bug: 9777552
Change-Id: I71b0ff8abd4925432062007c45b5be85f6f70a88
2013-07-10 18:54:45 -07:00
Nick Kralevich
4a13f7809b netd.te: allow ctl.mdnsd
Allow netd to set ctl.* properties. Currently, mdnsd is broken because
it can't set this property.

Bug: 9777774
Change-Id: I2f32504d77b651e66e0a0067e65a5ed44b427f5a
2013-07-10 15:26:54 -07:00
Geremy Condra
aee5a18a82 Give zygote the ability to execute dalvik cache files.
Change-Id: I129536c3d9f6359228165d8a5ec373780b312c86
2013-07-09 22:37:51 -07:00
Alex Klyubin
79d59edc45 Grant fsetid Linux capability to vold.
This fixes the issue where paid apps failed to install via Google
Play with "Package file has a bad manifest" error. The issue appears
to be caused by vold being prevented by SELinux policy from setting
the setgid bit on the ASEC container directory into which the APK is
decrypted. As a result, the APK is not readable to PackageParser.

Bug: 9736808
Change-Id: I07546a9f9caac3de8b720499bd1bf1604edea0fe
2013-07-08 16:21:25 -07:00
Alex Klyubin
b25fe91e25 Grant fsetid Linux capability to vold.
This fixes the issue where paid apps failed to install via Google
Play with "Package file has a bad manifest" error. The issue appears
to be caused by vold being prevented by SELinux policy from setting
the setgid bit on the ASEC container directory into which the APK is
decrypted. As a result, the APK is not readable to PackageParser.

Bug: 9736808
Change-Id: I07546a9f9caac3de8b720499bd1bf1604edea0fe
2013-07-08 15:48:36 -07:00
The Android Automerger
f1d5335efd merge in klp-release history after reset to master 2013-07-08 06:00:41 -07:00
Nick Kralevich
201cfae474 Temporarily disable installd selinux protections
This is breaking the emulator.

Bug: 9685803
Change-Id: Ibd5b312b97d52fdac9289e44a40e9bba07be1c7f
2013-07-03 09:36:35 -07:00
The Android Automerger
dbeb22987a merge in klp-release history after reset to master 2013-07-02 07:07:30 -07:00
Nick Kralevich
51946bc87e installd: enable SELinux restrictions
This change enables SELinux security enforcement on the installd
process.

For the installd.te file only, this change is equivalent to reverting
the following commits:

    * 50e37b93ac
    * 77d4731e9d

No other changes were required.

Testing: As much as possible, I've tested that package installation
works, from both adb and via Android market. There were no denials
in the kernel dmesg log, and everything appears to be working correctly.

It's quite possible I've missed something. If we experience problems,
I'm happy to roll back this change.

Bug: 9662644
Change-Id: Id93d4ee7b517dfa28c9a0b1d45d936b56892ac0a
2013-07-01 17:08:11 -07:00
Nick Kralevich
6aca515cd3 zygote: enable SELinux restrictions
This change enables SELinux security enforcement on zygote
(but not zygote spawned apps).

For the zygote.te file only, this change is equivalent to reverting
the following commits:

* 50e37b93ac
* 77d4731e9d

No other changes were required.

Testing: As much as possible, I've tested that zygote properly
starts up, and that there's no problem spawning zygote or zygote
apps. There were no denials in the kernel dmesg log, and
everything appears to work correctly. It's quite
possible I've missed something. If we experience problems, I
happy to roll back this change.

Bug: 9657732
Change-Id: Id2a7adcbeebda5d1606cb13470fad6c3fcffd558
2013-07-01 12:11:28 -07:00
The Android Automerger
a76e106b2e merge in klp-release history after reset to master 2013-07-01 07:07:51 -07:00
Nick Kralevich
7914a47f05 Enable SELinux on vold
This change enables SELinux security enforcement on vold.

For the vold.te file ONLY, this change is conceptually a revert of
77d4731e9d and
50e37b93ac, with the following
additional changes:

1) Removal of "allow vold proc:file write;" and
"allow vold self:capability { sys_boot };". As of system/vold
change adfba3626e76c1931649634275d241b226cd1b9a, vold no longer
performs it's own reboots, so these capabilities are no longer
needed.

2) Addition of the powerctl property, which vold contacts to
tell init to reboot.

3) Removal of "allow vold kernel:system module_request;". As of
CTS commit f2cfdf5c057140d9442fcfeb4e4a648e8258b659, Android
devices no longer ship with loadable modules, hence we don't
require this rule.

4) Removal of "fsetid" from "self:capability". Any setuid / setgid
bits SHOULD be cleared if vold is able to change the permissions
of files. IMHO, it was a mistake to ever include this capability in
the first place.

Testing: As much as possible, I've tested filesystem related
functionality, including factory reset and device encryption.
I wasn't able to test fstrim functionality, which is a fairly
new feature.  I didn't see any policy denials in dmesg. It's quite
possible I've missed something. If we experience problems, I
happy to roll back this change.

Bug: 9629920
Change-Id: I683afa0dffe9f28952287bfdb7ee4e0423c2e97a
2013-06-28 20:41:16 -07:00
Nick Kralevich
dbd28d91d3 Enable SELinux protections for netd.
This change does several things:

1) Restore domain.te to the version present at
cd516a3266 . This is the version
currently being distributed in AOSP.

2) Add "allow domain properties_device:file r_file_perms;" to
domain.te, to allow all domains to read /dev/__properties__ .
This change was missing from AOSP.

3) Restore netd.te to the version present at
80c9ba5267 . This is the version
currently being distributed in AOSP.

4) Remove anything involving module loading from netd.te. CTS
enforces that Android kernels can't have module loading enabled.

5) Add several new capabilities, plus data file rules, to
netd.te, since netd needs to write to files owned by wifi.

6) Add a new unconfined domain called dnsmasq.te, and allow
transitions from netd to that domain. Over time, we'll tighten up
the dnsmasq.te domain.

7) Add a new unconfined domain called hostapd.te, and allow
transitions from netd to that domain. Over time, we'll tighten up
the hostapd.te domain.

The net effect of these changes is to re-enable SELinux protections
for netd. The policy is FAR from perfect, and allows a lot of wiggle
room, but we can improve it over time.

Testing: as much as possible, I've exercised networking related
functionality, including turning on and off wifi, entering airplane
mode, and enabling tethering and portable wifi hotspots. It's quite
possible I've missed something, and if we experience problems, I
can roll back this change.

Bug: 9618347
Change-Id: I23ff3eebcef629bc7baabcf6962f25f116c4a3c0
2013-06-28 08:24:30 -07:00
Nick Kralevich
86acb17757 Add "shell" to seapp_contexts
In the process of taking a bugreport, "dumpstate -B" will instruct
zygote to fire up com.android.shell, which runs as UID=2000.
This transition was not included in seapp_contexts, so zygote
didn't know how to properly set the context for the shell user.

Add an entry to allow zygote to know what to do with UID=2000
requests.

Bug: 9588981
Change-Id: I2e726be8d58437ef1de3bcbad3b897a97ed18e22
2013-06-27 12:48:48 -07:00
Nick Kralevich
59444368da Add "shell" to seapp_contexts
In the process of taking a bugreport, "dumpstate -B" will instruct
zygote to fire up com.android.shell, which runs as UID=2000.
This transition was not included in seapp_contexts, so zygote
didn't know how to properly set the context for the shell user.

Add an entry to allow zygote to know what to do with UID=2000
requests.

Bug: 9588981
Change-Id: I2e726be8d58437ef1de3bcbad3b897a97ed18e22
2013-06-27 10:48:36 -07:00
Nick Kralevich
d2703d2181 allow system server to control zygote spawned processes
System server needs to be able to tell Zygote to create processes
with differing ids, capabilities, and SELinux security information.
Allow it.

These rules are not in unconfined.te, and as a result, are not
automatically allowed by SELinux in enforcing mode.

Change-Id: I010eaa2b0e0cee5d995e08e6c785cc5e01b2c974
2013-06-24 16:54:49 -07:00
Todd Poynor
b2b87d95e0 healthd: add sepolicy
Change-Id: Ic0351c69d67aa3a6f71f505408c53d642626ebb4
2013-06-18 12:55:01 -07:00
gcondra@google.com
0eed3476dc am 95c960de: am 274d2927: Clean up remaining denials.
* commit '95c960debc0afff3f81448126e649005e8fce60c':
  Clean up remaining denials.
2013-05-23 19:18:21 -07:00
gcondra@google.com
95c960debc am 274d2927: Clean up remaining denials.
* commit '274d2927a7ccbfd266c83d6da5e9e2772805fbd5':
  Clean up remaining denials.
2013-05-23 19:16:15 -07:00
repo sync
274d2927a7 Clean up remaining denials.
Bug: 8424461
Change-Id: I8f0b01cdb19b4a479d5de842f4e4844aeab00622
2013-05-22 14:20:20 -07:00
Geremy Condra
cdfcea9d8e resolved conflicts for merge of 0f60427d to master
Change-Id: Ide4d5d28e9a1673775b944780677d8c2eb4d7cd6
2013-05-20 16:19:42 -07:00
gcondra@google.com
028cf8933d am eb2dc6d0: am 42cabf34: Revert "Add the selinux policy version number."
* commit 'eb2dc6d0827a6bef993e9c960da3dbeaa57283e9':
  Revert "Add the selinux policy version number."
2013-05-20 15:54:10 -07:00
gcondra@google.com
0f60427d2e am 77d4731e: Make all domains unconfined.
* commit '77d4731e9d30c8971e076e2469d6957619019921':
  Make all domains unconfined.
2013-05-20 15:52:25 -07:00
gcondra@google.com
eb2dc6d082 am 42cabf34: Revert "Add the selinux policy version number."
* commit '42cabf341c8a600a218023ec69b3518e3d3d482c':
  Revert "Add the selinux policy version number."
2013-05-20 15:52:25 -07:00
repo sync
77d4731e9d Make all domains unconfined.
This prevents denials from being generated by the base policy.
Over time, these rules will be incrementally tightened to improve
security.

Change-Id: I4be1c987a5d69ac784a56d42fc2c9063c402de11
2013-05-20 11:08:05 -07:00
repo sync
42cabf341c Revert "Add the selinux policy version number."
This reverts commit b77b3aff2e.
2013-05-17 12:45:05 -07:00
gcondra@google.com
828482d737 am 92b8f148: am 50e37b93: Move domains into per-domain permissive mode.
* commit '92b8f14843008c2c139a28dcdf8bb5ec71c6d33f':
  Move domains into per-domain permissive mode.
2013-05-15 13:37:29 -07:00
gcondra@google.com
92b8f14843 am 50e37b93: Move domains into per-domain permissive mode.
* commit '50e37b93ac97631dcac6961285b92af5026557af':
  Move domains into per-domain permissive mode.
2013-05-15 13:34:56 -07:00
gcondra@google.com
c59ae202e9 am a77daf87: am b77b3aff: Add the selinux policy version number.
* commit 'a77daf8779516f8828d260466260bc12c3cd72e4':
  Add the selinux policy version number.
2013-05-14 23:50:17 -07:00
gcondra@google.com
a77daf8779 am b77b3aff: Add the selinux policy version number.
* commit 'b77b3aff2e19fb4d5a329f962fcf467fc7bbeb1a':
  Add the selinux policy version number.
2013-05-14 23:49:14 -07:00
repo sync
50e37b93ac Move domains into per-domain permissive mode.
Bug: 4070557
Change-Id: I027f76cff6df90e9909711cb81fbd17db95233c1
2013-05-14 21:36:32 -07:00
repo sync
b77b3aff2e Add the selinux policy version number.
Bug: 8841348
Change-Id: I1acf355b8e700500eeb0ddcbb8203a4769bde3bc
2013-05-14 13:13:17 -07:00
Geremy Condra
fb680e7760 am 28dde094: am 92f35dcc: Merge "Revert "Add a policy version."" into jb-mr2-dev
* commit '28dde0947ec820b9292f3eecf0da13fef07611bc':
  Revert "Add a policy version."
2013-05-10 15:16:58 -07:00
Alex Klyubin
f1ef25875c am d0a5e06d: am c25023e1: Merge "SELinux policy: let vold write to device:dir." into jb-mr2-dev
* commit 'd0a5e06d91077c1f507f069ab15ee03f12438880':
  SELinux policy: let vold write to device:dir.
2013-05-10 15:16:54 -07:00
Geremy Condra
28dde0947e am 92f35dcc: Merge "Revert "Add a policy version."" into jb-mr2-dev
* commit '92f35dccb5bddb778d3688b47a1a01c9ced01751':
  Revert "Add a policy version."
2013-05-10 13:14:13 -07:00
Geremy Condra
92f35dccb5 Merge "Revert "Add a policy version."" into jb-mr2-dev 2013-05-10 20:09:31 +00:00
Alex Klyubin
d0a5e06d91 am c25023e1: Merge "SELinux policy: let vold write to device:dir." into jb-mr2-dev
* commit 'c25023e1fa8ef90634218ba5e146ed9bf80a8456':
  SELinux policy: let vold write to device:dir.
2013-05-10 13:07:20 -07:00
Geremy Condra
869edf0e79 Revert "Add a policy version."
Faugh. Typo.

This reverts commit adb481dd8e

Change-Id: Id1ccc0a59cc79b8ad7171fcb6b3d8cb3aaf29bee
2013-05-10 20:06:47 +00:00
Alex Klyubin
c25023e1fa Merge "SELinux policy: let vold write to device:dir." into jb-mr2-dev 2013-05-10 20:05:19 +00:00
gcondra@google.com
49564d0752 am 06dab1bf: am bd77ab31: Merge "Add a policy version." into jb-mr2-dev
* commit '06dab1bf8c51cc7ea251f421403058c5a1a80bda':
  Add a policy version.
2013-05-10 12:50:49 -07:00
gcondra@google.com
06dab1bf8c am bd77ab31: Merge "Add a policy version." into jb-mr2-dev
* commit 'bd77ab31ac7e39f1bb517237b0148b9ab62dac8f':
  Add a policy version.
2013-05-10 12:44:23 -07:00
repo sync
bd77ab31ac Merge "Add a policy version." into jb-mr2-dev 2013-05-10 17:45:38 +00:00
repo sync
adb481dd8e Add a policy version.
Bug: 8841348
Change-Id: I83497c9b5346ba3b35e4e288190fc217a26be505
2013-05-10 10:44:24 -07:00
Geremy Condra
b9a3a24d16 am 31083f90: am 1adb7ca3: Merge "SELinux policy: let vold create /data/tmp_mnt" into jb-mr2-dev
* commit '31083f90318a92ec4a92d21b7fa6f4b503375af8':
  SELinux policy: let vold create /data/tmp_mnt
2013-05-10 03:06:29 -07:00
Torne (Richard Coles)
70d4b33b66 Merge "SELinux policy: let adbd drop Linux capabilities."
Manual merge to get automerger going again.

Conflicts:
	adbd.te

Change-Id: Ibf8db0306b421a3426e925cf9c8f253bbcd500b3
2013-05-10 11:00:02 +01:00
Geremy Condra
31083f9031 am 1adb7ca3: Merge "SELinux policy: let vold create /data/tmp_mnt" into jb-mr2-dev
* commit '1adb7ca34f1049e7bac48cf0b24c8320c34b17b6':
  SELinux policy: let vold create /data/tmp_mnt
2013-05-09 23:40:32 -07:00
Alex Klyubin
dc3853f4bb am 3b9fd5ff: SELinux policy: let adbd drop Linux capabilities.
* commit '3b9fd5ffcd3badffc08e3e71ba4cc41d3a73c9e4':
  SELinux policy: let adbd drop Linux capabilities.
2013-05-09 23:40:32 -07:00
Geremy Condra
1adb7ca34f Merge "SELinux policy: let vold create /data/tmp_mnt" into jb-mr2-dev 2013-05-10 00:34:52 +00:00