“36522f5cf2ad280c971557e04120d52f9330ed36”上不存在“tools/perf/git@gitcode.net:openharmony/kernel_linux.git”
未验证 提交 35d33c76 编写于 作者: A Alexandre Ghiti 提交者: Palmer Dabbelt

riscv: Initialize thread pointer before calling C functions

Because of the stack canary feature that reads from the current task
structure the stack canary value, the thread pointer register "tp" must
be set before calling any C function from head.S: by chance, setup_vm
and all the functions that it calls does not seem to be part of the
functions where the canary check is done, but in the following commits,
some functions will.

Fixes: f2c9699f ("riscv: Add STACKPROTECTOR supported")
Signed-off-by: NAlexandre Ghiti <alexandre.ghiti@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: NPalmer Dabbelt <palmer@rivosinc.com>
上级 9d19f2b5
...@@ -298,6 +298,7 @@ clear_bss_done: ...@@ -298,6 +298,7 @@ clear_bss_done:
REG_S a0, (a2) REG_S a0, (a2)
/* Initialize page tables and relocate to virtual addresses */ /* Initialize page tables and relocate to virtual addresses */
la tp, init_task
la sp, init_thread_union + THREAD_SIZE la sp, init_thread_union + THREAD_SIZE
XIP_FIXUP_OFFSET sp XIP_FIXUP_OFFSET sp
#ifdef CONFIG_BUILTIN_DTB #ifdef CONFIG_BUILTIN_DTB
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册