[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5j+HDB1rQFUj51UXD_PXHK+aoeZzu06BtSr=WfZY5RXVGA@mail.gmail.com>
Date: Fri, 15 Feb 2019 08:08:08 -0800
From: Kees Cook <keescook@...omium.org>
To: Linus Torvalds <torvalds@...ux-foundation.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 Fri, Feb 15, 2019 at 7:55 AM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> 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.
This fails to notice truncation when there is leading whitespace.
And I'm happy to add helper functions. We just have to pick which mess
we want to have. :)
--
Kees Cook
Powered by blists - more mailing lists