mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-12-14 10:24:32 -05:00
d98f33a337
TODO: - f/w/b - settings Signed-off-by: Tavi <tavi@divested.dev>
27 lines
1.0 KiB
Diff
27 lines
1.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
|
|
Date: Tue, 2 May 2023 16:46:56 +0300
|
|
Subject: [PATCH] support disabling hardened_malloc for specific program IDs
|
|
|
|
---
|
|
libc/bionic/malloc_common.cpp | 6 +++++-
|
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/libc/bionic/malloc_common.cpp b/libc/bionic/malloc_common.cpp
|
|
index 86e6fdcf9..3d3e8ef61 100644
|
|
--- a/libc/bionic/malloc_common.cpp
|
|
+++ b/libc/bionic/malloc_common.cpp
|
|
@@ -423,7 +423,11 @@ static constexpr MallocDispatch __scudo_malloc_dispatch __attribute__((unused))
|
|
static const MallocDispatch* native_allocator_dispatch;
|
|
|
|
void InitNativeAllocatorDispatch(libc_globals* globals) {
|
|
- const bool hardened_impl = getenv("DISABLE_HARDENED_MALLOC") == nullptr;
|
|
+ bool hardened_impl = true;
|
|
+ switch (get_prog_id()) {
|
|
+ default:
|
|
+ hardened_impl = getenv("DISABLE_HARDENED_MALLOC") == nullptr;
|
|
+ }
|
|
|
|
const MallocDispatch* table = hardened_impl ?
|
|
&__libc_malloc_default_dispatch :
|