Commit Graph

29040 Commits

Author SHA1 Message Date
Siyamed Sinir
1f8536653b Merge "Use calling user ID when calling isDeviceLocked" into mnc-dev am: a0c253d07a
am: c275b77b03

Change-Id: Ia2887869c4ac6cdcd1a66372b991b9f78edf7679
2017-10-31 16:34:29 +00:00
Siyamed Sinir
c275b77b03 Merge "Use calling user ID when calling isDeviceLocked" into mnc-dev
am: a0c253d07a

Change-Id: I9040d5dcde6228ea3f10bc03077800d2b070cbb1
2017-10-31 16:25:26 +00:00
Fyodor Kupolov
ded7332328 Use calling user ID when calling isDeviceLocked
If isDeviceLocked is called with clearCallingIdentity,
original userId should be explicitly passed

Bug: 67621847
Test: Manual
Change-Id: I2bcb92572898811cc96bda1149ef806e6239e929
2017-10-16 20:56:18 +00:00
Jeff Sharkey
d20cad62ee DO NOT MERGE. KEY_INTENT shouldn't grant permissions.
am: 04b96d76a9

Change-Id: Ie2ae7f5071a534e1245c92293014963c8e4187ca
2017-10-11 20:32:40 +00:00
Jeff Sharkey
d87d2746a9 DO NOT MERGE. KEY_INTENT shouldn't grant permissions.
KEY_INTENT has no business granting any Uri permissions, so remove
any grant flags that malicious apps may have tried sneaking in.

Test: builds, boots
Bug: 32990341, 32879915
Change-Id: I657455a770c81f045ccce6abbd2291407a1cfb42
2017-10-03 21:46:42 +00:00
Jeff Sharkey
04b96d76a9 DO NOT MERGE. KEY_INTENT shouldn't grant permissions.
KEY_INTENT has no business granting any Uri permissions, so remove
any grant flags that malicious apps may have tried sneaking in.

Test: builds, boots
Bug: 32990341, 32879915
Change-Id: I657455a770c81f045ccce6abbd2291407a1cfb42
2017-10-03 15:42:56 -06:00
Siyamed Sinir
a4f6ca3e77 Fix ClipboardService device lock check for cross profile am: 6d79675e0c
am: 095eda9307

Change-Id: I4ff17f12c20f95efe68115cc3d6b7d5e9b47228c
2017-09-30 00:22:03 +00:00
Siyamed Sinir
095eda9307 Fix ClipboardService device lock check for cross profile
am: 6d79675e0c

Change-Id: Icea573859a6d441e18665d9da855370582f2992a
2017-09-30 00:12:41 +00:00
Siyamed Sinir
6d79675e0c Fix ClipboardService device lock check for cross profile
ClipboardService.isDeviceLocked should clear callingIdentity before
accessing KeyguardManager.

Test: bit CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.ManagedProfileTest

Bug: 64934810
Change-Id: I81a7adac8c9d56ed801ffc1380fcbc987d5df3e6
Merged-In: I712abfe8d542cd1be9c1816f407c8912321ac480
2017-09-14 00:59:49 +00:00
Siyamed Sinir
6352ced635 Merge "Prevent getting data from Clipboard if device is locked" into mnc-dev am: 06183a57a6
am: 028ad8d498

Change-Id: I537277cbc92a3bb45fc967cc7e26b6bf2233aa34
2017-09-11 23:50:20 +00:00
Siyamed Sinir
028ad8d498 Merge "Prevent getting data from Clipboard if device is locked" into mnc-dev
am: 06183a57a6

Change-Id: Ia69682e87705f3ede14ab87b2c496037e00d3c5a
2017-09-11 23:42:42 +00:00
Siyamed Sinir
06183a57a6 Merge "Prevent getting data from Clipboard if device is locked" into mnc-dev 2017-09-11 23:31:44 +00:00
Tony Mak
220e7c1628 Merge "DPC should not be allowed to grant development permission" into mnc-dev am: 328c129f4c
am: a1cbcf5513

Change-Id: I37cafa9ee6e166e27c074e6317a6a818fe9e87a5
2017-09-11 08:36:08 +00:00
Tony Mak
a1cbcf5513 Merge "DPC should not be allowed to grant development permission" into mnc-dev
am: 328c129f4c

Change-Id: If2d6418cf2a71b2ae3094349101e71903c016224
2017-09-11 08:26:32 +00:00
TreeHugger Robot
328c129f4c Merge "DPC should not be allowed to grant development permission" into mnc-dev 2017-09-11 08:14:19 +00:00
Suprabh Shukla
54f494ffc0 Clearing up invalid entries when SyncStorageEngine starts am: 5470469d73
am: bf1b308361

Change-Id: Ia01d70256824947bed5e88e103bc263749404fbb
2017-09-10 19:47:46 +00:00
Suprabh Shukla
bf1b308361 Clearing up invalid entries when SyncStorageEngine starts
am: 5470469d73

Change-Id: I8ffaaf35be0e2586a5bdbbe5de6e6bd440e26017
2017-09-10 19:32:12 +00:00
Siyamed Sinir
0b8fa2f5e0 Prevent getting data from Clipboard if device is locked
Clipboard should not return data if the device is locked. This CL checks
for device locked state before returning values from get/has functions.

Bug: 64934810
Change-Id: I856a9079fe64db0af44383fae1a9a418de959420
Merged-In: Icefac226615fe22a7735dff4ba4c3b528fb2ac12
2017-09-07 06:48:08 +00:00
Suprabh Shukla
5470469d73 Clearing up invalid entries when SyncStorageEngine starts
Any app with permission WRITE_SYNC_SETTINGS could write sync settings
for authorities or accounts that are not valid. This results in invalid
data being persisted to disk which can effectively lead to a DOS style
attack. Clearing such entries on boot will make sure that a reboot fixes
any such issues.

Test: cts-tradefed run cts-dev -m CtsSyncContentHostTestCases

Bug: 35028827
Change-Id: I9e206a42508e3cba65d7523bf47fff743f47dcb2
Merged-In: I9e206a42508e3cba65d7523bf47fff743f47dcb2
(cherry picked from commit 042a478b73)
2017-09-05 19:43:46 -07:00
Tony Mak
2ce5539045 DPC should not be allowed to grant development permission
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --t  com.android.cts.devicepolicy.MixedDeviceOwnerTest#testPermissionGrant_developmentPermission
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --t  com.android.cts.devicepolicy.MixedProfileOwnerTest#testPermissionGrant_developmentPermission
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --t  com.android.cts.devicepolicy.MixedDeviceOwnerTest#testPermissionGrant
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --t  com.android.cts.devicepolicy.MixedProfileOwnerTest#testPermissionGrant
Test: Run "Permissions lockdown" test in CtsVerifier

Merged-In: If83d8edd0eea99145421e967ae47fdc264a5cf7c
Merged-In: I129bfe850981cf0b3646b7c1cf19c8a3ec69f512


Bug: 62623498
Change-Id: Ief96a23fa49f1ea923574840f8ff590a5ea2456e
2017-08-18 16:23:45 +00:00
Phil Weaver
9625d164e4 Merge "Back-port fixes for b/62196835" into mnc-dev am: 093c7a8e56
am: 0ddd7e4714

Change-Id: If39e3e66871aed33dfa0a9949cfd70a7ec45231f
2017-07-18 23:35:25 +00:00
Phil Weaver
0ddd7e4714 Merge "Back-port fixes for b/62196835" into mnc-dev
am: 093c7a8e56

Change-Id: I7f734c7878cf065d15335602f9b0a6e02a786d53
2017-07-18 23:28:55 +00:00
Phil Weaver
d4a5fd1ce3 Back-port fixes for b/62196835
Bug: 62196835
Test: Created an accessibility service that displays a system
and a toast overlay, confirmed that it disappeared when we
reached the accessibility permission screen that uses this
flag.

Change-Id: Ic51ead670fc480e549512ba1d02f49d9c13bc3f0
2017-07-17 16:36:34 -07:00
Svetoslav Ganov
cc0ec4d292 Merge "[DO NOT MERGE] Don't allow permission change to runtime" into mnc-dev am: c8dac8d6f6
am: 84e1238ed6

Change-Id: I2c912b8363a6ca8a12e1c56ae5f1956a4ba5dc07
2017-03-09 19:32:59 +00:00
Svetoslav Ganov
84e1238ed6 Merge "[DO NOT MERGE] Don't allow permission change to runtime" into mnc-dev
am: c8dac8d6f6

Change-Id: I597b43bb7218779d55c0b11af79daef128d199f2
2017-03-09 19:26:50 +00:00
TreeHugger Robot
c8dac8d6f6 Merge "[DO NOT MERGE] Don't allow permission change to runtime" into mnc-dev 2017-03-09 19:19:43 +00:00
Svetoslav Ganov
8b943f40b6 [DO NOT MERGE] Don't allow permission change to runtime
Prevent apps to change permission protection level to dangerous
from any other type as this would allow a privilege escalation
where an app adds a normal permission in other app's group and
then redefines it as dangerous leading to the group auto-grant.

Test: Added a CTS test which passes.

Bug: 33860747

Change-Id: I4e86ee54e61d2fa45be601fae577986ef9a84673
2017-03-09 19:16:08 +00:00
Jeff Sharkey
75f767afa1 DO NOT MERGE. Grant MMS Uri permissions as the calling UID. am: 3f3da42ef9
am: 32c71b078c

Change-Id: I1af83dbf9869bd93ecc5c07e1ce6155206f73290
2017-02-12 09:51:37 +00:00
Jeff Sharkey
32c71b078c DO NOT MERGE. Grant MMS Uri permissions as the calling UID.
am: 3f3da42ef9

Change-Id: I222c32931827d906db5fc1e3258f2095e6013481
2017-02-12 09:47:33 +00:00
Jeff Sharkey
3f3da42ef9 DO NOT MERGE. Grant MMS Uri permissions as the calling UID.
A recent security fix prevents the system UID from handing out Uri
permission grants directly from itself.  Instead, services need to
issue grants as the original calling UID to ensure that the caller
actually has access to the Uris.

Test: builds, boots, send/recv MMS works in primary/secondary users
Bug: 33231106
Change-Id: Ia9fe19843b52977c8a94ee5349b907beda1882fc
(cherry picked from commit 7ff418d9a9)
2017-02-07 04:43:24 +00:00
Jeff Sharkey
9434773306 DO NOT MERGE. No direct Uri grants from system.
am: b18bd06e94

Change-Id: Ia946b314e7c12c5a04f6c117a9b2e2537fc006e9
2017-02-03 00:12:08 +00:00
Jeff Sharkey
e6be8d765f Merge "DO NOT MERGE. No direct Uri grants from system." into mnc-dev 2017-02-02 23:59:47 +00:00
Jeff Sharkey
7115ad7119 Merge "DO NOT MERGE. No direct Uri grants from system." into mnc-dr-dev 2017-02-02 23:59:46 +00:00
Jack Yu
fab95f8ad6 Fixed the logic for tethering provisioning re-evaluation am: 91a0bc9564 am: 40d0753b10 am: 413922e746
am: 426f454b69

Change-Id: I063d17c3eeb6f5b6ec32c261b22ccea273c572ea
2017-02-02 22:36:03 +00:00
Jack Yu
426f454b69 Fixed the logic for tethering provisioning re-evaluation am: 91a0bc9564 am: 40d0753b10
am: 413922e746

Change-Id: I8664d6e42113b4c22741b06780727b10c2e6804e
2017-02-02 22:31:29 +00:00
Jack Yu
413922e746 Fixed the logic for tethering provisioning re-evaluation am: 91a0bc9564
am: 40d0753b10

Change-Id: I1f8a897862c69a475c6d12a824bd69ed8692cd99
2017-02-02 22:26:09 +00:00
Jack Yu
40d0753b10 Fixed the logic for tethering provisioning re-evaluation
am: 91a0bc9564

Change-Id: I4c499b756c019d83a61e61da3065f31a4d8672f2
2017-02-02 22:21:00 +00:00
Jeff Sharkey
bac46f5b65 DO NOT MERGE. No direct Uri grants from system.
The system should never be extending Uri permission grants from
itself, since it automatically holds all the permissions.  Instead,
the system should always be a mediator between two specific app, and
it should be using startActivityAsCaller() if it needs to extend
permissions.

Blocking at this level fixes an entire class of confused deputy
security issues.

