Commit graph

4075 commits

Author SHA1 Message Date
Stephen Smalley
bd5f8e3838 kernel: remove permissive_or_unconfined()
Change-Id: If414cf8d973270a91628d64442a6d82e546f18f3
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2015-02-10 12:06:46 -05:00
Stephen Smalley
f6cc34e098 fsck: remove permissive_or_unconfined()
Change-Id: I70529f83ccba57fae20742827737a300a9f0733f
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2015-02-10 12:05:22 -05:00
dcashman
702b2c33d4 am 4d26a187: am 0e30164b: Allow bluetooth access to keystore service.
* commit '4d26a187ce8001cfaa2ee6ff7342429a7c87e800':
  Allow bluetooth access to keystore service.
2015-02-10 16:53:01 +00:00
dcashman
4d26a187ce am 0e30164b: Allow bluetooth access to keystore service.
* commit '0e30164b17af20f680635c7c6c522e670ecc3df3':
  Allow bluetooth access to keystore service.
2015-02-09 23:01:42 +00:00
dcashman
0e30164b17 Allow bluetooth access to keystore service.
Address the following denial:
SELinux : avc:  denied  { find } for service=android.security.keystore scontext=u:r:bluetooth:s0 tcontext=u:object_r:keystore_service:s0 tclass=service_manager

Encountered when remote service attempts access:
02-04 00:15:19.174 E/AndroidRuntime(10847): FATAL EXCEPTION: main
02-04 00:15:19.174 E/AndroidRuntime(10847): Process: com.google.android.remote.tv.services, PID: 10847
02-04 00:15:19.174 E/AndroidRuntime(10847): java.lang.RuntimeException: Unable to create service com.google.android.tv.remote.RemoteService: java.lang.NullPointerException: Attempt to invoke interface method 'int android.security.IKeystoreService.exist(java.lang.String, int)' on a null object reference
02-04 00:15:19.174 E/AndroidRuntime(10847):         at android.app.ActivityThread.handleCreateService(ActivityThread.java:2801)

Bug: 19268019
Change-Id: I86f85cb19c5540bf041c82ec9a8088aacae67792
2015-02-09 14:45:46 -08:00
Nick Kralevich
651e466175 am 9e0aaf00: am fcd86911: allow init fs_type:dir search
* commit '9e0aaf000c74c1de47dc9f3134247859794daa00':
  allow init fs_type:dir search
2015-02-09 02:01:11 +00:00
Nick Kralevich
9e0aaf000c am fcd86911: allow init fs_type:dir search
* commit 'fcd86911d7102b049bd3c2208a133b310827cf66':
  allow init fs_type:dir search
2015-02-09 01:55:53 +00:00
Nick Kralevich
fcd86911d7 allow init fs_type:dir search
We allow chmod/chown of files / directories by init, but don't allow
init to search into subdirectories. Feels wrong.

Addresses the following denial:

  avc:  denied  { search } for  pid=1 comm="init" name="/" dev="pstore" ino=5570 scontext=u:r:init:s0 tcontext=u:object_r:pstorefs:s0 tclass=dir permissive=1

which results from the following init.rc statement:

  # pstore/ramoops previous console log
  mount pstore pstore /sys/fs/pstore
  chown system log /sys/fs/pstore/console-ramoops
  chmod 0440 /sys/fs/pstore/console-ramoops
  chown system log /sys/fs/pstore/pmsg-ramoops-0
  chmod 0440 /sys/fs/pstore/pmsg-ramoops-0

Bug: 19050686
Change-Id: I0528ecb17686891b66262de1f3c229cc68a56830
2015-02-08 15:09:29 +00:00
Elliott Hughes
495b468eca am 12d56dcc: am b00a0379: No one needs LD_PRELOAD from init any more.
* commit '12d56dcc759711c9daa42590983801e88624d8aa':
  No one needs LD_PRELOAD from init any more.
2015-02-07 16:34:19 +00:00
Elliott Hughes
12d56dcc75 am b00a0379: No one needs LD_PRELOAD from init any more.
* commit 'b00a037992e07b52f811079444a0406820443cce':
  No one needs LD_PRELOAD from init any more.
2015-02-07 16:27:55 +00:00
Elliott Hughes
b00a037992 No one needs LD_PRELOAD from init any more.
Change-Id: I40a3d089a4a2325abcd1e12aa57b1fd97a1f7902
2015-02-06 23:40:42 -08:00
dcashman
e429f63098 am 51dfc00a: am 616c787b: Remove service_manager_type auditing of shell source domain.
* commit '51dfc00a696e45b4590ebc403644d9d31ef35f5f':
  Remove service_manager_type auditing of shell source domain.
2015-02-06 23:51:29 +00:00
dcashman
51dfc00a69 am 616c787b: Remove service_manager_type auditing of shell source domain.
* commit '616c787b531acf899a0b15352506d3472a6c3609':
  Remove service_manager_type auditing of shell source domain.
2015-02-06 23:47:16 +00:00
dcashman
616c787b53 Remove service_manager_type auditing of shell source domain.
The shell domain is already allowed to list and find all service_manager
objects, so extra auditing is pointless.

Bug: 18106000
Change-Id: I8dbf674fa7ea7b05e48e5bbc352b0c9593f2b627
2015-02-06 15:27:06 -08:00
dcashman
52c7e3ded6 am 880be462: resolved conflicts for merge of f82f5e01 to lmp-mr1-dev.
* commit '880be4622536d86b3d2edc83b2b7de41fa8398c3':
  Accept command-line input for neverallow-check.
2015-02-06 19:09:39 +00:00
dcashman
880be46225 resolved conflicts for merge of f82f5e01 to lmp-mr1-dev.
Change-Id: I093d7ecf48e9137b974047cd7d0fd2209792b748
2015-02-06 10:43:02 -08:00
Nick Kralevich
9c4fe80806 am 72fef0b1: am 87f3802a: appdomain: relax netlink_socket neverallow rule
* commit '72fef0b10cf51b30426e7f049fb457972977625c':
  appdomain: relax netlink_socket neverallow rule
2015-02-06 16:36:33 +00:00
dcashman
eca25e8eef am 7a5eebd3: resolved conflicts for merge of c423b1aa to lmp-mr1-dev
* commit '7a5eebd3c3a8a5465beed649e3be64928fb09bae':
  Add neverallow checking to sepolicy-analyze.
2015-02-06 16:36:32 +00:00
dcashman
f82f5e01bf Accept command-line input for neverallow-check.
Also, divide each sepolicy-analyze function into its own component for simplified
command-line parsing and potentially eventual modularization.

Bug: 18005561

Cherry-pick of commit: ef4fd30672
with commit: 47c1461156
squashed in.

Bug: 19191637
Change-Id: Id66cad549b7311a6bbd92fd64b6ec2c60d0433a4
2015-02-05 16:43:22 -08:00
Nick Kralevich
72fef0b10c am 87f3802a: appdomain: relax netlink_socket neverallow rule
* commit '87f3802a8edcb1ee9668417b118844132a207df0':
  appdomain: relax netlink_socket neverallow rule
2015-02-06 00:26:50 +00:00
dcashman
7a5eebd3c3 resolved conflicts for merge of c423b1aa to lmp-mr1-dev 2015-02-05 16:13:21 -08:00
Nick Kralevich
87f3802a8e appdomain: relax netlink_socket neverallow rule
Relax the neverallow netlink restrictions for app domains.
In particular, some non-AOSP app domains may use netlink sockets
to communicate with a kernel driver.

Continue to neverallow generic netlink sockets for untrusted_app.
The intention here is that only app domains which explicitly need
this functionality should be able to request it.

This change does not add or remove any SELinux rules. Rather, it
just changes SELinux compile time assertions, as well as allowing
this behavior in CTS.

Modify other neverallow rules to use "domain" instead of "self".
Apps shouldn't be able to handle netlink sockets, even those
created in other SELinux domains.

(cherry picked from commit d31936f89c)

Change-Id: I4763cb0c9510220693c506636dbb7584712b67e2
2015-02-05 23:19:08 +00:00
Nick Kralevich
4cf236decb am f901c4cc: am 74df7f59: don\'t allow mounting on top of /system files/directories
* commit 'f901c4ccd5f521b91b9e5c1224a97489ecb3beb4':
  don't allow mounting on top of /system files/directories
2015-02-05 20:26:57 +00:00
Nick Kralevich
f901c4ccd5 am 74df7f59: don\'t allow mounting on top of /system files/directories
* commit '74df7f593494a00dcc3be410b2d82267b6b31ca0':
  don't allow mounting on top of /system files/directories
2015-02-05 20:17:11 +00:00
Christopher Ferris
a9ff322077 am 8aaf5464: am 5ec38c49: Dumpstate runs the same from shell as service.
* commit '8aaf546402485c6b37218a077b5bb38f8634ebf9':
  Dumpstate runs the same from shell as service.
2015-02-05 18:47:04 +00:00
Nick Kralevich
74df7f5934 don't allow mounting on top of /system files/directories
Change-Id: If311f53b9e5a1020f188ae2346dbf6466e6129ac
2015-02-05 09:31:52 -08:00
Stephen Smalley
c423b1aae8 Add neverallow checking to sepolicy-analyze.
See NEVERALLOW CHECKING in tools/README for documentation.

