Commit graph

3991 commits

Author SHA1 Message Date
Nick Kralevich
9ad26a7f5c fix user builds.
14d5619a1a added a neverallow
rule for System V IPC calls. Since this was still allowed
for unconfined domains, this broke user builds.

Remove System V IPC stuff from unconfined and fix the build.

Change-Id: Iea66a9f97a90f8db496f6fa34b5e9642ee926fe6
2015-02-12 09:12:50 -08:00
Nick Kralevich
b3e215fbe5 am ce29a859: am 3c985dd6: Merge "domain.te: neverallow System V IPC classes"
* commit 'ce29a859092f5888e57c374a7a748c2e7613f702':
  domain.te: neverallow System V IPC classes
2015-02-12 00:47:54 +00:00
Nick Kralevich
ce29a85909 am 3c985dd6: Merge "domain.te: neverallow System V IPC classes"
* commit '3c985dd6b13141c2e1a1b5cc23cf6281028d55e7':
  domain.te: neverallow System V IPC classes
2015-02-11 23:28:48 +00:00
Nick Kralevich
3c985dd6b1 Merge "domain.te: neverallow System V IPC classes" 2015-02-11 23:23:59 +00:00
dcashman
83e512fb6c am 3be66999: am 895a4f2c: Allow bluetooth mediaserver_service access.
* commit '3be6699930c56120a2f720a1a24fb2c78ab873ad':
  Allow bluetooth mediaserver_service access.
2015-02-11 23:17:15 +00:00
Nick Kralevich
14d5619a1a domain.te: neverallow System V IPC classes
Android doesn't want to support System V IPC classes.
Ensure that it isn't supported by adding a neverallow rule
(compile time assertion).

Change-Id: I278d45960ee557917584f9137323b4cabfe140a9
2015-02-11 15:15:23 -08:00
dcashman
3be6699930 am 895a4f2c: Allow bluetooth mediaserver_service access.
* commit '895a4f2cf7a3530ad0a6cfbc0fc16134f43bb5cf':
  Allow bluetooth mediaserver_service access.
2015-02-11 23:02:03 +00:00
dcashman
895a4f2cf7 Allow bluetooth mediaserver_service access.
This was observed when attempting to change volume for a bluetooth device
supporting AVRCP volume control.

Addresses the following denials:
avc:  denied  { find } for service=media.audio_flinger scontext=u:r:bluetooth:s0 tcontext=u:object_r:mediaserver_service:s0 tclass=service_manager
avc:  denied  { find } for service=media.audio_policy scontext=u:r:bluetooth:s0 tcontext=u:object_r:mediaserver_service:s0 tclass=service_manager

Bug: 19341236
Change-Id: If7f2ff1ea9fc694bad700cf59f400f2d2df8c2dd
2015-02-11 13:25:57 -08:00
Nick Kralevich
b726d8c927 am df770fcb: am b8ef2b02: fix "Unable to add user\'s profile photo id."
* commit 'df770fcb71f475d7ddf256ec0e6a02540e90aebf':
  fix "Unable to add user's profile photo id."
2015-02-11 17:34:43 +00:00
Nick Kralevich
df770fcb71 am b8ef2b02: fix "Unable to add user\'s profile photo id."
* commit 'b8ef2b0297ca112846cb7ed27b78ba7137f20076':
  fix "Unable to add user's profile photo id."
2015-02-11 17:27:44 +00:00
Nick Kralevich
b8ef2b0297 fix "Unable to add user's profile photo id."
Commit a833763ba0 enabled per-user
isolation, which requires that any files / processes which cross
user boundaries be marked with the mlstrustedsubject attribute.

system_app_data_file, used for storing a user's profile photos,
is not marked as such. As a result, users are unable to add profile
photos.

Addresses the following denial:

  avc: denied { write } for path="/data/data/com.android.settings/cache/TakeEditUserPhoto2.jpg" dev="mmcblk0p28" ino=82184 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:system_app_data_file:s0 tclass=file

Steps to reproduce:

  1.Flash & Factory the Deb device with tip-of-tree build
  2.Go to 'Settings-Users'
  3.Under users&profiles,click on Owner to add profile photo.
  4.Select 'Choose photo from Gallery' and select a photo.
  5.Then click the 'Done' button.
  6.Device showed the message as 'Unable to save the photo edits'.

OBSERVED RESULTS:
  Unable to add user's profile photo id. This issue is coming for all
  users(Restricted user,second user)also.

EXPECTED RESULTS:
  Device should allow to add profile photo id.

Bug: 19170844
Change-Id: If657dc09dd391e63ca85320f9cc1728580e51a15
2015-02-11 08:39:41 -08:00
Stephen Smalley
cdb4c596e3 am dc709062: am 509186de: Allow fsck to search /dev/block.
* commit 'dc7090628c372ce3fd4da8c8f363670ecb3e6d53':
  Allow fsck to search /dev/block.
2015-02-11 00:23:04 +00:00
Stephen Smalley
dc7090628c am 509186de: Allow fsck to search /dev/block.
* commit '509186dea59e5ff115b72c282aff1b8c0c47c4f6':
  Allow fsck to search /dev/block.
2015-02-11 00:10:52 +00:00
Stephen Smalley
509186dea5 Allow fsck to search /dev/block.
Addresses denials such as:
avc:  denied  { search } for  pid=143 comm="e2fsck" name="block" dev="tmpfs" ino=5987 scontext=u:r:fsck:s0 tcontext=u:object_r:block_device:s0 tclass=dir

Change-Id: Ieb72fc5e28146530c2f3b235ce74f2f397e49c56
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2015-02-10 16:13:45 -05:00
Stephen Smalley
881dafb43a am f583565e: am f6cc34e0: fsck: remove permissive_or_unconfined()
* commit 'f583565e69565fc4774044f8365c117478f23d13':
  fsck: remove permissive_or_unconfined()
2015-02-10 19:11:59 +00:00
Stephen Smalley
f583565e69 am f6cc34e0: fsck: remove permissive_or_unconfined()
* commit 'f6cc34e098a9c4b1a149417adf42a85445dba330':
  fsck: remove permissive_or_unconfined()
2015-02-10 19:06:33 +00:00
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