Re: [PATCH v2] loongarch: Support RANDOMIZE_KSTACK_OFFSET

2024-07-20 Thread Kees Cook
On Sat, Jul 20, 2024 at 10:52:06AM +0800, Jinjie Ruan wrote: > > > On 2024/7/20 0:01, Kees Cook wrote: > > On Fri, Jul 19, 2024 at 11:14:27AM +0800, Jinjie Ruan wrote: > >> Add support of kernel stack offset randomization while handling syscall, > >> the offset is defaultly limited by KSTACK_OFFS

Re: [PATCH v2] loongarch: Support RANDOMIZE_KSTACK_OFFSET

2024-07-19 Thread Jinjie Ruan
On 2024/7/20 0:01, Kees Cook wrote: > On Fri, Jul 19, 2024 at 11:14:27AM +0800, Jinjie Ruan wrote: >> Add support of kernel stack offset randomization while handling syscall, >> the offset is defaultly limited by KSTACK_OFFSET_MAX(). >> >> In order to avoid trigger stack canaries (due to __built

Re: [PATCH v2] loongarch: Support RANDOMIZE_KSTACK_OFFSET

2024-07-19 Thread Kees Cook
On Fri, Jul 19, 2024 at 11:14:27AM +0800, Jinjie Ruan wrote: > Add support of kernel stack offset randomization while handling syscall, > the offset is defaultly limited by KSTACK_OFFSET_MAX(). > > In order to avoid trigger stack canaries (due to __builtin_alloca) and > slowing down the entry path

Re: [PATCH v2] loongarch: Support RANDOMIZE_KSTACK_OFFSET

2024-07-19 Thread Huacai Chen
Applied with small changes, thanks. https://github.com/chenhuacai/linux/commit/a55a07439613689f0890c9482b9c5f76dec255dd Huacai On Fri, Jul 19, 2024 at 11:09 AM Jinjie Ruan wrote: > > Add support of kernel stack offset randomization while handling syscall, > the offset is defaultly limited by KS

[PATCH v2] loongarch: Support RANDOMIZE_KSTACK_OFFSET

2024-07-18 Thread Jinjie Ruan
Add support of kernel stack offset randomization while handling syscall, the offset is defaultly limited by KSTACK_OFFSET_MAX(). In order to avoid trigger stack canaries (due to __builtin_alloca) and slowing down the entry path, use __no_stack_protector attribute to disable stack protector for do_