Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1078655rdg; Wed, 11 Oct 2023 13:53:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFid6xJm97TY8SIsVLpS78vpJrWOJx2IkwAHMSAQmy2aCtr0k0BZpDQpxYa0Q/RxYaG3OLg X-Received: by 2002:a05:6871:5cb:b0:1e9:6d98:cfdc with SMTP id v11-20020a05687105cb00b001e96d98cfdcmr6167544oan.22.1697057630948; Wed, 11 Oct 2023 13:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697057630; cv=none; d=google.com; s=arc-20160816; b=e477hyMQC1XGyp4DJYVurm9i7wXu815BZ2g5jDXNvhJ5DgwKCnosvEatNJ8tVS91kh gAuuggv2R6Ss2UyvMUSGCqkx0hT1AqnLIg8nK6Yn2w/lMWUbQyQ4jXb8n6XGCgX1LMJi mv8mvAKcBpqPH60G6H3nRY3GHtTbj+1dyLVMQysHJaubZkf0F4vBOu/budIwd0lNRWgy dQTGMtJXUSgAhYbCuwBNJtXPosOdJNDZgqb3g1Egk6xIjH00ivEOpdlCmyH3ko7JZPFg Jf24DD7GNSWB21+59HDlp1yNhZvoCArSYQc8dokZ6CzfXLU9gcu/oei3pOeLiMtIjtu/ lZGg== 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=XVEFx/99V7XCBN866yQJaTLA7E/ewxI1Ouc4XYxPLsY=; fh=HYxLO3S768M7tUNLkDARmUq/zTs37P/jEkR4H0foy4g=; b=regXnuMX3+zXw9q0SKSS9OATmErEkSDkZtHNEtoVjG5rAtwpXRPwFAW0o0pzKGtc+F NBvCTatiufKDiDrch90m3brNREl68Md9hY9nqV37nEdxPcFDN/bZOwkbidvzv4QTjLjO 4MA5ud4olY4LMttK5ravguwMdoTpb+d5ou/uaMw/gHH1K/Ve3/KaK81mtSa5/tElCyYn /d3phieWXFU6whiYam5rniLr3lWRh0RryPBkNHGimseCEqHkCVV8OdXGk3603m8AId2h vwYTvuJ60f8F+AUrzX1/AOXr/W9eLnD05i8bmWb/WWC5rHaQ+wdvX1qPgakQB66N5JpS 6qLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h67-20020a636c46000000b0056952b496efsi559772pgc.366.2023.10.11.13.53.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 13:53:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 42EB58183265; Wed, 11 Oct 2023 13:53:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235233AbjJKUxl convert rfc822-to-8bit (ORCPT + 99 others); Wed, 11 Oct 2023 16:53:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233487AbjJKUxl (ORCPT ); Wed, 11 Oct 2023 16:53:41 -0400 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2948A9; Wed, 11 Oct 2023 13:53:39 -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 1qqgCn-0006PR-08; Wed, 11 Oct 2023 16:53:21 -0400 Message-ID: Subject: Re: [PATCH v4] 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, linux-kernel@vger.kernel.org, Matthew House , Eric Biederman Date: Wed, 11 Oct 2023 16:53:20 -0400 In-Reply-To: References: <20231011124301.4d93ea72@imladris.surriel.com> <20231011125330.13dfe148@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 agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 11 Oct 2023 13:53:48 -0700 (PDT) X-Spam-Level: ** On Wed, 2023-10-11 at 22:14 +0200, Alejandro Colomar wrote: > Hi Rik, > > On Wed, Oct 11, 2023 at 12:53:30PM -0400, Rik van Riel wrote: > > Sigh, once again I did a git commit --amend without the latest file > > change being > > included. The change below should be good. Working with both git > > and hg gets me sometimes :/ > > ---8<--- > > > > 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. > > I'm still concerned by the wording of this sentence (and the next > one). > When I (and any user-space programmer, I think) read "string is > longer > than FOO", I read `strlen(string) > FOO`.  Since it's rather > `strlen(string) >= FOO`, I think you should clarify.  How about this? > > -  An argument or environment string is longer (including the null > byte) >    than MAX_ARG_STRLEN. That works. Would you like me to re-send a v5, or do you want to massage the changelog when you apply the patch? I must admit I paid more attention to the wording in the man page than the wording in the changelog :) -- All Rights Reversed.