[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jJtyz890i9+gwaDFzojp_k9AB0z0_JHQNoFae69uQ5Ghw@mail.gmail.com>
Date: Mon, 12 Nov 2018 23:03:33 -0600
From: Kees Cook <keescook@...omium.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Oleg Nesterov <oleg@...hat.com>, Ben Woodard <woodard@...hat.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Michal Hocko <mhocko@...e.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] exec: increase BINPRM_BUF_SIZE to 256
On Mon, Nov 12, 2018 at 5:52 PM, Andrew Morton
<akpm@...ux-foundation.org> wrote:
> On Mon, 12 Nov 2018 17:09:56 +0100 Oleg Nesterov <oleg@...hat.com> wrote:
>
>> Large enterprise clients often times run applications out of networked
>> file systems where the IT mandated layout of project volumes can end up
>> leading to paths that are longer than 128 characters. Bumping this up to
>> the next order of two solves this problem in all but the most egregious
>> case while still fitting into a 512b slab.
>>
>> ...
>>
>> --- a/include/uapi/linux/binfmts.h
>> +++ b/include/uapi/linux/binfmts.h
>> @@ -16,6 +16,6 @@ struct pt_regs;
>> #define MAX_ARG_STRINGS 0x7FFFFFFF
>>
>> /* sizeof(linux_binprm->buf) */
>> -#define BINPRM_BUF_SIZE 128
>> +#define BINPRM_BUF_SIZE 256
This comment needs updating too:
fs/exec.c: * Check permissions, then read the first 128 (BINPRM_BUF_SIZE) bytes
>> #endif /* _UAPI_LINUX_BINFMTS_H */
>
> It does seem a rather silly restriction, and it's tempting to suggest
> reworking the code so that linux_binprm.buf is dynamically sized to
> accommodate even ludicrously large strings.
>
> But obviously 128 bytes has been enough for all this time, so that's
> going too far. However it would be basically cost-free to increase
> BINPRM_BUF_SIZE up to the point where sizeof(struct linux_binprm) ==
> PAGE_SIZE?
Yeah, and this might be a useful detail included in a comment above
the #define...
Regardless:
Acked-by: Kees Cook <keescook@...omium.org>
--
Kees Cook
Powered by blists - more mailing lists