Commit Graph

94490 Commits

Author SHA1 Message Date
Yuri Lin
32dfdfc4b7 Merge "Limit lengths of fields in Condition to a max length." into qt-dev am: da63d3e028
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19970324

Change-Id: I06091b361f631908f0342e05c006ac00167b29bf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-22 16:11:34 +00:00
Yuri Lin
5cb217fff3 Limit lengths of fields in Condition to a max length.
This app-generated input needs to not be too long to avoid errors in the process of writing to disk.

Bug: 242846316
Test: cts ConditionTest; atest ConditionTest; manually verified exploit apk is OK

Change-Id: Ic2fa8f06cc7a4c1f262115764fbd1be2a226b4b9
Merged-In: Ic2fa8f06cc7a4c1f262115764fbd1be2a226b4b9
(cherry picked from commit 81352c3775)
2022-09-15 18:06:30 +00:00
Ivan Chiang
8862cac366 [RESTRICT AUTOMERGE] Check permission for VoiceInteraction am: e4e77f4570
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18803236

Change-Id: Ifddc01d108d8a056617725cb88ff47d14651bd94
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07 03:39:13 +00:00
TreeHugger Robot
cef7f19369 Merge "[RESTRICT AUTOMERGE] Check permission for VoiceInteraction" into qt-dev 2022-09-07 03:10:24 +00:00
Yuri Lin
e5fdd7f0de Merge "Trim any long string inputs that come in to AutomaticZenRule" into qt-dev am: 380ec03dee
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19816794

Change-Id: I86c52b898436188c231a44b342c0ccd1672e07dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 23:34:37 +00:00
Yuri Lin
c4b2c877ec Trim any long string inputs that come in to AutomaticZenRule
This change both prevents any rules from being unable to be written to disk and also avoids risk of running out of memory while handling all the zen rules.

Bug: 242703460
Bug: 242703505
Bug: 242703780
Bug: 242704043
Bug: 243794204
Test: cts AutomaticZenRuleTest; atest android.app.AutomaticZenRuleTest; manually confirmed each exploit example either saves the rule successfully with a truncated string (in the case of name & conditionId) or may fail to save the rule at all (if the owner/configactivity is invalid). Additionally ran the memory-exhausting PoC without device crashes.

Change-Id: I110172a43f28528dd274b3b346eb29c3796ff2c6
Merged-In: I110172a43f28528dd274b3b346eb29c3796ff2c6
(cherry picked from commit de172ba0d4)
2022-09-01 18:54:21 +00:00
Julia Reynolds
f1c5754b97 Limit the size of NotificationChannel and NotificationChannelGroup am: c2d264989a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19696126

Change-Id: Ida57571c08e6c1be93b7b70adff8fce3759c109a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-23 18:44:15 +00:00
Julia Reynolds
c2d264989a Limit the size of NotificationChannel and NotificationChannelGroup
Test: android.app.NotificationChannelGroupTest
Test: android.app.NotificationChannelTest
Test: cts NotificationChannelTest
Test: cts NotificationChannelGroupTest
Bug: 241764350
Bug: 241764340
Bug: 241764135
Bug: 242702935
Bug: 242703118
Bug: 242703202
Bug: 242702851
Bug: 242703217
Bug: 242703556
Change-Id: I0925583ab54d6c81c415859618f6b907ab7baada
Merged-In: I0925583ab54d6c81c415859618f6b907ab7baada
(cherry picked from commit 3850857cb0)
2022-08-23 13:22:33 +00:00
Ivan Chiang
e4e77f4570 [RESTRICT AUTOMERGE] Check permission for VoiceInteraction
The service must have the CAPTURE_AUDIO_HOTWORD permission to access
AlwaysOnHotwordDetector. If it doesn't have the permission, return
STATE_HARDWARE_UNAVAILABLE state. If it is not granted the
RECORD_AUDIO permisison, it also can't start to recognize the audio.

