Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 217b8fcd authored by yangbingqian's avatar yangbingqian Committed by Joey Rizzoli
Browse files

FATAL EXCEPTION IN SYSTEM PROCESS: android.ui

when 3rd party app put an extra with a bad serial object
to start a service or sendbroadcast to system_server.
It will cause system_server crash because of
classNotFoundException.

A test demo apk will cause system_server crash.
It really affact the system stability

Intent intent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
intent.putExtra(Intent.EXTRA_REFERRER, new serial()
/*a Serializable class object*/);
sendBroadcast(intent);

Test: use the test apk attached in the issue below, system_server will
crash every time. And it'll be OK with this CL.

https://code.google.com/p/android/issues/detail?id=261031



Change-Id: Id505571dcbf88c0ba9c1677ec0f1f08688c1bb95
Signed-off-by: default avataryangbingqian <bqyang720@gmail.com>
parent 525f760c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -274,6 +274,13 @@ public class BaseBundle {
                } else {
                    throw e;
                }
            } catch (RuntimeException e) {
                if (sShouldDefuse && (e.getCause() instanceof ClassNotFoundException)) {
                    Log.w(TAG, "Failed to parse Bundle, but defusing quietly", e);
                    map.erase();
                } else {
                    throw e;
                }
            } finally {
                mMap = map;
                parcelledData.recycle();