Commit graph

99 commits

Author SHA1 Message Date
Jeff Vander Stoep
2b935cd78d grant appdomain rw perms to tun_device
Previously granted to only untrusted_app, allow all apps except
isolated_app read write permissions to tun_device.

avc: denied { read write } for path="/dev/tun" dev="tmpfs" ino=8906 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:tun_device:s0 tclass=chr_file

Bug: 26462997
Change-Id: Id6f5b09cda26dc6c8651eb76f6791fb95640e4c7
2016-01-08 15:02:33 -08:00
Johan Redestig
0d8e9adf49 Neverallow isolated and untrusted apps to write system properties
and as a consequence open up for other appdomains (e.g. platform_app)
to write system properties.

Change-Id: Ie6ad4d17247165564456e5b0d78f705a82cdcde7
2016-01-08 11:41:50 -08:00
Jeff Vander Stoep
956ca4c504 untrusted_app: remove mtp_device perms
No longer necessary after android.process.media moved to the
priv_app domain. Verified no new denials via audit2allow rule.

Bug: 25085347
Change-Id: I2d9498d5d92e79ddabd002b4a5c6f918e1eb9bcc
2016-01-06 17:05:28 +00:00
Felipe Leme
549ccf77e3 Creates a new permission for /cache/recovery
This permission was created mostly for dumpstate (so it can include
recovery files on bugreports when an OTA fails), but it was applied to
uncrypt and recovery as well (since it had a wider access before).

Grant access to cache_recovery_file where we previously granted access
to cache_file. Add auditallow rules to determine if this is really
needed.

BUG: 25351711
Change-Id: I07745181dbb4f0bde75694ea31b3ab79a4682f18
2016-01-04 23:11:28 +00:00
Nick Kralevich
96b1c9ca6f neverallow debugfs access
Don't allow access to the generic debugfs label. Instead, force
relabeling to a more specific type. system_server and dumpstate
are excluded from this until I have time to fix them.

Tighten up the neverallow rules for untrusted_app. It should never
be reading any file on /sys/kernel/debug, regardless of the label.

Change-Id: Ic7feff9ba3aca450f1e0b6f253f0b56c7918d0fa
2015-12-17 16:46:08 -08:00
Jeffrey Vander Stoep
5ca5696e8b Revert "Migrate to upstream policy version 30"
This reverts commit 2ea23a6e1a.

Change-Id: I5e9efa56d74ab22030611cab515e050e0bb77aca
2015-12-08 18:19:04 +00:00
Jeffrey Vander Stoep
862e4ab15f Merge "Migrate to upstream policy version 30"
am: 9a3d490edd

* commit '9a3d490edd843e544084c487422aa54f39080876':
  Migrate to upstream policy version 30
2015-12-08 07:22:25 -08:00
Jeff Vander Stoep
2ea23a6e1a Migrate to upstream policy version 30
Grant untrusted_app and isolated_app unpriv_sock_perms, neverallow
priv_sock_perms to disallow access to MAC address and ESSID.

Change-Id: Idac3b657a153e7d7fdc647ff34b876a325d759b3
2015-12-08 07:18:41 -08:00
Jeffrey Vander Stoep
cd47828c12 Merge "Further restrict access to tun_device"
am: 98c3f9971f

* commit '98c3f9971f4b551fd5578c63f77fa9111bed94ad':
  Further restrict access to tun_device
2015-12-04 01:38:37 +00:00
Jeff Vander Stoep
e555f4b971 Further restrict access to tun_device
Remove bluetooth's access to tun_device. Auditallow rule demonstrates
that it's not used.

Strengthen the neverallow on opening tun_device to include all Apps.

Bug: 24744295
Change-Id: Iba85ba016b1e24c6c12d5b33e46fe8232908aac1
2015-12-03 15:56:04 -08:00
Jeff Vander Stoep
e2280fbcdd Create attribute for moving perms out of domain
am: d22987b4da

* commit 'd22987b4daf02a8dae5bb10119d9ec5ec9f637cf':
  Create attribute for moving perms out of domain
2015-11-03 23:56:50 +00:00
Jeff Vander Stoep
d22987b4da Create attribute for moving perms out of domain
Motivation: Domain is overly permissive. Start removing permissions
from domain and assign them to the domain_deprecated attribute.
Domain_deprecated and domain can initially be assigned to all
domains. The goal is to not assign domain_deprecated to new domains
and to start removing domain_deprecated where it is not required or
reassigning the appropriate permissions to the inheriting domain
when necessary.

Bug: 25433265
Change-Id: I8b11cb137df7bdd382629c98d916a73fe276413c
2015-11-03 23:11:11 +00:00
Jeff Vander Stoep
ad32785689 audit untrusted_app access to mtp_device am: 7b8f9f153e
am: 775dda1fb3

* commit '775dda1fb3641e3ea2be4124a9a77cb236648d6f':
  audit untrusted_app access to mtp_device
2015-10-23 18:12:32 +00:00
Jeff Vander Stoep
4b1c3de99a Temporarily downgrade to policy version number am: 0fc831c3b0
am: 312c2511f7

* commit '312c2511f7dfbebf110f1372db55d811bc1ad29f':
  Temporarily downgrade to policy version number
2015-10-23 18:12:28 +00:00
Jeff Vander Stoep
775dda1fb3 audit untrusted_app access to mtp_device
am: 7b8f9f153e

* commit '7b8f9f153edf7c8bbefe3d472c86419d8048e5dd':
  audit untrusted_app access to mtp_device
2015-10-23 18:05:09 +00:00
Jeff Vander Stoep
312c2511f7 Temporarily downgrade to policy version number
am: 0fc831c3b0

* commit '0fc831c3b0b8d9a4e10d0931131a0eed06cd4275':
  Temporarily downgrade to policy version number
2015-10-23 18:05:05 +00:00
Jeff Vander Stoep
7b8f9f153e audit untrusted_app access to mtp_device
android.process.media moved to priv_app. Add audit rule to test if
untrusted_app still requires access or if some/all permissions may
be removed.

Bug: 25085347
Change-Id: I13bae9c09bd1627b2c06ae84b069778984f9bd5d
2015-10-23 18:03:01 +00:00
Jeff Vander Stoep
0fc831c3b0 Temporarily downgrade to policy version number
Temporarily move from policy version 30 to 29 until device kernels
and prebuilts are all upgraded to the accepted upstream version of
the selinux ioctl command whitelisting code.

(cherry picked from commit 89765083f7)

Bug: 22846070

Change-Id: I31d1e80aaee164cf41a2f01c6ca846a000898ef4
2015-10-23 10:16:00 -07:00
Nick Kralevich
2736e7d6f9 am 40367ad8: Merge "untrusted_apps: Allow untrusted apps to find healthd_service." into mnc-dr-dev am: 6ab438dc8b
* commit '40367ad87e084f78e310b33963aa3da4309442e8':
  untrusted_apps: Allow untrusted apps to find healthd_service.
2015-10-19 21:08:41 +00:00
Nick Kralevich
6ab438dc8b Merge "untrusted_apps: Allow untrusted apps to find healthd_service." into mnc-dr-dev 2015-10-19 20:42:33 +00:00
Ruchi Kandoi
ac8b5750b0 untrusted_apps: Allow untrusted apps to find healthd_service.
This allows apps to find the healthd service which is used to query
battery properties.

Bug: 24759218
Change-Id: I72ce5a28b2ffd57aa424faeb2d039b6c92f9597d
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2015-10-19 13:33:23 -07:00
Jeff Vander Stoep
5f34265c5a am a910a287: Remove untrusted_app access to tmp apk files
* commit 'a910a287d81bf5e9885af9e5be60ed444964a86a':
  Remove untrusted_app access to tmp apk files
2015-10-19 12:02:56 -07:00
Jeff Vander Stoep
e9aaae4ffb resolved conflicts for f1203bf0 to stage-aosp-master
Change-Id: I7f17a87595a05967879ccc33326eb80d7bd00251
2015-10-19 11:39:59 -07:00
Jeff Vander Stoep
a910a287d8 Remove untrusted_app access to tmp apk files
Verifier has moved to the priv_app domain. Neverallow app domain
access to tmp apk files with exceptions for platform and priv app
domains.

Change-Id: I68a2fa39ebc7dc0bfa278fe7d092655f21a5225d
2015-10-19 18:19:31 +00:00
Jeff Vander Stoep
68748c2166 Remove untrusted_app access to cache
neverallow access to untrusted_app and isolated app

Access to cache is a system|signature permission. Only
priv/system/platform apps should be allowed access.

Change-Id: I7ebd38ce6d39950e74c0a164479bc59e694c852d
2015-10-16 14:51:55 -07:00
Jeffrey Vander Stoep
b3af06305c am d62fac7d: Merge "Remove permissions for untrusted_app"
* commit 'd62fac7d0989f242204bc24622f392dbe110fd7e':
  Remove permissions for untrusted_app
2015-10-14 21:38:33 +00:00
Jeff Vander Stoep
0d186fcf89 Remove permissions for untrusted_app
Privileged apps now run in the priv_app domain. Remove permissions
from untrusted_app that were originaly added for GMS core, Finsky, and
Play store.

Bug: 22033466
Change-Id: Ibdce72ad629bfab47de92ac19542e8902e02c8be
2015-10-14 14:29:30 -07:00
Nick Kralevich
f57e2fd77c am de11f501: Remove ptrace from app.te
* commit 'de11f5017c53aabba212425406962d21148fd2f6':
  Remove ptrace from app.te
2015-10-13 23:29:42 +00:00
Nick Kralevich
de11f5017c Remove ptrace from app.te
Remove ptrace from app.te, and only add it to the app domains
which explicitly require it.

Change-Id: I327aabd154ae07ce90e3529dee2b324ca125dd16
2015-10-13 16:21:16 -07:00
Jeff Vander Stoep
694e2bfbaf am de53051a: Do not allow untrusted_app to open tun_device
* commit 'de53051a8282ec59fdd21667850997bc4096f8d2':
  Do not allow untrusted_app to open tun_device
2015-10-07 21:04:24 +00:00
Jeff Vander Stoep
de53051a82 Do not allow untrusted_app to open tun_device
Third party vpn apps must receive open tun fd from the framework
for device traffic.

neverallow untrusted_app open perm and auditallow bluetooth
access to see if the neverallow rule can be expanded to include
all of appdomain.

Bug: 24677682
Change-Id: I68685587228a1044fe1e0f96d4dc08c2adbebe78
2015-10-07 20:40:24 +00:00
dcashman
cdce1f04b6 am 887fd5d1: am 0b764ae9: Allow untrusted_app to list services.
* commit '887fd5d1d148a84991998c0f7654d108072d6084':
  Allow untrusted_app to list services.
2015-09-11 23:36:29 +00:00
dcashman
0b764ae98a Allow untrusted_app to list services.
CTS relies on the ability to see all services on the system to make sure
the dump permission is properly enforced on all services.  Allow this.

Bug: 23476772
Change-Id: I144b825c3a637962aaca59565c9f567953a866e8
2015-09-10 13:41:36 -07:00
Jeffrey Vander Stoep
cd68c3a84e am 6f7de297: Merge "Do not allow apps to access network address file"
* commit '6f7de297b3e67942cdc525b6f626a811ddf5132e':
  Do not allow apps to access network address file
2015-07-29 16:26:31 +00:00
Jeffrey Vander Stoep
278658c2d8 am 6f7de297: Merge "Do not allow apps to access network address file"
* commit '6f7de297b3e67942cdc525b6f626a811ddf5132e':
  Do not allow apps to access network address file
2015-07-29 16:25:54 +00:00
Jeff Vander Stoep
e45cad770c Do not allow apps to access network address file
Bug: 18068520
Bug: 21852542
Change-Id: I876b37ac31dd44201ea1c1400a7c2c16c6a10049
2015-07-29 08:24:06 -07:00
Jeff Vander Stoep
de9b5301a1 restrict app access to socket ioctls
Create a macro of unprivileged ioctls including
- All common socket ioctls except MAC address
- All wireless extensions ioctls except get/set ESSID
- Some commonly used tty ioctls

Bug: 21657002
Change-Id: Ib08be9cb70d08c1fa2c8bddbae519e7c2df5293c
2015-06-05 22:35:51 +00:00
Jeff Sharkey
6e1f405c8b Allow MediaProvider to traverse /mnt/media_rw.
As an optimization, platform components like MediaProvider may choose
to shortcut past the FUSE daemon and return open file descriptors
directly pointing at the underlying storage device.

Now that we have a specific label for /mnt/media_rw, we need to grant
search access to untrusted apps like MediaProvider.  The actual
access control is still managed by POSIX permissions on that
directory.

avc: denied { search } for name="media_rw" dev="tmpfs" ino=4150 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:mnt_media_rw_file:s0 tclass=dir permissive=0

