Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5603f6e0 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10233678 from e4b3b7b4 to udc-release

Change-Id: Ia67bbba1f44e5bb2e1a179d9e104b1787da26739
parents a4f008d5 e4b3b7b4
Loading
Loading
Loading
Loading
+18 −14
Original line number Original line Diff line number Diff line
@@ -566,13 +566,15 @@ static void debuggerd_signal_handler(int signal_number, siginfo_t* info, void* c
    process_info = g_callbacks.get_process_info();
    process_info = g_callbacks.get_process_info();
  }
  }


  gwp_asan_callbacks_t gwp_asan_callbacks = {};
  if (g_callbacks.get_gwp_asan_callbacks != nullptr) {
    // GWP-ASan catches use-after-free and heap-buffer-overflow by using PROT_NONE
    // GWP-ASan catches use-after-free and heap-buffer-overflow by using PROT_NONE
    // guard pages, which lead to SEGV. Normally, debuggerd prints a bug report
    // guard pages, which lead to SEGV. Normally, debuggerd prints a bug report
    // and the process terminates, but in some cases, we actually want to print
    // and the process terminates, but in some cases, we actually want to print
    // the bug report and let the signal handler return, and restart the process.
    // the bug report and let the signal handler return, and restart the process.
    // In order to do that, we need to disable GWP-ASan's guard pages. The
    // In order to do that, we need to disable GWP-ASan's guard pages. The
    // following callbacks handle this case.
    // following callbacks handle this case.
  gwp_asan_callbacks_t gwp_asan_callbacks = g_callbacks.get_gwp_asan_callbacks();
    gwp_asan_callbacks = g_callbacks.get_gwp_asan_callbacks();
    if (signal_number == SIGSEGV && signal_has_si_addr(info) &&
    if (signal_number == SIGSEGV && signal_has_si_addr(info) &&
        gwp_asan_callbacks.debuggerd_needs_gwp_asan_recovery &&
        gwp_asan_callbacks.debuggerd_needs_gwp_asan_recovery &&
        gwp_asan_callbacks.debuggerd_gwp_asan_pre_crash_report &&
        gwp_asan_callbacks.debuggerd_gwp_asan_pre_crash_report &&
@@ -581,6 +583,7 @@ static void debuggerd_signal_handler(int signal_number, siginfo_t* info, void* c
      gwp_asan_callbacks.debuggerd_gwp_asan_pre_crash_report(info->si_addr);
      gwp_asan_callbacks.debuggerd_gwp_asan_pre_crash_report(info->si_addr);
      process_info.recoverable_gwp_asan_crash = true;
      process_info.recoverable_gwp_asan_crash = true;
    }
    }
  }


  // If sival_int is ~0, it means that the fallback handler has been called
  // If sival_int is ~0, it means that the fallback handler has been called
  // once before and this function is being called again to dump the stack
  // once before and this function is being called again to dump the stack
@@ -764,6 +767,7 @@ void debuggerd_init(debuggerd_callbacks_t* callbacks) {
bool debuggerd_handle_signal(int signal_number, siginfo_t* info, void* context) {
bool debuggerd_handle_signal(int signal_number, siginfo_t* info, void* context) {
  if (signal_number != SIGSEGV || !signal_has_si_addr(info)) return false;
  if (signal_number != SIGSEGV || !signal_has_si_addr(info)) return false;


  if (g_callbacks.get_gwp_asan_callbacks == nullptr) return false;
  gwp_asan_callbacks_t gwp_asan_callbacks = g_callbacks.get_gwp_asan_callbacks();
  gwp_asan_callbacks_t gwp_asan_callbacks = g_callbacks.get_gwp_asan_callbacks();
  if (gwp_asan_callbacks.debuggerd_needs_gwp_asan_recovery == nullptr ||
  if (gwp_asan_callbacks.debuggerd_needs_gwp_asan_recovery == nullptr ||
      gwp_asan_callbacks.debuggerd_gwp_asan_pre_crash_report == nullptr ||
      gwp_asan_callbacks.debuggerd_gwp_asan_pre_crash_report == nullptr ||
+2 −0
Original line number Original line Diff line number Diff line
@@ -244,6 +244,8 @@ BatteryHealth getBatteryHealthStatus(int status) {
        value = BatteryHealth::UNSPECIFIED_FAILURE;
        value = BatteryHealth::UNSPECIFIED_FAILURE;
    else if (status == BatteryMonitor::BH_NOT_AVAILABLE)
    else if (status == BatteryMonitor::BH_NOT_AVAILABLE)
        value = BatteryHealth::NOT_AVAILABLE;
        value = BatteryHealth::NOT_AVAILABLE;
    else if (status == BatteryMonitor::BH_INCONSISTENT)
        value = BatteryHealth::INCONSISTENT;
    else
    else
        value = BatteryHealth::UNKNOWN;
        value = BatteryHealth::UNKNOWN;


+1 −0
Original line number Original line Diff line number Diff line
@@ -63,6 +63,7 @@ class BatteryMonitor {
        BH_NEEDS_REPLACEMENT,
        BH_NEEDS_REPLACEMENT,
        BH_FAILED,
        BH_FAILED,
        BH_NOT_AVAILABLE,
        BH_NOT_AVAILABLE,
        BH_INCONSISTENT,
    };
    };


    BatteryMonitor();
    BatteryMonitor();