Re: [PATCH v4] exec: load_script: Do not exec truncated interpreter path

2019-02-17 Thread Kees Cook
On Sun, Feb 17, 2019 at 9:30 AM Linus Torvalds wrote: > > On Sun, Feb 17, 2019 at 1:09 AM Kees Cook wrote: > > > > +static inline char *next_spacetab(char *first, const char *last) > > +{ > > + for (; first <= last; first++) > > + if (spacetab(*first)) > > +

Re: [PATCH v4] exec: load_script: Do not exec truncated interpreter path

2019-02-17 Thread Linus Torvalds
On Sun, Feb 17, 2019 at 1:09 AM Kees Cook wrote: > > +static inline char *next_spacetab(char *first, const char *last) > +{ > + for (; first <= last; first++) > + if (spacetab(*first)) > + return first; > + return NULL; > +} I think this should be "

[PATCH v4] exec: load_script: Do not exec truncated interpreter path

2019-02-17 Thread Kees Cook
Commit 8099b047ecc4 ("exec: load_script: don't blindly truncate shebang string") was trying to protect against a confused exec of a truncated interpreter path. However, it was overeager and also refused to truncate arguments as well, which broke userspace, and it was reverted. This attempts the pro