linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: alexs@kernel.org
Cc: Eric Biederman <ebiederm@xmission.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Alex Shi <alexsshi@tencent.com>,
	Sergei Trofimovich <slyich@gmail.com>,
	curlinhuang@tencent.com
Subject: Re: [PATCH] execve: argument list space enlargement
Date: Wed, 10 Jan 2024 16:13:21 -0800	[thread overview]
Message-ID: <202401101609.F791E52@keescook> (raw)
In-Reply-To: <20240103130722.1551670-1-alexs@kernel.org>

On Wed, Jan 03, 2024 at 09:07:22PM +0800, alexs@kernel.org wrote:
> From: Alex Shi <alexsshi@tencent.com>
> 
> Wechat using too long gcc parameters, then get a strace complain:
>   execve(...) = -1 E2BIG (Argument list too long)
> Have to increase the parameter space for this, stack has enough
> space for this enlargement.

This is the second request recently[1] to expand the argument list size,
but I remain somewhat unconvinced this needs fixing on the kernel side.

[1] https://lore.kernel.org/lkml/202310170957.DF7F7FE9FA@keescook/

If we do change it, though, as I mention in the thread above, I'd prefer
to leave the UAPI alone and just detach the kernel internals from that
hard-coded limit.

-Kees

> 
> Signed-off-by: Alex Shi <alexsshi@tencent.com>
> Cc: Alex Shi <alexsshi@tencent.com>
> To: linux-kernel@vger.kernel.org
> To: linux-mm@kvack.org
> To: Kees Cook <keescook@chromium.org>
> To: Eric Biederman <ebiederm@xmission.com>
> ---
>  include/uapi/linux/binfmts.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/binfmts.h b/include/uapi/linux/binfmts.h
> index c6f9450efc12..717f6cafe8dd 100644
> --- a/include/uapi/linux/binfmts.h
> +++ b/include/uapi/linux/binfmts.h
> @@ -12,7 +12,7 @@ struct pt_regs;
>   * prevent the kernel from being unduly impacted by misaddressed pointers.
>   * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
>   */
> -#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
> +#define MAX_ARG_STRLEN (PAGE_SIZE * 128)
>  #define MAX_ARG_STRINGS 0x7FFFFFFF
>  
>  /* sizeof(linux_binprm->buf) */
> -- 
> 2.43.0
> 

-- 
Kees Cook


      parent reply	other threads:[~2024-01-11  0:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-03 13:07 alexs
2024-01-05 12:02 ` David Laight
2024-01-11  0:13 ` Kees Cook [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202401101609.F791E52@keescook \
    --to=keescook@chromium.org \
    --cc=alexs@kernel.org \
    --cc=alexsshi@tencent.com \
    --cc=curlinhuang@tencent.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=slyich@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox