Re: [PATCH] riscv: Add STACKPROTECTOR supported

2020-07-05 Thread Kees Cook
On Mon, Jul 06, 2020 at 08:55:35AM +0800, Guo Ren wrote: > On Mon, Jul 6, 2020 at 4:31 AM Kees Cook wrote: > > Sure -- I assume get_cycles64() is architecturally "simple"? (i.e. it > > doesn't require that the entire time-keeping subsystem has started?) > Yes, it's just a csr read. But it's necess

Re: [PATCH] riscv: Add STACKPROTECTOR supported

2020-07-05 Thread Guo Ren
On Mon, Jul 6, 2020 at 4:31 AM Kees Cook wrote: > > On Sun, Jul 05, 2020 at 10:16:14PM +0800, Guo Ren wrote: > > On Sun, Jul 5, 2020 at 2:53 PM Kees Cook wrote: > > > On Sun, Jul 05, 2020 at 06:24:15AM +, guo...@kernel.org wrote: > > > > +static __always_inline void boot_init_stack_canary(voi

Re: [PATCH] riscv: Add STACKPROTECTOR supported

2020-07-05 Thread Kees Cook
On Sun, Jul 05, 2020 at 10:16:14PM +0800, Guo Ren wrote: > On Sun, Jul 5, 2020 at 2:53 PM Kees Cook wrote: > > On Sun, Jul 05, 2020 at 06:24:15AM +, guo...@kernel.org wrote: > > > +static __always_inline void boot_init_stack_canary(void) > > > +{ > > > + unsigned long canary; > > > + > > >

Re: [PATCH] riscv: Add STACKPROTECTOR supported

2020-07-05 Thread Guo Ren
Hi Kees, On Sun, Jul 5, 2020 at 2:53 PM Kees Cook wrote: > > On Sun, Jul 05, 2020 at 06:24:15AM +, guo...@kernel.org wrote: > > From: Guo Ren > > > > The -fstack-protector & -fstack-protector-strong features are from > > gcc. The patch only add basic kernel support to stack-protector > > fea

Re: [PATCH] riscv: Add STACKPROTECTOR supported

2020-07-04 Thread Kees Cook
On Sun, Jul 05, 2020 at 06:24:15AM +, guo...@kernel.org wrote: > From: Guo Ren > > The -fstack-protector & -fstack-protector-strong features are from > gcc. The patch only add basic kernel support to stack-protector > feature and some arch could have its own solution such as > ARM64_PTR_AUTH.

[PATCH] riscv: Add STACKPROTECTOR supported

2020-07-04 Thread guoren
From: Guo Ren The -fstack-protector & -fstack-protector-strong features are from gcc. The patch only add basic kernel support to stack-protector feature and some arch could have its own solution such as ARM64_PTR_AUTH. After enabling STACKPROTECTOR and STACKPROTECTOR_STRONG, the .text size is ex