[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whBnu7TQTOoOiqSmDGpH0oxrFo9sDzJTZRFhFCv69BMrg@mail.gmail.com>
Date: Fri, 15 Feb 2019 07:54:48 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Kees Cook <keescook@...omium.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Oleg Nesterov <oleg@...hat.com>,
Samuel Dionne-Riel <samuel@...nne-riel.com>,
Richard Weinberger <richard.weinberger@...il.com>,
Graham Christensen <graham@...hamc.com>,
Michal Hocko <mhocko@...e.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] exec: load_script: Do not exec truncated interpreter path
On Thu, Feb 14, 2019 at 10:15 PM Kees Cook <keescook@...omium.org> wrote:
>
> The only way we know the interpreter wasn't truncated in the
> no-newline case is if we see whitespace after first skipping any
> leading whitespace, and it seemed really ugly to add a special scan
> there.
No, much easier (and likely better code too), to just use 'memchr()'.
What's wrong with this simple and fairly self-describing patch?
And I'll rather add a few lines due to helper functions with names to
make it more legible, rather than code in that already fairly long
existing function.
Linus
View attachment "patch.diff" of type "text/x-patch" (1318 bytes)
Powered by blists - more mailing lists