diff options
author | Isaac J. Manjarres <isaacmanjarres@google.com> | 2023-06-28 18:01:00 -0700 |
---|---|---|
committer | Isaac J. Manjarres <isaacmanjarres@google.com> | 2023-06-29 17:03:01 -0700 |
commit | 1a6b86d5297db692ba785a1b68350b6a6d55cb3a (patch) | |
tree | 817e5ab1229e60103d43325b525bbfbe6687d9ee | |
parent | 876efdb04ce1ce2fdcaf6fc4c6ee92ad363eb884 (diff) | |
download | msm-1a6b86d5297db692ba785a1b68350b6a6d55cb3a.tar.gz |
sw5100.kasan_swtags: Enable stacktrace collection for KASAN builds
Stackdepot is needed to let KASAN capture stacktraces for
paths that allocate and free memory. These stacktraces are
valuable to developers when using KASAN, so ensure that the
kernel build can build a kernel image that enables stackdepot
for KASAN builds.
This has the added benefit of not having to repackage the vendor_boot
image in the platform build to enable stackdepot, as KASAN kernel
builds will have stackdepot enabled by default.
Bug: 289439846
Change-Id: I7b3fa55c65e13ac40a5a0041f803a0565e63436b
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
-rw-r--r-- | build.config.sw5100.kasan_swtags | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/build.config.sw5100.kasan_swtags b/build.config.sw5100.kasan_swtags index b6cd8cf..0030cd4 100644 --- a/build.config.sw5100.kasan_swtags +++ b/build.config.sw5100.kasan_swtags @@ -5,6 +5,16 @@ KMI_SYMBOL_LIST_STRICT_MODE=0 append_cmd POST_DEFCONFIG_CMDS update_kasan_config function update_kasan_config() { + + # The value of CONFIG_CMDLINE should be what is specified in the + # gki_defconfig with stack_depot_disable and kasan.stacktrace + # removed. + # + # default values: + # stack_depot_disable=off + # kasan.stacktrace=on + # + # This is the behavior that we want, so removing them is sufficient, ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \ -e CONFIG_KASAN \ -d CONFIG_KASAN_HW_TAGS \ @@ -14,7 +24,8 @@ function update_kasan_config() { -e CONFIG_KCOV \ -e CONFIG_DEBUG_INFO \ -d CONFIG_RANDOMIZE_BASE \ - --set-val CONFIG_FRAME_WARN 0 + --set-val CONFIG_FRAME_WARN 0 \ + --set-str CONFIG_CMDLINE "kvm-arm.mode=protected cgroup_disable=pressure" (cd ${OUT_DIR} && \ make O=${OUT_DIR} "${TOOL_ARGS[@]}" ${MAKE_ARGS} olddefconfig) } |