Depends on change I45b3502ff96b1d093574e1fecff93a582f8d00bd
for libsepol to support reporting all neverallow failures.

Cherry-pick of commit: 59906bf893
with build-fix from commit: 74bbf703df
added manually.

Bug: 19191637

Change-Id: I1c18fa854b3c5f5e05d5dc42d9006c5fdacebdc3
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2015-02-05 07:42:30 +00:00
Christopher Ferris
8aaf546402 am 5ec38c49: Dumpstate runs the same from shell as service.
* commit '5ec38c49e3b61b8a3228b56278e85fc276eaec6b':
  Dumpstate runs the same from shell as service.
2015-02-05 02:30:42 +00:00
Christopher Ferris
5ec38c49e3 Dumpstate runs the same from shell as service.
Without this change, any selinux warning you might get when running
dumpstate from init do not show up when running from the shell
as root. This change makes them run the same.

Change-Id: I6b74e0f6f48f47952a2dbe7728b1853008f60dbb
2015-02-04 14:19:26 -08:00
dcashman
9d08bf2c75 am fc3204f6: am bba18381: Allow radio access to drmserver_service.
* commit 'fc3204f664fdc442d39670fa074264ea90ee0b1a':
  Allow radio access to drmserver_service.
2015-02-02 18:17:57 +00:00
dcashman
fc3204f664 am bba18381: Allow radio access to drmserver_service.
* commit 'bba18381039dbe45f6acce61d6be1ea7abb2fb06':
  Allow radio access to drmserver_service.
2015-02-02 18:11:00 +00:00
dcashman
bba1838103 Allow radio access to drmserver_service.
Address the following denial:
SELinux  E  avc:  denied  { find } for service=drm.drmManager scontext=u:r:radio:s0 tcontext=u:object_r:drmserver_service:s0

which occurs when a non-default SMS app sends an MMS. The message would be
stored into system automatically in MMS service (from phone process and phone
UID). The storing of the message involves the creation of
android.drm.DrmManagerClient instance.

Change-Id: Ic4e493f183c9ce7f7ac3f74f6ea062893ea67608
2015-02-02 09:25:57 -08:00
Nick Kralevich
2fa0b70e51 am 8fb5aad0: am 3c77d4d1: Add compile time checks for /data/dalvik-cache access
* commit '8fb5aad03d2fdf04f50611cbb480ae41b5717810':
  Add compile time checks for /data/dalvik-cache access
2015-01-30 21:22:21 +00:00
Nick Kralevich
8fb5aad03d am 3c77d4d1: Add compile time checks for /data/dalvik-cache access
* commit '3c77d4d1c113282315fbccf696298e04f99a20b4':
  Add compile time checks for /data/dalvik-cache access
2015-01-30 21:16:29 +00: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
437f713936 am 361cdaff: system_server: neverallow dex2oat exec
* commit '361cdaff3096fafc16bbe88b84d6f99f7944def7':
  system_server: neverallow dex2oat exec
2015-01-30 19:43:41 +00:00
Nick Kralevich
3c77d4d1c1 Add compile time checks for /data/dalvik-cache access
Add an SELinux neverallow rule (compile time assertion) that only
authorized SELinux domains are writing to files in /data/dalvik-cache.

Currently, SELinux policy only allows the following SELinux domains
to perform writes to files in /data/dalvik-cache

  * init
  * zygote
  * installd
  * dex2oat

For zygote, installd, and dex2oat, these accesses make sense.

For init, we could further restrict init to just relabelfrom
on /data/dalvik-cache files, and { create, write, setattr }
on /data/dalvik-cache directories. Currently init has full
write access, which can be reduced over time.

This change was motivated by the discussion
in https://android-review.googlesource.com/127582

Remove /data/dalvik-cache access from the unconfined domain.
This domain is only used by init, kernel, and fsck on user builds.
The kernel and fsck domains have no need to access files in
/data/dalvik-cache. Init has a need to relabel files, but
that rule is already granted in init.te.

The neverallow rule is intended to prevent regressions. Neverallow
rules are CTS tested, so regressions won't appear on our devices
or partner devices.

Change-Id: I15e7d17b1121c556463114d1c6c49557a57911cd
2015-01-30 11:27:35 -08: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
Ruben Brunk
8e89c8e9d2 am 6cfd9d13: am db1320f5: Add security policy for ProcessInfoService.
* commit '6cfd9d13197c35bc2a76cba3bda47a1a5e51855a':
  Add security policy for ProcessInfoService.
