Skip to content

Commit f1c159e

Browse files
WinsonAndroid Build Coastguard Worker
authored andcommitted
Use IntentFilter CREATOR directly for serializing ParsedIntentInfo
ParsedIntentInfo's CRFEATOR was removed because it exposes a reparcelling vulnerability. This adjusts a system API that relied on the implicit parcelling read to instead use IntentFilter directly, ignoring the fields contained in the subclass. Bug: 192050390 Bug: 191055353 Test: manual, cannot repro crash after patch Merged-In: Ib12e0a959eb5a5d73d5832ff2eee26a30eed5ded Change-Id: Ib12e0a959eb5a5d73d5832ff2eee26a30eed5ded (cherry picked from commit 7ac9b1da731bdf6ed2f34e22d5da7030bc0f7d21)
1 parent e9a6ebf commit f1c159e

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

services/core/java/com/android/server/pm/PackageManagerService.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14252,9 +14252,15 @@ public boolean updateIntentVerificationStatus(String packageName, int status, in
1425214252
return new ParceledListSlice<IntentFilter>(result) {
1425314253
@Override
1425414254
protected void writeElement(IntentFilter parcelable, Parcel dest, int callFlags) {
14255-
// IntentFilter has final Parcelable methods, so redirect to the subclass
14256-
((ParsedIntentInfo) parcelable).writeIntentInfoToParcel(dest,
14257-
callFlags);
14255+
parcelable.writeToParcel(dest, callFlags);
14256+
}
14257+
14258+
@Override
14259+
protected void writeParcelableCreator(IntentFilter parcelable, Parcel dest) {
14260+
// All Parcel#writeParcelableCreator does is serialize the class name to
14261+
// access via reflection to grab its CREATOR. This does that manually, pointing
14262+
// to the parent IntentFilter so that all of the subclass fields are ignored.
14263+
dest.writeString(IntentFilter.class.getName());
1425814264
}
1425914265
};
1426014266
}

0 commit comments

Comments
 (0)