commit | 0f3c01c326b6966590c652adec5baa61351756e4 | [log] [tgz] |
---|---|---|
author | yutingfang <yutingfang@google.com> | Thu Jan 23 11:18:35 2025 -0800 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Mar 12 16:48:23 2025 -0700 |
tree | 080f973cafeb3510272713811c8ada2c6adbe2eb | |
parent | b66817d2ed3b6ef29873bfe9857081cdef63681f [diff] |
Impose a threshold on the number of attributed op entries returned in a binder call In the binder call IAppOpsService#getPackagesForOpsForDevice, we return attributed op entries encapsulated in PackageOps. When there are too many attribution tags used for a lot of ops, the size of PackageOps can be bloated and exceeds the binder transaction limit. However, this is usually caused by DoS attack from malicious apps. A normal app wouldn't run into this problem. This CL adds a threshold on the number of attributed op entries that can be returned in a binder call. The threshold is calculated assuming each attribution tag is 50 bytes long. Bug: 372678095 Test: manual. Using provided POC app from the reporter. Verified the exception is gone after the fix. Flag: EXEMPT bugfix (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:eec34e2716bfa613be30b0a0b9a173e2005a6c00) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:767b4f7c3657fa29548a4464da6790dbca8aebda) Merged-In: I43cd4b9774dbe554edcec296c4b8a3d7fc60c85c Change-Id: I43cd4b9774dbe554edcec296c4b8a3d7fc60c85c