Messages in this thread | | | From | Linus Torvalds <> | Date | Sun, 10 May 2020 12:38:20 -0700 | Subject | Re: [PATCH 3/5] exec: Remove recursion from search_binary_handler |
| |
On Sat, May 9, 2020 at 9:30 PM Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote: > > Wouldn't this change cause > > if (fd_binary > 0) > ksys_close(fd_binary); > bprm->interp_flags = 0; > bprm->interp_data = 0; > > not to be called when "Search for the interpreter" failed?
Good catch. We seem to have some subtle magic wrt the fd_binary file descriptor, which depends on the recursive behavior.
I'm not seeing how to fix it cleanly with the "turn it into a loop". Basically, that binfmt_misc use-case isn't really a tail-call.
Eric, ideas?
Linus
| |