commit | c0c57c8fa58346f3b0837a02c313e447c91b74c9 | [log] [tgz] |
---|---|---|
author | Jerome Forissier <jerome@forissier.org> | Wed Jan 08 14:57:32 2020 +0100 |
committer | Jérôme Forissier <jerome@forissier.org> | Wed Jan 08 17:10:29 2020 +0100 |
tree | 2540d14b935424dc5c41f6f956c29c16e43f7c00 | |
parent | 824b34c04a9451983460de00a4f112c025eea311 [diff] |
symbolize.py: fix stack dump of TEE core with pager Commit 105e09c24479 ("symbolize.py: add support for TEE core ASLR") has introduced support for ASLR by using addresses relative to the .text section. To this end, the '-j.text' option is passed to addr2line. Unfortunately, it happens that addr2line does not like to be given addresses that are outside the specified section. This can happen when CFG_WITH_PAGER=y as shown in the following example: D/TC:4 0 TEE load address @ 0x3f000000 D/TC:4 0 Call stack: D/TC:4 0 0x000000003f0080ac read_pc at optee_os/core/arch/arm/include/arm64.h:237 D/TC:4 0 0x000000003f062984 ?? ??:0 D/TC:4 0 0x000000003f007be4 wq_wait_final at optee_os/core/arch/arm/kernel/wait_queue.c:88 D/TC:4 0 0x000000003f007698 __mutex_lock at optee_os/core/arch/arm/kernel/mutex.c:57 D/TC:4 0 0x000000003f06c204 ?? ??:0 D/TC:4 0 0x000000003f067160 ?? ??:0 D/TC:4 0 0x000000003f06221c ?? ??:0 D/TC:4 0 0x000000003f006298 thread_std_smc_entry at optee_os/core/arch/arm/kernel/thread_optee_smc_a64.S:162 The addresses that cannot be resolved happen to be inside section .text_pageable, not .text (excerpt from readelf -e tee.elf): [Nr] Name Type Address Offset [ 1] .text PROGBITS 000000003f000000 00010000 [11] .text_pageable PROGBITS 000000003f05f388 0006f388 This commit choses a different approch. Instead of using relative addresses, we keep absolute ones but correct them with the load address in the ELF file: corrected address = supplied address - runtime start address + link time load address Fixes: 105e09c24479 ("symbolize.py: add support for TEE core ASLR") Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
This git contains source code for the secure side implementation of OP-TEE project.
All official OP-TEE documentation has moved to http://optee.readthedocs.io.
// OP-TEE core maintainers