2015-01-29 23:33:51 +00:00
Ruben Brunk
6cfd9d1319 am db1320f5: Add security policy for ProcessInfoService.
* commit 'db1320f550723616165d67faffd6197b8415dbf8':
  Add security policy for ProcessInfoService.
2015-01-29 23:26:33 +00:00
Nick Kralevich
a7cfd557f7 am bf626ce9: appdomain: relax netlink_socket neverallow rule
* commit 'bf626ce94452813e44433c40fb3d80f8b4b00ff5':
  appdomain: relax netlink_socket neverallow rule
2015-01-29 23:25:16 +00:00
Nick Kralevich
bf626ce944 appdomain: relax netlink_socket neverallow rule
Relax the neverallow netlink restrictions for app domains.
In particular, some non-AOSP app domains may use netlink sockets
to communicate with a kernel driver.

Continue to neverallow generic netlink sockets for untrusted_app.
The intention here is that only app domains which explicitly need
this functionality should be able to request it.

This change does not add or remove any SELinux rules. Rather, it
just changes SELinux compile time assertions, as well as allowing
this behavior in CTS.

Modify other neverallow rules to use "domain" instead of "self".
Apps shouldn't be able to handle netlink sockets, even those
created in other SELinux domains.

(cherry picked from commit d31936f89c)

Bug: 19198997
Change-Id: Icfed1ee66f082df1117b090341f62981f01bc849
2015-01-29 15:02:54 -08:00
Ruben Brunk
db1320f550 Add security policy for ProcessInfoService.
Bug: 19186859

Change-Id: Ic08858f346d6b66e7bfc9da6faa2c6e38d9b2e82
2015-01-29 14:58:24 -08:00
Nick Kralevich
685cbf28d8 am ae5c3c1b: am d31936f8: appdomain: relax netlink_socket neverallow rule
* commit 'ae5c3c1ba66a62f464f4c1a48e4c66435d7b4f51':
  appdomain: relax netlink_socket neverallow rule
2015-01-29 19:31:08 +00:00
Nick Kralevich
ae5c3c1ba6 am d31936f8: appdomain: relax netlink_socket neverallow rule
* commit 'd31936f89c49bc5c54b84bd5095f3c417da14935':
  appdomain: relax netlink_socket neverallow rule
2015-01-29 19:24:45 +00:00
Nick Kralevich
d31936f89c appdomain: relax netlink_socket neverallow rule
Relax the neverallow netlink restrictions for app domains.
In particular, some non-AOSP app domains may use netlink sockets
to communicate with a kernel driver.

Continue to neverallow generic netlink sockets for untrusted_app.
The intention here is that only app domains which explicitly need
this functionality should be able to request it.

This change does not add or remove any SELinux rules. Rather, it
just changes SELinux compile time assertions, as well as allowing
this behavior in CTS.

Modify other neverallow rules to use "domain" instead of "self".
Apps shouldn't be able to handle netlink sockets, even those
created in other SELinux domains.

Change-Id: I40de0ae28134ce71e808e5ef4a39779b71897571
2015-01-28 17:46:30 -08:00
Nick Kralevich
a8b15ce837 am 54477ed7: am bfe4c8ba: radio.te: make radio mlstrustedsubject
* commit '54477ed781c2fb54b4305a262d750cbb3368acc7':
  radio.te: make radio mlstrustedsubject
2015-01-27 16:41:20 +00:00
Nick Kralevich
54477ed781 am bfe4c8ba: radio.te: make radio mlstrustedsubject
* commit 'bfe4c8ba89aebe0154aeaee6ce65215095fe0840':
  radio.te: make radio mlstrustedsubject
2015-01-27 16:35:31 +00:00
Nick Kralevich
bfe4c8ba89 radio.te: make radio mlstrustedsubject
Messenger can't send MMSes on the master branch. When Messenger sends
an MMS, it stores the message data in local file and publishes it
via a content provider. The URI is passed to the MMS API. The
MmsServiceBroker in system process gets the call and grant URI
permission to phone UID. The MmsService in phone process (and sharing
the phone UID) needs to read the URI to get message data to send.

Addresses the following denial:

  type=1400 audit(0.0:32): avc: denied { read } for path="/data/data/com.google.android.apps.messaging/cache/rawmms/5394791820000274558.dat" dev="mmcblk0p28" ino=83180 scontext=u:r:radio:s0 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file

Change-Id: I2b694ff6c516714d3524e0613bae0f6773ed2e95
2015-01-26 15:25:03 -08:00
dcashman
adf283431e am f111d2fa: am 5fef2de3: Allow shell to find all services.
* commit 'f111d2fa4dc18fd7e97ca8925fbd6b1d6997dad7':
  Allow shell to find all services.
2015-01-24 00:27:08 +00:00