Re: [RFC PATCH] riscv: enable per-task stack canaries

2020-07-05 Thread Guo Ren
On Mon, Jul 6, 2020 at 9:21 AM Kees Cook wrote: > > On Mon, Jul 06, 2020 at 09:01:51AM +0800, Guo Ren wrote: > > Yeah! :) I just want to show you, how about the format: use tp in gpr > > to do that. The format is similar to arm64. > > > > tp is the task_struct point in riscv. > > Sounds good to me

Re: [RFC PATCH] riscv: enable per-task stack canaries

2020-07-05 Thread Kees Cook
On Mon, Jul 06, 2020 at 09:01:51AM +0800, Guo Ren wrote: > Yeah! :) I just want to show you, how about the format: use tp in gpr > to do that. The format is similar to arm64. > > tp is the task_struct point in riscv. Sounds good to me, yes. Thanks! Is there anyone looking at the GCC and Clang sid

Re: [RFC PATCH] riscv: enable per-task stack canaries

2020-07-05 Thread Guo Ren
On Mon, Jul 6, 2020 at 4:40 AM Kees Cook wrote: > > On Sun, Jul 05, 2020 at 02:13:17PM +, guo...@kernel.org wrote: > > From: Guo Ren > > > > After compare arm64 and x86 implementations, seems arm64's is more > > flexible and readable. The key point is how gcc get the offset of > > stack_canar

Re: [RFC PATCH] riscv: enable per-task stack canaries

2020-07-05 Thread Kees Cook
On Sun, Jul 05, 2020 at 02:13:17PM +, guo...@kernel.org wrote: > From: Guo Ren > > After compare arm64 and x86 implementations, seems arm64's is more > flexible and readable. The key point is how gcc get the offset of > stack_canary from gs/el0_sp. > > x86: Use a fix offset from gs, not flex

[RFC PATCH] riscv: enable per-task stack canaries

2020-07-05 Thread guoren
From: Guo Ren After compare arm64 and x86 implementations, seems arm64's is more flexible and readable. The key point is how gcc get the offset of stack_canary from gs/el0_sp. x86: Use a fix offset from gs, not flexible. struct fixed_percpu_data { /* * GCC hardcodes the stack c