mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-12-14 10:24:32 -05:00
7dd773c83b
Signed-off-by: Tavi <tavi@divested.dev>
52 lines
1.9 KiB
Diff
52 lines
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
|
|
Date: Tue, 2 May 2023 16:47:49 +0300
|
|
Subject: [PATCH] disable hardened_malloc for Pixel camera provider service
|
|
|
|
---
|
|
libc/bionic/libc_init_dynamic.cpp | 3 +++
|
|
libc/bionic/malloc_common.cpp | 3 +++
|
|
libc/include/stdlib.h | 1 +
|
|
3 files changed, 7 insertions(+)
|
|
|
|
diff --git a/libc/bionic/libc_init_dynamic.cpp b/libc/bionic/libc_init_dynamic.cpp
|
|
index 1135b805c..042d037a3 100644
|
|
--- a/libc/bionic/libc_init_dynamic.cpp
|
|
+++ b/libc/bionic/libc_init_dynamic.cpp
|
|
@@ -90,6 +90,9 @@ static void init_prog_id(libc_globals* globals) {
|
|
|
|
#define IS(prog) (!strcmp(exe_path, prog))
|
|
|
|
+ if (IS("/apex/com.google.pixel.camera.hal/bin/hw/android.hardware.camera.provider@2.7-service-google")) {
|
|
+ prog_id = PROG_PIXEL_CAMERA_PROVIDER_SERVICE;
|
|
+ }
|
|
#undef IS
|
|
|
|
// libc_globals struct is write-protected
|
|
diff --git a/libc/bionic/malloc_common.cpp b/libc/bionic/malloc_common.cpp
|
|
index 3d3e8ef61..9b7310347 100644
|
|
--- a/libc/bionic/malloc_common.cpp
|
|
+++ b/libc/bionic/malloc_common.cpp
|
|
@@ -425,6 +425,9 @@ static const MallocDispatch* native_allocator_dispatch;
|
|
void InitNativeAllocatorDispatch(libc_globals* globals) {
|
|
bool hardened_impl = true;
|
|
switch (get_prog_id()) {
|
|
+ case PROG_PIXEL_CAMERA_PROVIDER_SERVICE:
|
|
+ hardened_impl = false;
|
|
+ break;
|
|
default:
|
|
hardened_impl = getenv("DISABLE_HARDENED_MALLOC") == nullptr;
|
|
}
|
|
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
|
|
index 5ce8f9103..cb8d3d3b2 100644
|
|
--- a/libc/include/stdlib.h
|
|
+++ b/libc/include/stdlib.h
|
|
@@ -213,6 +213,7 @@ long strtol_l(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, i
|
|
int get_prog_id();
|
|
#define is_prog(id) (get_prog_id() == id)
|
|
|
|
+#define PROG_PIXEL_CAMERA_PROVIDER_SERVICE 1
|
|
__END_DECLS
|
|
|
|
#include <android/legacy_stdlib_inlines.h>
|