Re: [PATCH v2 8/8] exec: Remove recursion from search_binary_handler

2020-05-19 Thread Kees Cook
On Mon, May 18, 2020 at 07:34:19PM -0500, Eric W. Biederman wrote: > > Recursion in kernel code is generally a bad idea as it can overflow > the kernel stack. Recursion in exec also hides that the code is > looping and that the loop changes bprm->file. > > Instead of recursing in search_binary_h

[PATCH v2 8/8] exec: Remove recursion from search_binary_handler

2020-05-18 Thread Eric W. Biederman
Recursion in kernel code is generally a bad idea as it can overflow the kernel stack. Recursion in exec also hides that the code is looping and that the loop changes bprm->file. Instead of recursing in search_binary_handler have the methods that would recurse set bprm->interpreter and return 0.