Test: manual
Test: atest CtsVoiceInteractionTestCases
Test: atest CtsAssistTestCases
Bug: 229793943
Change-Id: I7d0f8d2f6af4bc4210060f0a44469db2afc7a1bb
Merged-In: I7d0f8d2f6af4bc4210060f0a44469db2afc7a1bb
2022-08-15 15:09:33 +08:00
Ganesh Olekar
0a761a9510 [conflict] DO NOT MERGE Fix auto-grant of AR runtime permission if device is upgrading from pre-Q am: 84b1160cfc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18327410

Change-Id: I439bf33ed4be4f0bf2439f5565b57c9bdc398504
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-15 06:35:33 +00:00
Ganesh Olekar
e893eff6f2 Merge "DO NOT MERGE Fix auto-grant of AR runtime permission if device is upgrading from pre-Q" into qt-dev 2022-08-15 06:08:20 +00:00
Julia Reynolds
1eaa443544 Store DND rule owners am: eda171cffa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19197499

Change-Id: I9014b79735494dd9ea763ec18490bb2b12b6ecf5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 21:26:47 +00:00
Yuri Lin
718c21f25e Merge changes from topic "cherrypick-cherrypick-jr-owner-azffbn1bzv-en33flblkb" into qt-dev
* changes:
  Enforce zen rule limit on a package level.
  Fix NPE when deleting old zen rules
  Store DND rule owners
2022-08-10 20:51:29 +00:00
Aseem Kumar
e0243c7661 DO NOT MERGE am: 3f218c9a5e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17595878

Change-Id: Ide4ce7536d9637969b483d05f729e6d8c800b49c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-05 18:33:55 +00:00
Aseem Kumar
3f218c9a5e DO NOT MERGE
Move accountname and typeName length check from Account.java to AccountManagerService.

Bug: 169762606
Test: atest AccountManagerServiceTest
Change-Id: I80fabf3a64c55837db98ff316e7e5420129c001b
2022-08-04 22:21:52 +00:00
Julia Reynolds
eda171cffa Store DND rule owners
Test: uiservicestest, cts
Bug: 189332346
Bug: 235823407

Change-Id: Ie546c15c25fcbd193b67cb997220f075691e9bab
Merged-In: Ie546c15c25fcbd193b67cb997220f075691e9bab
2022-07-07 15:50:29 +00:00
Manjeet Rulhania
ca9d475ba4 Merge "Remove package name from SafetyNet logs" into qt-dev am: 2c12354e77
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19138582

Change-Id: I7a24c7dfcb26195913cb36f1f8bc118844953891
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-06 22:58:18 +00:00
Manjeet Rulhania
2c12354e77 Merge "Remove package name from SafetyNet logs" into qt-dev 2022-07-06 22:32:27 +00:00
Steven Moreland
2b5f7f71c3 Parcel: recycle recycles am: b5c79e141a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19101007

Change-Id: Ibd1008515a0d4bc9b919ef13a563de502c332c12
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 17:54:27 +00:00
Manjeet Rulhania
50d343c656 Remove package name from SafetyNet logs
Bug: 213323615
Test: AppSecurityTests
Change-Id: Ia2be2b1e32dc0b75c352bc15219f4c4de9abb45a
Merged-In: I993832e148636f1795ffe393c6dc74a08b9442f8
Merged-In: I8f823487ca16861a35135cfc3383fa2ce8258017
Merged-In: I4b61d13256ce0bfb8fc9d21db52ee78ce2097f14
2022-06-30 22:33:55 +00:00
Ganesh Olekar
84b1160cfc DO NOT MERGE Fix auto-grant of AR runtime permission if device is upgrading from pre-Q
Test: Manually install app apks targeting Q and verifying that AR permission is not auto-granted
Test: atest ActivityRecognitionPermissionTest
Bug: 210065877
Change-Id: I90adf45a6611ab8bc953765c72af77a6a4f7aae8
2022-06-30 00:40:15 +00:00
Steven Moreland
b5c79e141a Parcel: recycle recycles
Before, it was like getting a used pan with food stuck on it. We run
a clean ship here. You want a Parcel? You get a fresh Parcel. When
we recycle a Parcel, we do a real clean-up job. Air freshener. All
bits brushed over. These Parcel objects are clean as heck now!

(specifically cleans mClassCookies)

