From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6477CDB46A for ; Wed, 11 Oct 2023 16:43:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235138AbjJKQnp convert rfc822-to-8bit (ORCPT ); Wed, 11 Oct 2023 12:43:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235149AbjJKQnm (ORCPT ); Wed, 11 Oct 2023 12:43:42 -0400 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29201E4; Wed, 11 Oct 2023 09:43:40 -0700 (PDT) Received: from imladris.home.surriel.com ([10.0.13.28] helo=imladris.surriel.com) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.1) (envelope-from ) id 1qqcJ8-0004S7-2t; Wed, 11 Oct 2023 12:43:38 -0400 Message-ID: <6347cb90238ce61fb21a8203da53497663cee60a.camel@surriel.com> Subject: Re: [PATCH v2] execve.2: execve also returns E2BIG if a string is too long From: Rik van Riel To: Alejandro Colomar Cc: linux-man@vger.kernel.org, kernel-team@meta.com, LKML , Eric Biederman , Matthew House Date: Wed, 11 Oct 2023 12:43:38 -0400 In-Reply-To: References: <20231011101134.709b8089@imladris.surriel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 Sender: riel@surriel.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2023-10-11 at 17:48 +0200, Alejandro Colomar wrote: > Hi Rik, > > On Wed, Oct 11, 2023 at 10:11:34AM -0400, Rik van Riel wrote: > > The execve syscall returns -E2BIG in 3 cases: > > - The total length of the command line arguments and environment is > > too large. > > - An argument or environment string is longer than MAX_ARG_STRLEN. > > Please mention that this includes the terminating NUL, as Matthew > confirmed.  Otherwise, to user-space programmers, this would usually > be > interpreted as `strlen(p) > MAX_ARG_STRLEN`. > > An example program that demonstrates the limit would be very > interesting > here. Thank you for the detailed review. I think all the comments are addressed in version 3. -- All Rights Reversed.