From 21d50b280fb63c5b73366a25bb74e87dd6ff08ab Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 23 Jun 2022 13:36:21 -0700 Subject: [MTE] Reset memtag message on factory reset. Bug: 235255174 Test: https://gist.github.com/fmayer/8900b52636574ee079fa1943e5da918e Change-Id: If42faa0417f9717d66eaa4247a88de61985b21b0 --- install/wipe_data.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install/wipe_data.cpp b/install/wipe_data.cpp index 024c1e1d5..c65e6f488 100644 --- a/install/wipe_data.cpp +++ b/install/wipe_data.cpp @@ -25,6 +25,7 @@ #include #include +#include "bootloader_message/bootloader_message.h" #include "install/snapshot_utils.h" #include "otautil/dirutil.h" #include "recovery_ui/ui.h" @@ -100,6 +101,12 @@ bool WipeData(Device* device) { success &= EraseVolume(METADATA_ROOT, ui); } } + ui->Print("Resetting memtag message...\n"); + std::string err; + if (!WriteMiscMemtagMessage({}, &err)) { + ui->Print("Failed to reset memtag message: %s\n", err.c_str()); + success = false; + } if (success) { success &= device->PostWipeData(); } -- cgit v1.2.3