Test: builds, normal intent resolution UI works
Bug: 33019296, 32990341, 32879915, 32879772
Change-Id: Iaa57c393a386d8068e807d0dd0caccc89d8a11db
2017-02-02 07:12:20 +00:00
Jeff Sharkey
b18bd06e94 DO NOT MERGE. No direct Uri grants from system.
The system should never be extending Uri permission grants from
itself, since it automatically holds all the permissions.  Instead,
the system should always be a mediator between two specific app, and
it should be using startActivityAsCaller() if it needs to extend
permissions.

Blocking at this level fixes an entire class of confused deputy
security issues.

Test: builds, normal intent resolution UI works
Bug: 33019296, 32990341, 32879915, 32879772
Change-Id: Iaa57c393a386d8068e807d0dd0caccc89d8a11db
2017-02-02 07:11:55 +00:00
Suprabh Shukla
2e6bdbeaab DO NOT MERGE Do not call RecoverySystem with DPMS lock held am: 4ffe72dcc8
am: ab8d3febd3

Change-Id: If42411391fe2010162c51adf48e720e308a650ec
2017-02-02 02:28:13 +00:00
Suprabh Shukla
ab8d3febd3 DO NOT MERGE Do not call RecoverySystem with DPMS lock held
am: 4ffe72dcc8

Change-Id: Ic7b9ef6484df0b57c8f1ee7a483ef3bda05c7cc7
2017-02-02 02:21:16 +00:00
Suprabh Shukla
4ffe72dcc8 DO NOT MERGE Do not call RecoverySystem with DPMS lock held
Note DPM.wipeData() on a secondary user is now blocking, just like
it's been always blocking on the primary user.

Bug 30681079

Change-Id: Ia832bed0f22396998d6307ab46e262dae9463838
2017-01-31 13:01:36 -08:00
Jack Yu
91a0bc9564 Fixed the logic for tethering provisioning re-evaluation
Previously we only re-evaluate provisioning for SIM swap case
The new logic covers both SIM swap case
(ABSENT->NOT_READY->UNKNOWN->READY->LOADED) and modem reset
case (NOT_READY->READY->LOADED)

Test: Manual
bug: 33815946

Change-Id: I9960123605b10d3fa5f3584c6c8b70b616acd6f8
2017-01-16 10:53:28 -08:00
Charles He
0cc0219089 Add @GuardedBy annotation to PersistentDataBlockService#mIsWritable. am: 71d2a41dd9 am: d0339c6e8f am: 6aa436bef2
am: 76ca2da7e8

Change-Id: I9e20b2954ccb462cee31cb5ea44986c00afadbff
2016-12-29 10:20:47 +00:00
Charles He
e5156ec1e9 Prevent writing to FRP partition during factory reset. am: a9437bd1ca am: 2ce5c4320d am: 133ff4d611
am: 00a581f882

Change-Id: I016955744e48d7a91380c2ff39f7c64536a39c7e
2016-12-29 10:18:49 +00:00
Charles He
76ca2da7e8 Add @GuardedBy annotation to PersistentDataBlockService#mIsWritable. am: 71d2a41dd9 am: d0339c6e8f
am: 6aa436bef2

Change-Id: I994b2fe070091a32beffff9dbf11b907b7878fe8
2016-12-29 10:13:27 +00:00
Charles He
00a581f882 Prevent writing to FRP partition during factory reset. am: a9437bd1ca am: 2ce5c4320d
am: 133ff4d611

Change-Id: I54b163f645f561243aac3df1a55c1023531997b3
2016-12-29 10:11:20 +00:00
Charles He
6aa436bef2 Add @GuardedBy annotation to PersistentDataBlockService#mIsWritable. am: 71d2a41dd9
am: d0339c6e8f

Change-Id: I0dbec3edf704821eb4605a48b770461eb99ddae7
2016-12-29 10:06:14 +00:00
Charles He
133ff4d611 Prevent writing to FRP partition during factory reset. am: a9437bd1ca
am: 2ce5c4320d

Change-Id: I29339a634fd22cd46bfc08619464da8fe159a2b7
2016-12-29 10:03:53 +00:00
Charles He
d0339c6e8f Add @GuardedBy annotation to PersistentDataBlockService#mIsWritable.
am: 71d2a41dd9

Change-Id: Iab575b1efdd720c9cf9e32e0b056c99eff98deab
2016-12-29 09:50:20 +00:00