mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-04-19 22:10:19 +02:00
Workaround issues in broken apps
This commit is contained in:
parent
0537fbb546
commit
bb7c5a3de3
1 changed files with 21 additions and 0 deletions
21
h_malloc.c
21
h_malloc.c
|
@ -1087,6 +1087,27 @@ COLD static void handle_bugs(void) {
|
||||||
ro.purge_slabs = false;
|
ro.purge_slabs = false;
|
||||||
ro.region_quarantine_protect = false;
|
ro.region_quarantine_protect = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char cmdline[256];
|
||||||
|
if (readlink("/proc/self/cmdline", cmdline, sizeof(cmdline)) == -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char *const broken_apps[] = {
|
||||||
|
"com.blizzard.diablo.immortal",
|
||||||
|
"com.halfbrick.jetpackjoyride"
|
||||||
|
};
|
||||||
|
|
||||||
|
// Workaround for apps (mostly games) which have memory corruption
|
||||||
|
for (unsigned i = 0; i < sizeof(broken_apps) / sizeof(broken_apps[0]); i++) {
|
||||||
|
if (strcmp(broken_apps[i], cmdline) == 0) {
|
||||||
|
ro.zero_on_free = false;
|
||||||
|
ro.purge_slabs = false;
|
||||||
|
ro.region_quarantine_protect = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
COLD static void init_slow_path(void) {
|
COLD static void init_slow_path(void) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue