Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1153808rdg; Wed, 11 Oct 2023 16:46:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG4SVto/OXhFTT6L+iPaFrne++c7iInkxL5QsXOEiUEcGi/FLdMxitN4vy/SMJXJ0Bkp33N X-Received: by 2002:a17:902:e549:b0:1c9:aeb7:6cc9 with SMTP id n9-20020a170902e54900b001c9aeb76cc9mr8255106plf.62.1697067991405; Wed, 11 Oct 2023 16:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697067991; cv=none; d=google.com; s=arc-20160816; b=pAI+x9Dtv/4CiXE/REytHK1uZpXU6wwdP3k33ooJdE7kWhFGYIYJoEa94LcYmGnGwj 7XMwGu8yAcgDGzRvUD28zIFOFKa+vvfhQXZ1AG/MwmsTGAMaJBF/wEN9KspavSVcf2uR 266rhfXeIXk8n2mKOeTH+lWX7qqm/XZFiJWs+HIIk3caTwmJ3fXng+jCMC8Kxfz0/HLP iB/g33a9UEKPKQYh/pEvL+psJZn4dznsmwMIczppJd7EQMh0ZI7Lwgv9/CspzolRZXEz IpU4d6Bwr5tw25UBRikPwu6JCwh5MSS0+AXj4APgHi2jsgfQ0HSL8VU2PQhOzz1w6d6A 93Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6gBLI3WwLbBPDsSy+cEIeXgnF5ppYgeODVpDrKigypE=; fh=QojuKIUhjWr8nj9sRV7z2UjTQlDlWF63S3xLyYa3Zg0=; b=Gsq4a3RSLFAG69K2izN20+IFp2gdO6Pk3iZ1/Yji0nI90E0yTj3ffkx8hkfyeYm7qL tOhs8vd/GRPGQtDxdj8ffj5DvZHvVYg0Nf4F2SD1xh1rWIyB8r1Xn3Yk9SQds/RPhA0Q 27YwBnJIayOFi7l0zKcBGHeCFCHnU5HBgDaqGYkiDnQYwZWYsgPUyZkx0hJWBntZOG84 UOEVtvdawS9syaziaNQ0ufUn/gXpyOEsgyjIp26YQ5PtyyFjeibfG9xF9vih77Za5Pzy zhGUSB9giBGqz51usKb3HB6C/4HZraBeZog8fav1msQLitCtVQBa3CD5oPGKeZVdiN+w vIuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yj2F59qg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id b6-20020a170902b60600b001c4749ee72csi765333pls.503.2023.10.11.16.46.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 16:46:31 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yj2F59qg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 3FD6F8090794; Wed, 11 Oct 2023 16:45:38 -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 S233875AbjJKXpX (ORCPT + 99 others); Wed, 11 Oct 2023 19:45:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233277AbjJKXpW (ORCPT ); Wed, 11 Oct 2023 19:45:22 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51EC39E; Wed, 11 Oct 2023 16:45:20 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E73EC433C7; Wed, 11 Oct 2023 23:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697067919; bh=/HC7U5pVDv/9ep0iiqYi0TrXgK7iwfrCccR7NN9N6TA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Yj2F59qgm/RoY6Qg2GZyMHwtebockxxv+Qjm8WPRSDXl8YpYJFz0TDndU8FByrsim CyvhlpWoDT2htk/mBZXT8CYAPnH1+5UzXIFanaRwGWRg+2Iwmu/Z8h95moxUILZ53Z oLrQ8N3HYhRuugUdHVGmLJy6qx0NFEz4SAimoyS3w3KkBpEtdaNS4bNl6R1RO8zM5G D+ygriwctjw6Gq7CMMAlcTXUO9JrtSSZkCM0sLMIQpKHSoTLdqjg1d9QCVm+AB0VxQ yVqldd7/mvOZyqjxElkpMi92Ejb3QmfKGc6E4Mr19BkoETClNWfTFnbKDaycr4p3tA 4Agfo7cvSTZgQ== Date: Thu, 12 Oct 2023 01:45:15 +0200 From: Alejandro Colomar To: Rik van Riel Cc: linux-man@vger.kernel.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, Matthew House , Eric Biederman Subject: Re: [PATCH v4] execve.2: execve also returns E2BIG if a string is too long Message-ID: References: <20231011124301.4d93ea72@imladris.surriel.com> <20231011125330.13dfe148@imladris.surriel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="RS8szfeyc21P55+2" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 16:45:38 -0700 (PDT) X-Spam-Level: ** --RS8szfeyc21P55+2 Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Thu, 12 Oct 2023 01:45:15 +0200 From: Alejandro Colomar To: Rik van Riel Cc: linux-man@vger.kernel.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, Matthew House , Eric Biederman Subject: Re: [PATCH v4] execve.2: execve also returns E2BIG if a string is too long On Wed, Oct 11, 2023 at 04:53:20PM -0400, Rik van Riel wrote: > On Wed, 2023-10-11 at 22:14 +0200, Alejandro Colomar wrote: > > Hi Rik, > >=20 > > 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<--- > > >=20 > > > 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. > >=20 > > 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`.=C2=A0 Since it's rather > > `strlen(string) >=3D FOO`, I think you should clarify.=C2=A0 How about = this? > >=20 > > -=C2=A0 An argument or environment string is longer (including the null > > byte) > > =C2=A0=C2=A0 than MAX_ARG_STRLEN. >=20 > That works. Would you like me to re-send a v5, or do you > want to massage the changelog when you apply the patch? >=20 > I must admit I paid more attention to the wording in the > man page than the wording in the changelog :) I wouldn't mind doing it myself, but I'll ask you to resend, if you don't mind. I usually find that doing so helps catch other accidents that I didn't catch. :) Cheers, Alex >=20 > --=20 > All Rights Reversed. :) --=20 --RS8szfeyc21P55+2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE6jqH8KTroDDkXfJAnowa+77/2zIFAmUnM4sACgkQnowa+77/ 2zJFMw/9Ey8pzmgHsCgpWvgq2zMsRSsb6jNUZERcdNJ5f7KsnXCIfXoSHN0LlF6S fHtqMLL+zchtkDeWsro9LGIo+IRUnBVhiUIhsHV6hiT85PWchF0gEXEvE0rrJhun 5CMYbU0MpIGSseENN8MU6D+IXLUSorV3/BZ9dY1FNKAmsmx/Hk6tj3eNjvKlKuqt k7FSccKkprFXR7qSZNLd1SGoGHLu6AuOeuNtBGvJ5/0JB4GhbSdneA862hEC3D+h T1SQUBT55EzDbrLDGDuHizvSB891Vt4lRFnjlFZHmXcOM2nQn1bO97ThvjmCjZlg 1y1zcwN6VMx7UxALWFfnbCvkUcD9IGPQ21tMX5TYD0zigKepDZsWBFdrTq+NteaT 9gUCyOQV9DmYiv2ptAfB+i18rlyXxgQJg8DxFl4XxfCvMwnHzzkDH0b5LU3vGp7G GzIYqR7MNPwHVFRcgaEKJ97k+Ke5uzvVQ/kC9APYRZheXtiRF2iSlKlF9u0qNP8l BPR/gnKvwEWS9WqFQl92tNma0gib4gQ78Gbrh67jYPnnpYVUssVW8Ujrcbwwszxr V2/emDY4qHtwOJsPRuzcVQWCicwCWG3hLKekWak9qWjuQ2YCz5WD6wp0NT6GyFEK lxjMsZ23cT++ZouNAFpUplBiK/4h84dyy3CnAUPy2FTVNIqJgO4= =RJf0 -----END PGP SIGNATURE----- --RS8szfeyc21P55+2--