Bug: 208279300
Test: build
Merged-In: I250872f5c6796bb64e2dc68008154c0e90feb218
Change-Id: I250872f5c6796bb64e2dc68008154c0e90feb218
(cherry picked from commit 46770fa49c)
2022-06-28 23:11:34 +00:00
Makoto Onuki
822fbf618b Merge "Only allow the system server to connect to sync adapters" into qt-dev am: 99ccb4e5b0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18701369

Change-Id: Ie919bc05747a1009507a29de429c3e8d043fed9d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 19:20:45 +00:00
Makoto Onuki
99ccb4e5b0 Merge "Only allow the system server to connect to sync adapters" into qt-dev 2022-06-08 18:56:23 +00:00
Adrian Roos
c2d5e2cb81 Merge "Restrict getInputMethodWindowVisibleHeight" into qt-dev am: fa1fc20874
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18489968

Change-Id: Ia6115784eb97b7759750acca4f271772f8a59ba8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-08 07:40:15 +00:00
Makoto Onuki
7d1397a544 Only allow the system server to connect to sync adapters
Bug: 203229608
Test: Manual test with changing the check logic + debug log
Change-Id: If18009f61360564d02dcda9b1e5fa15685e3250f
(cherry picked from commit 58270527d1)
2022-06-01 20:35:21 +00:00
Adrian Roos
094ea03f14 Restrict getInputMethodWindowVisibleHeight
Make sure only the app currently interacting with the IME can
query this, and restrict the API to apps targeting SDKs before T

Fixes: 204906124
Test: atest 'InputMethodManagerTest#getInputMethodWindowVisibleHeight_returnsZeroIfNotFocused'
Change-Id: If1da19a3dd8c29542afc970b4b201d87547c27a9
Merged-In: If1da19a3dd8c29542afc970b4b201d87547c27a9
2022-05-20 18:11:19 +02:00
Manjeet Rulhania
e545a5dbbf Merge "Fix duplicate permission privilege escalation" into qt-dev am: b22a6d7372
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18078651

Change-Id: I0e25a20970648244c2a72581478f5a09ac6c10b4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Merged-In: I1910dca44104e35a57eba4acfa8188cd9b8626ac
Merged-In: I34120fff2ec2a158dfa55779d2afd4bbd49487ff
Merged-In: I9bc839836786a0876e67fd73c05f8944bb532249
2022-05-16 19:49:21 +00:00
Manjeet Rulhania
31bd425bb6 Fix duplicate permission privilege escalation
Duplicate permissions definition with different group allows
privilege permission escalation to a different permission group.

Android studio and gradle plugin does not allow duplicate
permissions with different attributes, these tools only allow
if duplicate permissions are exact copies.

Also platform stores permissions in map at multiple places with
permission name as key. This suggests that we can disallow
duplicate permissions during package install/update.

Bug: 213323615
Test: manual
Change-Id: I6f44e740897305e7a0553c1cf6c3af37faf02a2e
Merged-In: I1910dca44104e35a57eba4acfa8188cd9b8626ac
Merged-In: I34120fff2ec2a158dfa55779d2afd4bbd49487ff
Merged-In: I9bc839836786a0876e67fd73c05f8944bb532249
2022-05-16 02:06:24 +00:00
Eric Biggers
7271432de9 [RESTRICT AUTOMERGE] Ignore errors preparing user storage for existing users am: 493aa93b84
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17416381

Change-Id: Ic637e5b26c0bb2561497dfb7ba1cf5300bd6af99
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-25 18:05:04 +00:00
Eric Biggers
a318c254f7 Merge changes from topic "unencrypted-dirs-q" into qt-dev
* changes:
  [RESTRICT AUTOMERGE] Log to EventLog on prepareUserStorage failure
  [RESTRICT AUTOMERGE] Ignore errors preparing user storage for existing users
  [RESTRICT AUTOMERGE] UserDataPreparer: reboot to recovery for system user only
  [RESTRICT AUTOMERGE] UserDataPreparer: reboot to recovery if preparing user storage fails
  [RESTRICT AUTOMERGE] StorageManagerService: don't ignore failures to prepare user storage
  Check user unlocked before write to /data/system_ce/0/snapshots
