Commit graph

3636 commits

Author SHA1 Message Date
dcashman
bfa2baa448 Merge "Allow shell domain to use system_server_service." 2014-12-22 23:54:40 +00:00
dcashman
0de2b45f63 Adjust sepolicy-analyze to reflect libsepol changes.
Commit dc0ab516f11d8e2c413315e733e25a41ba468e4f changed the libsepol
structures on which sepolicy-analyze relies so that it could be compiled
as a C++ library.  Reflect this change in sepolicy-analyze.

Change-Id: I7da601767c3a4ebed7274e33304d8b589a9115fe
2014-12-22 15:31:38 -08:00
dcashman
403d8fee7b Allow shell domain to use system_server_service.
Shell domain needs to be able to access system_server_services, e.g.
when running the pm command. Addresses the following denials:

10-07 00:59:26.901   178   178 E SELinux : avc:  denied  { find } for service=user scontext=u:r:shell:s0 tcontext=u:object_r:system_server_service:s0 tclass=service_manager
10-07 00:59:26.903   178   178 E SELinux : avc:  denied  { find } for service=package scontext=u:r:shell:s0 tcontext=u:object_r:system_server_service:s0 tclass=service_manager

Change-Id: I4cc2f31809a2615ba781e2ecfe2ca7d6f5226b73
2014-12-22 15:22:16 -08:00
Nick Kralevich
356f583535 resolved conflicts for merge of 754f5ea7 to stage-aosp-master
Change-Id: I99af2160c92d4f9a343584ca7c23895b2414112c
2014-12-20 07:46:30 -08:00
William Roberts
754f5ea7ee Allow overiding FORCE_PERMISSIVE_TO_UNCONFINED
It's beneficial to be able to overide this in a device makefile
if you need to get the domains into an unconfined state to keep
the logs from filling up on kernel entries without having to add
rules into device specific policy.

Change-Id: I7778be01256ac601f247e4d6e12573d0d23d12a1
2014-12-20 15:15:33 +00:00
Nick Kralevich
db5242a726 toolbox: remove permissive_or_unconfined()
No obvious denials on flounder, the only device where swap
is used.

Change-Id: I5747ad2fd267cb71cbc1f69ffaec6b1e7db9ec1f
2014-12-19 17:22:35 -08:00
Nick Kralevich
0bc6c80f51 allow toolbox block_device:dir search
needed to get to the swap device.

Addresses the following denial:

  avc:  denied  { search } for  pid=149 comm="mkswap" name="block" dev="tmpfs" ino=9947 scontext=u:r:toolbox:s0 tcontext=u:object_r:block_device:s0 tclass=dir permissive=0

Change-Id: I0c897540f1c7950738622a013121a050a1f32b2f
2014-12-19 17:21:52 -08:00
Nick Kralevich
75670fdff2 am d94b78c9: toolbox: android_fork_execvp_ext() requires getattr ioctl
* commit 'd94b78c908eafb9c57b17d8ad31842df5a0139a9':
  toolbox: android_fork_execvp_ext() requires getattr ioctl
2014-12-20 00:57:34 +00:00
Nick Kralevich
9819a6cba3 bluetooth: allow sending bugreports via bluetooth
Bluetooth can receive bugreport data for beaming to another device.
This comes across as an open file descriptor. Allow bluetooth access
to bugreports.

Addresses the following denial:

  avc: denied { read } for path="/data/data/com.android.shell/files/bugreports/bugreport-2014-12-19-15-35-32.txt" dev="dm-0" ino=662738 scontext=u:r:bluetooth:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0

Change-Id: I7be2ce2e0e48323c1e8f932be17b434b89daf085
2014-12-19 16:43:41 -08:00
Nick Kralevich
d94b78c908 toolbox: android_fork_execvp_ext() requires getattr ioctl
Addresses the following denials:

  avc:  denied  { getattr } for  pid=148 comm="mkswap" path="/dev/pts/0" dev="devpts" ino=3 scontext=u:r:toolbox:s0 tcontext=u:object_r:devpts:s0 tclass=chr_file permissive=1
  avc:  denied  { ioctl } for  pid=148 comm="mkswap" path="/dev/pts/0" dev="devpts" ino=3 scontext=u:r:toolbox:s0 tcontext=u:object_r:devpts:s0 tclass=chr_file permissive=1

Change-Id: I88c88493cd5f523b5b26a8028b421b3565aa5751
2014-12-19 16:19:05 -08:00
Elliott Hughes
6694a71a12 am 5432e7ce: Merge "toybox and toolbox should be considered equivalent."
* commit '5432e7ce7df9eb37f337ef403d9ea247784f9a92':
  toybox and toolbox should be considered equivalent.
