summaryrefslogtreecommitdiff
path: root/mtectrl
diff options
context:
space:
mode:
authorFlorian Mayer <fmayer@google.com>2022-10-28 10:47:46 -0700
committerFlorian Mayer <fmayer@google.com>2022-10-28 17:54:09 +0000
commit1af018f3c2b1632499382defdbc8f87855e8bb36 (patch)
tree95c519882369681a06ea5fdcfc8bb56882469463 /mtectrl
parent0dc11ad901801115bc38142a4e8151888447ecc7 (diff)
downloadextras-1af018f3c2b1632499382defdbc8f87855e8bb36.tar.gz
[mtectrl] resolve race with reboot
without this change, setprop "arm64.memtag.bootctl" [...] && reboot was racy, because it was not guaranteed that the change was applied before rebooting. we still immediately apply the changes as well, just in case there is a thermal shutdown, which does not run triggers. Bug: 256042002 Test: reboot and look at logcat Change-Id: I9a057d4dc2e18a10f026b641f693699ae617e8ec
Diffstat (limited to 'mtectrl')
-rw-r--r--mtectrl/mtectrl.rc3
1 files changed, 3 insertions, 0 deletions
diff --git a/mtectrl/mtectrl.rc b/mtectrl/mtectrl.rc
index 69f4586d..06413766 100644
--- a/mtectrl/mtectrl.rc
+++ b/mtectrl/mtectrl.rc
@@ -20,3 +20,6 @@ on property:persist.device_config.memory_safety_native.bootloader_override=*
on init && property:ro.arm64.memtag.bootctl_supported=1
exec -- /system/bin/mtectrl -s arm64.memtag.bootctl
+
+on shutdown && property:ro.arm64.memtag.bootctl_supported=1
+ exec -- /system/bin/mtectrl ${arm64.memtag.bootctl:-none} ${persist.device_config.memory_safety_native.bootloader_override:-default}