Skip to content

Commit 2052b3d

Browse files
committed
Do not apply mtectrl state on shutdown if it hadn't been loaded
This would reset the MTE state for incomplete boots Test: MemtagBootctlTest Change-Id: I2b5f2afd55ea85fa59a11baa79e2c96b07897da6
1 parent c88f715 commit 2052b3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mtectrl/mtectrl.rc

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on property:persist.device_config.runtime_native_boot.bootloader_override=* && p
2525
on early-boot && property:ro.arm64.memtag.bootctl_supported=1
2626
exec_background -- /system/bin/mtectrl -s arm64.memtag.bootctl -f arm64.memtag.bootctl_loaded
2727

28-
on shutdown && property:ro.arm64.memtag.bootctl_supported=1
28+
on shutdown && property:ro.arm64.memtag.bootctl_supported=1 && property:arm64.memtag.bootctl_loaded=*
2929
# This doesn't use wait_for_prop to not stall the shutdown.
3030
exec -- /system/bin/mtectrl ${arm64.memtag.bootctl:-none} ${persist.device_config.runtime_native_boot.bootloader_override:-default}
3131

0 commit comments

Comments
 (0)