Re: [PATCH][RFC] rslib: Remove VLAs by setting upper bound on nroots

2018-03-09 Thread Thomas Gleixner
On Fri, 9 Mar 2018, Kees Cook wrote: > On Fri, Mar 9, 2018 at 7:49 AM, Thomas Gleixner wrote: > > On Fri, 9 Mar 2018, Kees Cook wrote: > > Maybe I should just go with 24 as the max, and if we have a case where > we need more, address it then? Works for me. Thanks, tglx

Re: [PATCH][RFC] rslib: Remove VLAs by setting upper bound on nroots

2018-03-09 Thread Kees Cook
On Fri, Mar 9, 2018 at 7:49 AM, Thomas Gleixner wrote: > On Fri, 9 Mar 2018, Kees Cook wrote: > >> Avoid VLAs[1] by always allocating the upper bound of stack space >> needed. The existing users of rslib appear to max out at 32 roots, >> so use that as the upper bound. > > I think 32 is plenty. Do

Re: [PATCH][RFC] rslib: Remove VLAs by setting upper bound on nroots

2018-03-09 Thread Thomas Gleixner
On Fri, 9 Mar 2018, Kees Cook wrote: > Avoid VLAs[1] by always allocating the upper bound of stack space > needed. The existing users of rslib appear to max out at 32 roots, > so use that as the upper bound. I think 32 is plenty. Do we have actually a user with 32? > Alternative: make init_rs()

[PATCH][RFC] rslib: Remove VLAs by setting upper bound on nroots

2018-03-09 Thread Kees Cook
Avoid VLAs[1] by always allocating the upper bound of stack space needed. The existing users of rslib appear to max out at 32 roots, so use that as the upper bound. Alternative: make init_rs() a true caller-instance and pre-allocate the workspaces. Will this need locking or are the callers already