Commit Graph

94503 Commits

Author SHA1 Message Date
Khoa Hong
271b7fa23c [RESTRICT AUTOMERGE] Add protections agains use-after-free issues if cancel() or queue() is called after a device connection has been closed. am: 7a8d56b2fe
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20234866

Change-Id: Ib21057b8df8c9d5ad4719de60e9db7fb88765046
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-31 04:08:37 +00:00
Khoa Hong
7a8d56b2fe [RESTRICT AUTOMERGE] Add protections agains use-after-free issues if cancel() or queue() is called after a device connection has been closed.
This is a backport of ag/7528082 and ag/20033068.

Bug: 132319116
Bug: 130571162
Bug: 204584366
Test: CTS Verifier: USB Accessory Test & USB Device Test
Change-Id: I952ab566e26a808997e362dc85ebd1d8eb4574b9
2022-10-19 08:41:24 +00:00
Yuri Lin
7c930d9283 [DO NOT MERGE] Fix conditionId string trimming in AutomaticZenRule am: 303f6bde89
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20208339

Change-Id: I8183044f038567ba8061959e0ea372f3b047944f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-18 21:28:44 +00:00
Yuri Lin
303f6bde89 [DO NOT MERGE] Fix conditionId string trimming in AutomaticZenRule
This change only applies to S branches and earlier.

Bug: 253085433
Bug: 242703460
Bug: 242703505
Bug: 242703780
Bug: 242704043
Bug: 243794204
Test: AutomaticZenRuleTest
Change-Id: Iae423d93b777df8946ecf1c3baf640fcf74990ec
Merged-In: Iae423d93b777df8946ecf1c3baf640fcf74990ec
2022-10-18 15:30:15 +00:00
TreeHugger Robot
676cefb0ee Merge "Stop managed profile owner granting READ_SMS" into qt-dev am: 62044e5099
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15982545

Change-Id: I3bf51cd6e7046c7e128f1008ed830c5e02603f88
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-08 12:05:20 +00:00
TreeHugger Robot
62044e5099 Merge "Stop managed profile owner granting READ_SMS" into qt-dev 2022-10-08 11:41:10 +00:00
Pinyao Ting
f90c770087 Merge "Fix a security issue in app widget service." into qt-dev am: 5a292b8bf4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20026360

Change-Id: I153e3da4a1208d7f4bcd3818902993108f80a6a7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-23 20:20:04 +00:00
Pinyao Ting
5a292b8bf4 Merge "Fix a security issue in app widget service." into qt-dev 2022-09-23 19:57:23 +00:00
Julia Reynolds
23ffc379fe Merge "Fix NPE" into qt-dev am: 261b601d25
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19886859

Change-Id: I1d34705e2995a26c7f396fef7027031d62010990
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-22 19:31:57 +00:00
Julia Reynolds
261b601d25 Merge "Fix NPE" into qt-dev 2022-09-22 18:37:39 +00:00
Pinyao Ting
0ee21ef3e6 Fix a security issue in app widget service.
Bug: 234013191
Test: atest RemoteViewsAdapterTest
Change-Id: Icd2eccb7a90124aca18a3dd463c3f79e3a595c20
Merged-In: Icd2eccb7a90124aca18a3dd463c3f79e3a595c20
(cherry picked from commit 263d7d0ba8)
2022-09-22 18:01:28 +00:00
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
Julia Reynolds
a375542897 Fix NPE
Test: NotificationChannelGroupTest
Test: view notification settings for an app that doesn't use groups
Fixes: 244574602
Bug: 241764350
Bug: 241764340
Bug: 241764135
Bug: 242702935
Bug: 242703118
Bug: 242703202
Bug: 242702851
Bug: 242703217
Bug: 242703556
Change-Id: I9c681106f6d645e62b0e44903d40aa523fee0e95
(cherry picked from commit 6f02c07176)
2022-09-08 14:05:01 +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