Skip to content

Commit 867fbc5

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 b87eeb1 commit 867fbc5

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
@@ -14224,9 +14224,15 @@ public boolean updateIntentVerificationStatus(String packageName, int status, in
1422414224
return new ParceledListSlice<IntentFilter>(result) {
1422514225
@Override
1422614226
protected void writeElement(IntentFilter parcelable, Parcel dest, int callFlags) {
14227-
// IntentFilter has final Parcelable methods, so redirect to the subclass
14228-
((ParsedIntentInfo) parcelable).writeIntentInfoToParcel(dest,
14229-
callFlags);
14227+
parcelable.writeToParcel(dest, callFlags);
14228+
}
14229+
14230+
@Override
14231+
protected void writeParcelableCreator(IntentFilter parcelable, Parcel dest) {
14232+
// All Parcel#writeParcelableCreator does is serialize the class name to
14233+
// access via reflection to grab its CREATOR. This does that manually, pointing
14234+
// to the parent IntentFilter so that all of the subclass fields are ignored.
14235+
dest.writeString(IntentFilter.class.getName());
1423014236
}
1423114237
};
1423214238
}

0 commit comments

Comments
 (0)