Re: [PATCH v7 4/6] x86/entry: Enable random_kstack_offset support

2021-03-29 Thread Kees Cook
On Sun, Mar 28, 2021 at 04:18:56PM +0200, Thomas Gleixner wrote: > On Fri, Mar 19 2021 at 14:28, Kees Cook wrote: > > + > > + /* > > +* x86_64 stack alignment means 3 bits are ignored, so keep > > +* the top 5 bits. x86_32 needs only 2 bits of alignment, so > > +* the top 6 bits will

Re: [PATCH v7 4/6] x86/entry: Enable random_kstack_offset support

2021-03-28 Thread Thomas Gleixner
On Fri, Mar 19 2021 at 14:28, Kees Cook wrote: > + > + /* > + * x86_64 stack alignment means 3 bits are ignored, so keep > + * the top 5 bits. x86_32 needs only 2 bits of alignment, so > + * the top 6 bits will be used. > + */ > + choose_random_kstack_offset(rdtsc() &

Re: [PATCH v7 4/6] x86/entry: Enable random_kstack_offset support

2021-03-21 Thread Kees Cook
On Sat, Mar 20, 2021 at 12:58:20PM +0100, Ingo Molnar wrote: > > * Kees Cook wrote: > > > Allow for a randomized stack offset on a per-syscall basis, with roughly > > 5-6 bits of entropy, depending on compiler and word size. Since the > > method of offsetting uses macros, this cannot live in

Re: [PATCH v7 4/6] x86/entry: Enable random_kstack_offset support

2021-03-20 Thread Ingo Molnar
* Kees Cook wrote: > Allow for a randomized stack offset on a per-syscall basis, with roughly > 5-6 bits of entropy, depending on compiler and word size. Since the > method of offsetting uses macros, this cannot live in the common entry > code (the stack offset needs to be retained for the

[PATCH v7 4/6] x86/entry: Enable random_kstack_offset support

2021-03-19 Thread Kees Cook
Allow for a randomized stack offset on a per-syscall basis, with roughly 5-6 bits of entropy, depending on compiler and word size. Since the method of offsetting uses macros, this cannot live in the common entry code (the stack offset needs to be retained for the life of the syscall, which means