Bug: 21017105
Change-Id: I6d51939668b39b43b91b1f0c24c98bc2205bf511
2015-05-19 14:12:28 -07:00
Jeff Vander Stoep
929c85870a Merge "Allow tty and wireless extensions ioctls" into mnc-dev 2015-05-15 23:15:35 +00:00
Jeff Vander Stoep
a0fbeb97c0 Allow tty and wireless extensions ioctls
Allow tty ioctls TIOCOUTQ 0x5411 and FIOCLEX 0x5451.

Allow/audit all wireless extension ioctls.

Bug: 21120188
Change-Id: Icd447ee40351c615c236f041931d210751e0f0c3
2015-05-15 22:59:34 +00:00
Nick Kralevich
f6d12c6979 dontaudit untrusted_app exec_type:file getattr
Programs routinely scan through /system, looking at the files there.
Don't generate an SELinux denial when it happens.

Bug: 21120228
Change-Id: I85367406e7ffbb3e24ddab6f97448704df990603
2015-05-13 16:06:34 -07:00
Dehao Chen
34a468fad2 Update sepolicy to add label for /data/misc/perfprofd.
Bug: 19483574
(cherry picked from commit 7d66f783c2)

Change-Id: If617e29b6fd36c88c157941bc9e11cf41329da48
2015-05-06 15:26:03 -07:00
Dehao Chen
7d66f783c2 Update sepolicy to add label for /data/misc/perfprofd.
Bug: 19483574
Change-Id: I7e4c0cf748d2b216dcb3aede3803883552b58b64
2015-05-06 14:45:44 -07:00
Jeff Vander Stoep
86f30cb16a Deny untrusted app ioctl access to MAC addr
MAC address access is no longer allowed via the java API. Deny access
from native code.

Bug: 17787238
Change-Id: Ia337317d5927349b243bbbd5c2cf393911771cdf
2015-05-05 16:08:54 -07:00
Alex Klyubin
ab5cf66873 Expand access to gatekeeperd.
This enables access to gatekeeperd for anybody who invokes Android
framework APIs. This is necessary because the AndroidKeyStore
abstraction offered by the framework API occasionally communicates
with gatekeeperd from the calling process.

(cherry picked from commit effcac7d7e)

Bug: 20526234
Change-Id: I450242cd085259b3f82f36f359ee65ff27bebd13
2015-04-29 10:28:53 -07:00
Alex Klyubin
effcac7d7e Expand access to gatekeeperd.
This enables access to gatekeeperd for anybody who invokes Android
framework APIs. This is necessary because the AndroidKeyStore
abstraction offered by the framework API occasionally communicates
with gatekeeperd from the calling process.

Bug: 20526234
Change-Id: I3362ba07d1a7e5f1c47fe7e9ba6aec5ac3fec747
2015-04-29 09:22:11 -07:00
Nick Kralevich
367757d2ef gatekeeperd: use more specific label for /data file
Use a more specific label for /data/misc/gatekeeper

Rearrange some other rules.

Change-Id: Ib634e52526cf31a8f0a0e6d12bbf0f69dff8f6b5
2015-04-17 17:56:31 -07:00
dcashman
bd7f5803f9 Enforce more specific service access.
Move the remaining services from tmp_system_server_service to appropriate
attributes and remove tmp_system_server and associated logging:

registry
restrictions
rttmanager
scheduling_policy
search
sensorservice
serial
servicediscovery
statusbar
task
textservices
telecom_service
trust_service
uimode
updatelock
usagestats
usb
user
vibrator
voiceinteraction
wallpaper
webviewupdate
wifip2p
wifi
window

Bug: 18106000
Change-Id: Ia0a6d47099d82c53ba403af394537db6fbc71ca0
2015-04-09 09:45:54 -07:00
dcashman
03a6f64f95 Enforce more specific service access.
Move the following services from tmp_system_server_service to appropriate
attributes:

network_management
network_score
notification
package
permission
persistent
power
print
processinfo
procstats

Bug: 18106000
Change-Id: I9dfb41fa41cde72ef0059668410a2e9eb1af491c
2015-04-08 20:26:50 +00:00
dcashman
91b7c67d16 Enforce more specific service access.
Move the following services from tmp_system_server_service to appropriate
attributes:

jobscheduler
launcherapps
location
lock_settings
media_projection
media_router
media_session
mount
netpolicy
netstats

Bug: 18106000
Change-Id: Ia82d475ec41f658851f945173c968f4abf57e7e1
2015-04-07 15:48:58 -07:00