2014-12-18 00:16:40 +00:00
Elliott Hughes
5432e7ce7d Merge "toybox and toolbox should be considered equivalent." 2014-12-18 00:10:53 +00:00
Elliott Hughes
367ef9684d toybox and toolbox should be considered equivalent.
When toolbox completely disappears, we can worry about whether we want
to rename this context.

Change-Id: I359b6b2b21bb9452352e700f6ac37c137200ac77
2014-12-17 16:03:01 -08:00
dcashman
d8800a10fa am cd82557d: Restrict service_manager find and list access.
* commit 'cd82557d4069c20bda8e18aa7f72fc0521a3ae32':
  Restrict service_manager find and list access.
2014-12-16 22:58:09 +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
a458ab1f9e am b7d0ae3a: Merge "sepolicy: allow system apps to access ASEC"
* commit 'b7d0ae3aca1c3c8f77ff36ccd1ecefbddd43e8e0':
  sepolicy: allow system apps to access ASEC
2014-12-12 16:55:51 +00:00
Nick Kralevich
b7d0ae3aca Merge "sepolicy: allow system apps to access ASEC" 2014-12-12 16:48:28 +00:00
Pawit Pornkitprasan
c06ed8f7b2 sepolicy: allow system apps to access ASEC
Required for Settings to show name/icon of apps on sd card
(permission copied from untrusted_app)

Also removed duplicate permission (from domain) in untrusted_app

Change-Id: Ib2b3bee4dfb54ad5e45b392fd9bfd65add4a00bf
2014-12-12 13:58:39 +07:00
Stephen Smalley
feb715628a am 2c759185: Allow fcntl F_SETLK on sockets.
* commit '2c75918505a975eb77e286b5379075892ddf1f8c':
  Allow fcntl F_SETLK on sockets.
2014-12-11 18:57:53 +00:00
Stephen Smalley
2c75918505 Allow fcntl F_SETLK on sockets.
Addresses denials such as:
type=1400 : avc: denied { lock } for comm="PushCheckSendS" path="socket:[1834573]" dev="sockfs" ino=X scontext=u:r:untrusted_app:s0 tcontext=u:r:untrusted_app:s0 tclass=tcp_socket

Change-Id: Idbf6120cca9df634e2f8a876fd1cd836551e5ad7
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-12-11 11:45:51 -05:00
Brian Carlstrom
027c636949 am fc6214bf: add permissions for adb shell to create symlinks in /data/local/tmp
* commit 'fc6214bf5d571c4d8d364538b8160628dc380c5c':
  add permissions for adb shell to create symlinks in /data/local/tmp
2014-12-11 00:18:33 +00:00
Brian Carlstrom
fc6214bf5d add permissions for adb shell to create symlinks in /data/local/tmp
Bug: 18485243
Change-Id: Ic17baa0767ee1f1a27a3338558b86482ca92765e
2014-12-10 15:45:09 -08:00
dcashman
b4585e3799 am 10ecd05d: Add neverallow rule for set_context_mgr.
* commit '10ecd05df39b25f4b504f795adafae5f45084a59':
  Add neverallow rule for set_context_mgr.
2014-12-10 22:03:32 +00:00
dcashman
10ecd05df3 Add neverallow rule for set_context_mgr.
Resubmission of commit: 76f3fe33d7

Removed conflicting rule from unconfined domain.

Change-Id: I3e6da8922ebf636f1cd8ceefea4291d043a28ab7
2014-12-10 13:50:39 -08:00
dcashman
dc58e1b0d9 am 6322a329: Revert " Add neverallow rule for set_context_mgr."
* commit '6322a3297b685c83c5b5b662efc422b77e04683c':
  Revert " Add neverallow rule for set_context_mgr."
2014-12-09 18:29:15 +00:00
dcashman
6322a3297b Revert " Add neverallow rule for set_context_mgr."
Fix build due to goldfish neverallow conflicts.

This reverts commit 76f3fe33d7.
2014-12-09 18:14:08 +00:00
dcashman
0264fd1189 am 76f3fe33: Add neverallow rule for set_context_mgr.
* commit '76f3fe33d7b1a42b0a3f356be5522e9cc014687e':
  Add neverallow rule for set_context_mgr.
2014-12-09 17:29:26 +00:00
dcashman
76f3fe33d7 Add neverallow rule for set_context_mgr.
Change-Id: Ie7c2bf623dcfe246fa5e60b0775b6bb38869d8cb
2014-12-05 14:34:41 -08:00
Daniel Cashman
598b87c2ef am 0be02b36: Merge "Fix sepolicy-analyze build with different toolchains"
* commit '0be02b360fa94836d9ebdbd59790f7b3fcde950b':
  Fix sepolicy-analyze build with different toolchains
