Merge "[MTE] add device config for permissive mode" am: 0b2cf1d6ec
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2219637 Change-Id: Ief986a852344646f3331c3b489942ce3c2cfd79c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
87fa70eee3
1 changed files with 6 additions and 0 deletions
|
|
@ -103,9 +103,15 @@ static bool property_parse_bool(const char* name) {
|
||||||
static bool is_permissive_mte() {
|
static bool is_permissive_mte() {
|
||||||
// Environment variable for testing or local use from shell.
|
// Environment variable for testing or local use from shell.
|
||||||
char* permissive_env = getenv("MTE_PERMISSIVE");
|
char* permissive_env = getenv("MTE_PERMISSIVE");
|
||||||
|
char process_sysprop_name[512];
|
||||||
|
async_safe_format_buffer(process_sysprop_name, sizeof(process_sysprop_name),
|
||||||
|
"persist.device_config.memory_safety_native.permissive.process.%s",
|
||||||
|
getprogname());
|
||||||
// DO NOT REPLACE this with GetBoolProperty. That uses std::string which allocates, so it is
|
// DO NOT REPLACE this with GetBoolProperty. That uses std::string which allocates, so it is
|
||||||
// not async-safe (and this functiong gets used in a signal handler).
|
// not async-safe (and this functiong gets used in a signal handler).
|
||||||
return property_parse_bool("persist.sys.mte.permissive") ||
|
return property_parse_bool("persist.sys.mte.permissive") ||
|
||||||
|
property_parse_bool("persist.device_config.memory_safety_native.permissive.default") ||
|
||||||
|
property_parse_bool(process_sysprop_name) ||
|
||||||
(permissive_env && ParseBool(permissive_env) == ParseBoolResult::kTrue);
|
(permissive_env && ParseBool(permissive_env) == ParseBoolResult::kTrue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue