From 3fefb2e82308a64697c16b032431166ab989240b Mon Sep 17 00:00:00 2001 From: Evgenii Stepanov Date: Mon, 5 Jun 2023 16:25:52 -0700 Subject: [PATCH 1/3] Disable Kernel MTE in Zuma (non-fullmte). Bug: 280343521 Test: cat /proc/cmdline | grep kasan=off Change-Id: I42781e8efdc4cf5a89baca1af8c3d62a4984c4f2 --- BoardConfig-common.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk index 454dc341..d6156557 100644 --- a/BoardConfig-common.mk +++ b/BoardConfig-common.mk @@ -39,6 +39,9 @@ BOARD_KERNEL_CMDLINE += rcupdate.rcu_expedited=1 rcu_nocbs=all BOARD_KERNEL_CMDLINE += stack_depot_disable=off page_pinner=on BOARD_KERNEL_CMDLINE += swiotlb=1024 BOARD_KERNEL_CMDLINE += cgroup.memory=nokmem +ifeq (,$(filter %_fullmte,$(TARGET_PRODUCT))) +BOARD_KERNEL_CMDLINE += kasan=off +endif BOARD_BOOTCONFIG += androidboot.boot_devices=13200000.ufs TARGET_NO_BOOTLOADER := true From bc502d582b2dcc7861d124a203a234ffbeb5f9bd Mon Sep 17 00:00:00 2001 From: Evgenii Stepanov Date: Mon, 5 Jun 2023 16:29:35 -0700 Subject: [PATCH 2/3] [Zuma] Unset mte_tcf_preferred Reverting to all-async configuration according to PoR. Bug: 280343521 Test: adb shell setprop persist.device_config.runtime_native_boot.bootloader_override force_on adb reboot adb shell 'cat /sys/devices/system/cpu/cpu?/mte_tcf_preferred' should return all "async" Change-Id: Ic42cc8102ff55348dd9061682a779d9dde6ee02c --- conf/init.zuma.rc | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/conf/init.zuma.rc b/conf/init.zuma.rc index e01c79a3..03c020e4 100644 --- a/conf/init.zuma.rc +++ b/conf/init.zuma.rc @@ -1101,18 +1101,3 @@ on property:ro.boot.mode=charger && property:init.svc.vendor.charger=running # Enable UFS powersaving in Off Mode Charger write /dev/sys/block/bootdevice/clkgate_enable 1 -# MTE -on property:persist.device_config.runtime_native_boot.bootloader_override=force_on - # Per-core mode overrides. - # Little Cores: sync - write /sys/devices/system/cpu/cpu0/mte_tcf_preferred sync - write /sys/devices/system/cpu/cpu1/mte_tcf_preferred sync - write /sys/devices/system/cpu/cpu2/mte_tcf_preferred sync - write /sys/devices/system/cpu/cpu3/mte_tcf_preferred sync - # Mid Cores: sync - write /sys/devices/system/cpu/cpu4/mte_tcf_preferred sync - write /sys/devices/system/cpu/cpu5/mte_tcf_preferred sync - write /sys/devices/system/cpu/cpu6/mte_tcf_preferred sync - write /sys/devices/system/cpu/cpu7/mte_tcf_preferred sync - # Big Core: sync more performance is prohibitively bad - write /sys/devices/system/cpu/cpu8/mte_tcf_preferred asymm From e205724019cad869be1bd642f5c9abf26f7810fb Mon Sep 17 00:00:00 2001 From: Evgenii Stepanov Date: Wed, 14 Jun 2023 16:49:04 -0700 Subject: [PATCH 3/3] Zuma: disable MTE on system apps Bug: 280343521 Test: debuggerd on the listed apps should not mention PR_TCF_MTE Change-Id: I9311210fec4e6f720fb2a7c4d48c4927925d252b --- device-common.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/device-common.mk b/device-common.mk index 67fb2335..d71c79dd 100644 --- a/device-common.mk +++ b/device-common.mk @@ -52,4 +52,7 @@ PRODUCT_PRODUCT_PROPERTIES += \ # force enable MTE. ifeq (,$(filter %_fullmte,$(TARGET_PRODUCT))) PRODUCT_PRODUCT_PROPERTIES += ro.arm64.memtag.bootctl_supported=1 +PRODUCT_PRODUCT_PROPERTIES += persist.arm64.memtag.app.com.android.se=off +PRODUCT_PRODUCT_PROPERTIES += persist.arm64.memtag.app.com.google.android.bluetooth=off +PRODUCT_PRODUCT_PROPERTIES += persist.arm64.memtag.app.com.android.nfc=off endif