2014-12-02 20:40:34 +00:00
Daniel Cashman
0be02b360f Merge "Fix sepolicy-analyze build with different toolchains" 2014-12-02 20:33:23 +00:00
Stephen Smalley
0e8f0230fd am 7d715164: Do not allow isolated_app to directly open app data files.
* commit '7d7151647f41f562dd324a5def86ee10c234f870':
  Do not allow isolated_app to directly open app data files.
2014-12-02 18:07:47 +00:00
Stephen Smalley
7d7151647f Do not allow isolated_app to directly open app data files.
Only allow it to read/write/stat already open app data files
received via Binder or local socket IPC.

Change-Id: Ie66f240e109410a17aa93d9d5dea4c2b87d47009
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-12-02 18:01:43 +00:00
dcashman
037388b9de am 69636551: Remove entropy from service_contexts.
* commit '6963655194c4dbb18c813d403e05b9b72501a348':
  Remove entropy from service_contexts.
2014-12-01 23:58:49 +00:00
William Roberts
47c1461156 Fix sepolicy-analyze build with different toolchains
host C: sepolicy-analyze <= external/sepolicy/tools/sepolicy-analyze/sepolicy-analyze.c
external/sepolicy/tools/sepolicy-analyze/sepolicy-analyze.c: In function 'usage':
external/sepolicy/tools/sepolicy-analyze/sepolicy-analyze.c:30:5: error: 'for' loop initial declarations are only allowed in C99 mode
external/sepolicy/tools/sepolicy-analyze/sepolicy-analyze.c:30:5: note: use option -std=c99 or -std=gnu99 to compile your code
make: *** [out/host/linux-x86/obj/EXECUTABLES/sepolicy-analyze_intermediates/sepolicy-analyze.o] Error 1

Change-Id: I9222e447b032d051c251c9718e2b8d5ffb9e9c35
2014-12-01 11:45:54 -08:00
dcashman
6963655194 Remove entropy from service_contexts.
Commit: 9287e0dd272b85b475e33bcbd7d868517a0f98f9 removed the registration
of EntropyMixer with servicemanager, so it no longer needs a context.

Bug: 18106000

Cherry-pick of commit: 7cfef98ce7

Change-Id: I9aeb35e7ffde75090f4234ea193514fb883b1425
2014-11-26 13:52:04 -08:00
Nick Kralevich
c230c2926d am c48971f6: allow system_server to set ro.build.fingerprint
* commit 'c48971f69fa07c98e62b9a8b0a2ba171846fbea1':
  allow system_server to set ro.build.fingerprint
2014-11-19 15:25:46 +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
William Roberts
a6b7b76d12 am f330f375: Remove network shell script
* commit 'f330f3752922f124305c67683d061c19c9518bed':
  Remove network shell script
2014-11-17 20:27:40 +00:00
William Roberts
f330f37529 Remove network shell script
This seems to not really being used, especially considering
that the init.rc does not have a oneshot service for it, and its
not using the build_policy() and other things to even make it
configurable.

Change-Id: I964f94b30103917ed39cf5d003564de456b169a5
2014-11-13 07:34:39 -08:00
Jeff Hao
aed33118c9 am 9ab0194a: App: add permissions to read symlinks from dalvik cache.
* commit '9ab0194ae61db1047b0ba8cbc78f2b44a3a99f93':
  App: add permissions to read symlinks from dalvik cache.
2014-11-12 22:20:32 +00:00
Jeff Hao
9ab0194ae6 App: add permissions to read symlinks from dalvik cache.
Bug: 18035729

(cherry picked from commit 6f201ddc79)

Change-Id: I9865932ca87acefe0ab7feb3e6dc875f3d64276d
2014-11-12 13:20:42 -08:00
Nick Kralevich
cb0856a874 am f19cca3e: Merge "allow run-as to access /data/local/tmp"
* commit 'f19cca3ee1eeecd3b9ddbb03fe27974f2291965d':
  allow run-as to access /data/local/tmp
2014-11-10 22:08:53 +00:00
Stephen Smalley
7aa8a86e5d am 1c16abd3: Allow init to chown/chmod character devices.
* commit '1c16abd34034fe92cd413d86cc87ee366f00d7bc':
  Allow init to chown/chmod character devices.
2014-11-10 22:08:52 +00:00
Nick Kralevich
f19cca3ee1 Merge "allow run-as to access /data/local/tmp" 2014-11-10 19:33:06 +00:00
Stephen Smalley
1c16abd340 Allow init to chown/chmod character devices.
init.rc files can potentially chown/chmod any character device, so
allow it for everything except for kmem (prohibited by neverallow).
While we could whitelist each of the device types, doing so would also
require device-specific changes for the device-specific types and
may be difficult to maintain.

Resolves (permissive) denials such as:
avc:  denied  { read } for  pid=1 comm="init" name="ttySAC0" dev="tmpfs" ino=4208 scontext=u:r:init:s0 tcontext=u:object_r:hci_attach_dev:s0 tclass=chr_file permissive=1

avc:  denied  { open } for  pid=1 comm="init" name="ttySAC0" dev="tmpfs" ino=4208 scontext=u:r:init:s0 tcontext=u:object_r:hci_attach_dev:s0 tclass=chr_file permissive=1

avc:  denied  { setattr } for  pid=1 comm="init" name="ttySAC0" dev="tmpfs" ino=4208 scontext=u:r:init:s0 tcontext=u:object_r:hci_attach_dev:s0 tclass=chr_file permissive=1

avc:  denied  { read } for  pid=1 comm="init" name="smd7" dev="tmpfs" ino=6181 scontext=u:r:init:s0 tcontext=u:object_r:radio_device:s0 tclass=chr_file

avc:  denied  { open } for  pid=1 comm="init" name="smd7" dev="tmpfs" ino=6181 scontext=u:r:init:s0 tcontext=u:object_r:radio_device:s0 tclass=chr_file

avc:  denied  { read } for  pid=1 comm="init" name="wcnss_wlan" dev="tmpfs" ino=7475 scontext=u:r:init:s0 tcontext=u:object_r:wlan_device:s0 tclass=chr_file

avc:  denied  { open } for  pid=1 comm="init" name="wcnss_wlan" dev="tmpfs" ino=7475 scontext=u:r:init:s0 tcontext=u:object_r:wlan_device:s0 tclass=chr_file

avc:  denied  { setattr } for  pid=1 comm="init" name="wcnss_wlan" dev="tmpfs" ino=7475 scontext=u:r:init:s0 tcontext=u:object_r:wlan_device:s0 tclass=chr_file

Change-Id: If8d14e9e434fab645d43db12cc1bdbfd3fc5d354
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-11-10 13:25:12 -05:00
Nick Kralevich
1d86d8b33a am 1795b665: Allow recovery to create device nodes and modify rootfs
* commit '1795b665bf89b2755b070bab43adfd521ab88ff4':
  Allow recovery to create device nodes and modify rootfs
2014-11-08 00:35:33 +00:00
Nick Kralevich
dd8571aa24 allow run-as to access /data/local/tmp
Otherwise denials like the following occur:

avc: denied { write } for path="/data/local/tmp/foo" dev="dm-0" ino=325769 scontext=u:r:runas:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file
avc: denied { read } for path="/data/local/tmp/foo" dev="dm-0" ino=325769 scontext=u:r:runas:s0 tcontext=u:object_r:shell_data_file:s0 tclass=file

Steps to reproduce:

$ run-as com.google.android.talk id > /data/local/tmp/id.out
$ run-as com.google.android.talk cat < /data/local/tmp/id.out

Change-Id: I68a7b804336a3d5776dcc31622f1279380282030
2014-11-07 16:21:42 -08:00
Nick Kralevich
1795b665bf Allow recovery to create device nodes and modify rootfs
tilapia's OTA code for updating the radio image needs to
create files on rootfs and create a character device in /dev.
Add an exception for recovery the the various neverallow rules
blocking this behavior.

(cherrypick, with modifications, from 0055ea904a)

Bug: 18281224
Change-Id: I5c57afe0a10b4598fea17f9c5c833bd39551907e
2014-11-07 14:56:33 -08:00
Stephen Smalley
7a0f14f376 am ee58864b: (-s ours) Revert "DO NOT MERGE: Flip FORCE_PERMISSIVE_TO_UNCONFINED to true"
* commit 'ee58864b953a2d3601e8e805be32bd71a16e9bd3':
  Revert "DO NOT MERGE: Flip FORCE_PERMISSIVE_TO_UNCONFINED to true"
2014-11-07 15:05:50 +00:00
Stephen Smalley
ee58864b95 Revert "DO NOT MERGE: Flip FORCE_PERMISSIVE_TO_UNCONFINED to true"
Change-Id I52fd5fbe30a7f52f1143f176915ce55fb6a33f87 was only intended
for lollipop, not for master.

This reverts commit 2aa727e3f0.

Change-Id: If2101939eb50cd6bbcde118b91c003d1f30d811c
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-11-07 09:50:38 -05:00