AImageReader-CFI-crash-mitigations.patch

This commit is contained in:
none 2021-03-05 18:56:51 +01:00
parent bc3ed2825d
commit eed10a9db7

View file

@ -18,11 +18,22 @@ crashes on Android 9 and 10 (at different code locations).
See discussions at:
* https://github.com/bromite/bromite/issues/445
* https://github.com/bromite/bromite/issues/814
FILE:AImageReader-CFI-crash-mitigations.patch
FILE:AImageReader-CFI-crash-mitigations.patch
---
base/android/android_image_reader_compat.cc | 8 +++++++-
base/android/android_image_reader_compat.h | 4 ++++
chrome/browser/flag-metadata.json | 2 +-
gpu/config/gpu_driver_bug_list.json | 16 ++++++++++++++++
gpu/config/gpu_finch_features.cc | 11 ++++++++++-
gpu/config/gpu_finch_features.h | 1 +
gpu/config/gpu_util.cc | 8 ++++++++
gpu/config/gpu_workaround_list.txt | 1 +
gpu/ipc/service/gpu_init.cc | 5 +++++
gpu/ipc/service/stream_texture_android.cc | 11 ++++++++++-
media/base/media_switches.cc | 4 ++++
media/base/media_switches.h | 1 +
12 files changed, 68 insertions(+), 4 deletions(-)
diff --git a/base/android/android_image_reader_compat.cc b/base/android/android_image_reader_compat.cc
index 489344676c..c2cf1ccb66 100644
--- a/base/android/android_image_reader_compat.cc
+++ b/base/android/android_image_reader_compat.cc
@@ -23,6 +23,8 @@
@ -49,7 +60,6 @@ index 489344676c..c2cf1ccb66 100644
AndroidImageReader::AndroidImageReader() : is_supported_(LoadFunctions()) {}
diff --git a/base/android/android_image_reader_compat.h b/base/android/android_image_reader_compat.h
index 44f73a3c99..7f0414839d 100644
--- a/base/android/android_image_reader_compat.h
+++ b/base/android/android_image_reader_compat.h
@@ -22,6 +22,9 @@ class BASE_EXPORT AndroidImageReader {
@ -71,7 +81,6 @@ index 44f73a3c99..7f0414839d 100644
AndroidImageReader();
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index e2d0b182a8..83c117592a 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -1772,7 +1772,7 @@
@ -84,7 +93,6 @@ index e2d0b182a8..83c117592a 100644
{
"name": "enable-immersive-fullscreen-toolbar",
diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_list.json
index e0131b61b3..f7cc1dfdb5 100644
--- a/gpu/config/gpu_driver_bug_list.json
+++ b/gpu/config/gpu_driver_bug_list.json
@@ -3254,6 +3254,22 @@
@ -111,7 +119,6 @@ index e0131b61b3..f7cc1dfdb5 100644
"id": 336,
"cr_bugs": [625785],
diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc
index a93d6d6739..787129ad72 100644
--- a/gpu/config/gpu_finch_features.cc
+++ b/gpu/config/gpu_finch_features.cc
@@ -38,6 +38,11 @@ bool FieldIsInBlocklist(const char* current_value, std::string blocklist_str) {
@ -140,7 +147,6 @@ index a93d6d6739..787129ad72 100644
// If webview-draw-functor-uses-vulkan is set, use vulkan for composite and
// raster.
diff --git a/gpu/config/gpu_finch_features.h b/gpu/config/gpu_finch_features.h
index 350a3f4cb0..1a6d111e8e 100644
--- a/gpu/config/gpu_finch_features.h
+++ b/gpu/config/gpu_finch_features.h
@@ -17,6 +17,7 @@ namespace features {
@ -152,7 +158,6 @@ index 350a3f4cb0..1a6d111e8e 100644
GPU_EXPORT extern const base::Feature kAndroidSurfaceControl;
GPU_EXPORT extern const base::Feature kAImageReader;
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
index 545f30c233..16d5d770d1 100644
--- a/gpu/config/gpu_util.cc
+++ b/gpu/config/gpu_util.cc
@@ -111,6 +111,9 @@ GpuFeatureStatus GetAndroidSurfaceControlFeatureStatus(
@ -178,7 +183,6 @@ index 545f30c233..16d5d770d1 100644
// Estimates roughly user total disk space by counting in the drives where
diff --git a/gpu/config/gpu_workaround_list.txt b/gpu/config/gpu_workaround_list.txt
index 551650c275..0526767800 100644
--- a/gpu/config/gpu_workaround_list.txt
+++ b/gpu/config/gpu_workaround_list.txt
@@ -13,6 +13,7 @@ decode_encode_srgb_for_generatemipmap
@ -190,7 +194,6 @@ index 551650c275..0526767800 100644
disable_accelerated_vp8_encode
disable_accelerated_vp9_decode
diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc
index fcb2350204..775b973e67 100644
--- a/gpu/ipc/service/gpu_init.cc
+++ b/gpu/ipc/service/gpu_init.cc
@@ -477,6 +477,11 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
@ -206,7 +209,6 @@ index fcb2350204..775b973e67 100644
kGpuFeatureStatusEnabled ||
!InitializeVulkan()) {
diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_texture_android.cc
index beef1941f2..d002ef2a95 100644
--- a/gpu/ipc/service/stream_texture_android.cc
+++ b/gpu/ipc/service/stream_texture_android.cc
@@ -6,6 +6,7 @@
@ -235,7 +237,6 @@ index beef1941f2..d002ef2a95 100644
: TextureOwner::Mode::kSurfaceTextureInsecure;
}
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
index be386a63b9..0882270539 100644
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -600,6 +600,10 @@ const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",
@ -250,7 +251,6 @@ index be386a63b9..0882270539 100644
// that cannot support SurfaceLayer at the moment.
const base::Feature kDisableSurfaceLayerForVideo{
diff --git a/media/base/media_switches.h b/media/base/media_switches.h
index 9f17fdc134..5cb69eebbe 100644
--- a/media/base/media_switches.h
+++ b/media/base/media_switches.h
@@ -205,6 +205,7 @@ MEDIA_EXPORT extern const base::Feature kMediaControlsExpandGesture;
@ -261,3 +261,6 @@ index 9f17fdc134..5cb69eebbe 100644
MEDIA_EXPORT extern const base::Feature kDisableSurfaceLayerForVideo;
MEDIA_EXPORT extern const base::Feature kCanPlayHls;
MEDIA_EXPORT extern const base::Feature kPictureInPictureAPI;
--
2.17.1