Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp947573rdg; Wed, 11 Oct 2023 09:43:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAVV19m9uuu1DZMqZXSkQiYUQawghps44z1IuWJLg/6bBGSrqlaxS4BFjZbhoUhb3v+MSW X-Received: by 2002:a05:6a20:d417:b0:15d:4a4d:ecf7 with SMTP id il23-20020a056a20d41700b0015d4a4decf7mr17392970pzb.36.1697042634779; Wed, 11 Oct 2023 09:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697042634; cv=none; d=google.com; s=arc-20160816; b=oUq7QRWpt4MAftQhsRsnhWieeajQh+ycfZruD2Klj/9G+NkQjbz9SE2sUFbRm+xi/4 G2VeSghqMhB6iTSBeG+v6p5MleahEMn3wxU0xdzwEYMhCcnEpB/x+yTD9ktcV1T7UWjq 1ivP+TpjsA/8QWcDw//tEKpuz8ERr193So00PGa4veTJDhhrqAkIytecsl93+NZqwCWf ig0rSax0q7ALue8+rrYSDUa22wvdpDPHL7DYmdRK+p2TUPRGA8tO/Qqfg8gLJdT0h9S/ pRF+ajUPhVRgLCR8/akDObKEE6dGje8xW+9lncv+UVg6Z7dEm4yZEQVvCWulQbRVF9Uu LliQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=lMkoUq390dDpoSS9E55mEmBF1sRBPUmXNkNq2EavLoc=; fh=Uxb8CmDRNETOOABXu/reqwMbtOmB6epPbc1mQgATnvM=; b=fbyuY6Sn5IJv3+zul7CWJNgNBrnDB/b97l4jYpRmZS1Mam8dmoZ53btr9rGB/+NSzp lup1U6xVvHfncw+v/jeJ9mm32TWXncI1Gg7shd1RDirLEiFAPoTYwYgviU40mO8GkUYT 6D6GNYjwJhzAxA7QOefr8dvtzAQL7SNi7tKHuzQhEiO/xXRexKA5kDf+hYgFbHpGOVzY EAZgpE8/fBU7Pdl2dgqAwSCcueKUs7h4fIhb8XiDpSxpwJSGyvaCx8yiRxo4jGCQ5wlz w3zp3CvzHlT8Sx7gnpZPiuFQmSCHgsQgEniX8gq6bX8utbvrfZZ6OTdam/j9Uf/+Dby0 5W2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id k70-20020a633d49000000b00584d3c4a775si140159pga.626.2023.10.11.09.43.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 09:43:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id E50D880FD385; Wed, 11 Oct 2023 09:43:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346971AbjJKQno convert rfc822-to-8bit (ORCPT + 99 others); Wed, 11 Oct 2023 12:43:44 -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 X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 11 Oct 2023 09:43:51 -0700 (PDT) X-Spam-Level: ** 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.