diff options
author | yangbingqian <bqyang720@gmail.com> | 2017-03-22 18:41:15 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2022-01-27 18:50:18 +0800 |
commit | 69d4a277e5f04b54c8489ab72e42402912b52b15 (patch) | |
tree | 7d28354850199c18ef563f536e39094fe406d3ad | |
parent | 90b2e0bdebed77c0b41742106b989c1380d32d24 (diff) |
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: yangbingqian <bqyang720@gmail.com>
-rw-r--r-- | core/java/android/os/BaseBundle.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/os/BaseBundle.java b/core/java/android/os/BaseBundle.java index 1692921f4a8f..5cfdd361e67a 100644 --- a/core/java/android/os/BaseBundle.java +++ b/core/java/android/os/BaseBundle.java @@ -298,6 +298,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; if (recycleParcel) { |