diff --git a/compiler-rt/lib/hwasan/hwasan.cpp b/compiler-rt/lib/hwasan/hwasan.cpp index aa841067eb7f3fef20a78e3b1d3efd03c5cd1d06..1075785be64ae6174bdff7c2925cd4f4f0378af2 100644 --- a/compiler-rt/lib/hwasan/hwasan.cpp +++ b/compiler-rt/lib/hwasan/hwasan.cpp @@ -98,10 +98,16 @@ static void InitializeFlags() { #endif // OHOS_LOCAL begin +// Default minimum hwasan configuration #if SANITIZER_OHOS cf.handle_segv = kHandleSignalNo; cf.handle_sigbus = kHandleSignalNo; cf.handle_abort = kHandleSignalNo; + cf.allocator_may_return_null = true; + cf.log_exe_name = true; + cf.detect_leaks = false; + cf.print_module_map = 2; + cf.intercept_send = false; #endif // OHOS_LOCAL end OverrideCommonFlags(cf); diff --git a/compiler-rt/lib/hwasan/hwasan_flags.inc b/compiler-rt/lib/hwasan/hwasan_flags.inc index e5be23f218b6ff9d11aac25d0a5c66e7679efb36..2dd11b455b9e03128de3d45ef48f05c687f32ef4 100644 --- a/compiler-rt/lib/hwasan/hwasan_flags.inc +++ b/compiler-rt/lib/hwasan/hwasan_flags.inc @@ -136,14 +136,10 @@ HWASAN_FLAG(int, detect_odr_violation, 0, "Default does not detect single defined rule (ODR) violations.") HWASAN_FLAG(bool, alloc_dealloc_mismatch, false, "Report errors on malloc/delete, new/free, new/delete[], etc.") -HWASAN_FLAG(bool, allocator_may_return_null, true, - "If true, the allocator does not crash and returns nullptr when " - "out of memory.") HWASAN_FLAG(bool, detect_container_overflow, false, "If false, disabling out-of-bounds detection. See " "https://github.com/google/sanitizers/wiki/" "AddressSanitizerContainerOverflow") -HWASAN_FLAG(bool, detect_leaks, false, "Disable memory leak detection.") HWASAN_FLAG( int, report_globals, 0, "Controls the way to handle globals (0 - don't detect buffer overflow on " @@ -152,16 +148,6 @@ HWASAN_FLAG( HWASAN_FLAG(bool, allow_user_poisoning, true, "If set, user may manually mark memory regions as poisoned or " "unpoisoned.") -HWASAN_FLAG(bool, log_exe_name, true, - "If set true, mention name of executable when reporting error and " - "append executable name to logs (as in \"log_path.exe_name.pid\").") HWASAN_FLAG(bool, detect_stack_use_after_return, false, "Disables stack-use-after-return checking at run-time.") -HWASAN_FLAG(int, print_module_map, 2, - "Print the process module map where supported (0 - don't print, " - "1 - print only once before process exits, 2 - print after each " - "report).") -HWASAN_FLAG(bool, intercept_send, false, - "If set true, uses custom wrappers for send* functions " - "to find more errors.") // OHOS_LOCAL end \ No newline at end of file