2022-04-25 17:11:39 +00:00
Jonathan Scott
9a83111755 [qt] RESTRICT AUTOMERGE Add finalizeWorkProfileProvisioning. am: c5037ec63c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17587088

Change-Id: I61409fd5cbe7409884dfe0e439d116b098cf9737
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-06 20:34:58 +00:00
Jonathan Scott
c5037ec63c [qt] RESTRICT AUTOMERGE Add finalizeWorkProfileProvisioning.
Test: atest android.devicepolicy.cts.DevicePolicyManagerTest
Bug: 210469972
Change-Id: I2de99f9ccd8b27ffdc2562fa451f132e73d54317
2022-04-06 09:23:04 +00:00
Eric Biggers
493aa93b84 [RESTRICT AUTOMERGE] Ignore errors preparing user storage for existing users
Unfortunately we can't rule out the existence of devices where the user
storage wasn't properly prepared, due to StorageManagerService
previously ignoring errors from mVold.prepareUserStorage, combined with
OEMs potentially creating files in per-user directories too early.  And
forcing these broken devices to be factory reset upon taking an OTA is
not currently considered to be acceptable.

One option is to only check for prepareUserStorage errors on devices
that launched with T or later.  However, this is a serious issue and it
would be strongly preferable to do more than that.

Therefore, this CL makes it so that errors are checked for all new
users, rather than all new devices.  A field ignorePrepareStorageErrors
is added to the user record; it is only ever set to true implicitly,
when reading a user record from disk that lacks this field.  This field
is used by StorageManagerService to decide whether to check for errors.

Bug: 164488924
Bug: 224585613
Test: Intentionally made a device affected by this issue by reverting
      the CLs that introduced the error checks, and changing vold to
      inject an error into prepareUserStorage.   Then, flashed a build
      with this CL without wiping userdata.  The device still boots, as
      expected, and the log shows that the error was intentionally
      ignored.  Tested that if a second user is added, the error is
      *not* ignored and the second user's storage is destroyed before it
      can be used.  Finally, wiped the device and verified that it won't
      boot up anymore, as expected since error checking is enabled for
      the system user in that case.
Change-Id: I9bdd1a4bf5b14542adb901f264a91d489115c89b
(cherry picked from commit 60d8318c47)
Merged-In: I9bdd1a4bf5b14542adb901f264a91d489115c89b
2022-03-29 20:52:58 +00:00
Ayush Sharma
efb797700e Fix security hole in GateKeeperResponse am: 658c53c47c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17343925

Change-Id: I809144ca234b9cd144b59a4666f75c5b18cc6b1f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-25 12:41:07 +00:00
Ayush Sharma
658c53c47c Fix security hole in GateKeeperResponse
GateKeeperResponse has inconsistent writeToParcel() and
createFromParcel() methods, making it possible for a malicious app to
create a Bundle that changes contents after reserialization. Such
Bundles can be used to execute Intents with system privileges.

We fixed related issues previously for GateKeeperResponse class, but
one of the case was remaining when payload is byte array of size 0,
Fixing this case now.

Bug: 220303465
Test: With the POC provided in the bug.
Change-Id: Ida28d611edd674e76ed39dd8037f52abcba82586
Merged-In: Ida28d611edd674e76ed39dd8037f52abcba82586

(cherry picked from commit 46653a91c3)

Change-Id: I486348c7a01c6f59c952b20fb4a36429fff22958
2022-03-23 06:39:47 +00:00
David Christie
21b078e99f Update GeofenceHardwareRequestParcelable to match parcel/unparcel format. am: 3e1ffdb294
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17185256

Change-Id: Ibe74e45782650c3d972306d5e43b4f646be78c79
2022-03-22 05:10:37 +00:00
David Christie
3e1ffdb294 Update GeofenceHardwareRequestParcelable to match parcel/unparcel format.
Test: manual
Bug: 216631962

Change-Id: I3d6d1be9d6c312fe0bf98f600ff8fc9c617f8ec3
2022-03-14 19:55:11 +00:00
TreeHugger Robot
972089ad30 Merge "Always restart apps if base.apk gets updated." into qt-dev am: 1adea76f46
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17111536

Change-Id: Ia35c96940c76b46ff5754f493e4f0c64df211483
2022-03-09 06:21:41 +00:00
Alex Buynytskyy
a5dd59db6d Always restart apps if base.apk gets updated.
Bug: 219044664
Fixes: 219044664
Test: atest PackageManagerShellCommandTest
Change-Id: I27a0c5009b2d5f1ea51618b9acfa1e6ccee71296
Merged-In: I27a0c5009b2d5f1ea51618b9acfa1e6ccee71296
2022-03-09 00:48:11 +00:00
Wu Ahan
14bfa0cbd0 Revert "DO NOT MERGE: Decode the input of both setStream and setResource calls first" am: b6509bdc18
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16630308

Change-Id: I27fbeb2579c5c9ff689b5e20593195bd66cb07de
2022-01-19 22:14:40 +00:00
Wu Ahan
b6509bdc18 Revert "DO NOT MERGE: Decode the input of both setStream and setResource calls first"
This reverts commit 4d91b5aa0b.

Reason for revert: will deliver a better fix for that, ag/16580245.

Change-Id: I8691f47251157aae83d326eb808dd1c06b13a420
2022-01-13 14:41:40 +00:00
Wu Ahan
6910c87745 DO NOT MERGE: Decode the input of both setStream and setResource calls first am: 4d91b5aa0b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16379915

Change-Id: Id96d35b0fe3a31764221a584faed10dd8780f849
2021-12-09 01:43:00 +00:00
Wu Ahan
4d91b5aa0b DO NOT MERGE: Decode the input of both setStream and setResource calls first
The size of the input of both setStream and setResource may very big
that system server got oom while handling it, so we try to decode it
first before copying it to the wallpaper path, if the decoding fails, we
treat the input as an invalid input.

Bug: 204087139
Test: Manually set wallpaper, no PDoS observed.
Change-Id: I014cf461954992782b3dfa0dde67c98a572cc770
2021-12-06 03:16:20 +00:00
TreeHugger Robot
204ab511e0 Merge "DO NOT MERGE Bluetooth: Fix formatting in getAlias()" into qt-dev 2021-09-02 01:20:06 +00:00
Hansong Zhang
e15791bbe1 DO NOT MERGE Bluetooth: Fix formatting in getAlias()
Bug: 180747689
Test: manual
Change-Id: Ic309f4aad116fd424d5d0d0e2016d61be8826b78
Merged-In: Ic309f4aad116fd424d5d0d0e2016d61be8826b78
2021-09-01 21:18:43 +00:00
TreeHugger Robot
7c35716464 Merge "Prevent apps from spamming addAccountExplicitly. See comment here for the discussion on solution https://b.corp.google.com/issues/169762606#comment14" into pi-dev am: a0226b4d47 am: b65ac540d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15405290

Change-Id: Ib461e405d5bd65840fb4f1e962cdd5d1061a882f
2021-09-01 00:49:59 +00:00
TreeHugger Robot
b65ac540d2 Merge "Prevent apps from spamming addAccountExplicitly. See comment here for the discussion on solution https://b.corp.google.com/issues/169762606#comment14" into pi-dev am: a0226b4d47
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15405290

Change-Id: I0073721ed49e40043625eae71f37e7e95b987340
2021-09-01 00:34:01 +00:00
TreeHugger Robot
a0226b4d47 Merge "Prevent apps from spamming addAccountExplicitly. See comment here for the discussion on solution https://b.corp.google.com/issues/169762606#comment14" into pi-dev 2021-09-01 00:11:36 +00:00
Aseem Kumar
5beff34b57 Prevent apps from spamming addAccountExplicitly.
See comment here for the discussion on solution
https://b.corp.google.com/issues/169762606#comment14

Change-Id: If212df3a3b7be1de0fb26b8e88b2fcbb8077c253

Bug: 169762606
(cherry picked from commit 11053c17b3)

Change-Id: I6494366a5695daedc3f4f0046da9e130a5363f5f
Merged-In: If212df3a3b7be1de0fb26b8e88b2fcbb8077c253
2021-08-19 09:52:26 +00:00