Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp9126669rwi; Tue, 25 Oct 2022 15:42:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Lh+BBb3hr5nzBT9Pm6eIJdy9l8HVb+9fFOoSQRRCUFh/BDnQH5WkhB1UR0sMaOL6461Qx X-Received: by 2002:a17:902:aa02:b0:186:9395:4e82 with SMTP id be2-20020a170902aa0200b0018693954e82mr18037416plb.5.1666737750598; Tue, 25 Oct 2022 15:42:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666737750; cv=none; d=google.com; s=arc-20160816; b=DN0jUKhPbtPxSh5aQ4gU3mqaJLD0/Yz1mXIbNbFfGJb2AXuZmPRNFHISagsTdjH+t0 u1SJOAGSOeLLi2Tb9pV+CyOTSZs8cIbWLoIFQIpI2Pos+swc1juFRshkbwhHOVx4GSYH Tnfg2eQgC+qFAuCjRFDOQ2JyrboNvIC8tYQ/P1ehFO2qo2eX7lmqQ3y6OpIeTkFQ8DEf Q6R3DtzbKGI+vGtRxmuAIhlW5nTz1jDW2cnzv4EV6LEvX/30mpRW0XFssptj5XAefbs1 UrDO2y4nb5wfFYZ1xensn1QoVsAaFcO6f4OCsBwK5cIQdqufwVGT/LppoVCbKJhnXxGW zOEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fVyOXaIPwUu5vIxKTkFwgvGCOhZvoDwYK5zKXQji1rw=; b=J5CaG9hrsxaQuC8JHwHSTq/hZBd3yScDsulP8F/l2q+cENHXP1GVsm+0NrgdjeyIp+ mMHJHVt+j+Ezuj97zniRjMIHfpzFP4NgBDKSsB2o1xctdvg9l1fvz7kmt6d5R9j3kz4O 1fOP04wL6UXUcFLIHNJrag/ScMRvcDA/oG3+ExJlxn5utMtg03/bIhJ643v9nyPUQZAW TFSPluCNIO8DJoctuwqV55O6TzecsrxX/NiWOSNyzEibeQvW1Rulh/OE93PpQ2AOxsSM EA5wsFyebjXK1k6CB/arprsWWg2Dw6/JaKWj1ndO10i9FkxqeAxHsLqSnFCP5/L/SuX0 hoEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FXN94XTH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s64-20020a632c43000000b0046b1a7c6679si4679868pgs.414.2022.10.25.15.42.19; Tue, 25 Oct 2022 15:42:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FXN94XTH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232761AbiJYW0C (ORCPT + 99 others); Tue, 25 Oct 2022 18:26:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232317AbiJYWZW (ORCPT ); Tue, 25 Oct 2022 18:25:22 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D04C57D1E2 for ; Tue, 25 Oct 2022 15:25:20 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id ez6so12245137pjb.1 for ; Tue, 25 Oct 2022 15:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fVyOXaIPwUu5vIxKTkFwgvGCOhZvoDwYK5zKXQji1rw=; b=FXN94XTHI8WO7GeSzT3nSCHe9nGZqe2ZmzGLnUOqPa93icziFIl7n+9AfXwT3f2+y0 8QSjBta7eXcMJndiixYUZaYrIr/ALR4UMqjUyF0XwH2DvIQU9E69PpcWNPC0sAnOd+X6 fVZP3RQlmJQyVICheUyWF2dKDm4CAztuMUGoM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fVyOXaIPwUu5vIxKTkFwgvGCOhZvoDwYK5zKXQji1rw=; b=yZbRFXylTomh4VcRTRXTWt7iKQBGgfm2Q7ztIRnPwPbrTMCSBT9lXgABRF6crQplaD fKXvpOiX7aySY6UZU4834dda2ZuJwMmE6HYTeRa3NUXM8FNJO+HfoW3+q5bT8WtPxXvl FBJGUgXtiEAmwpKOesaNRKTVyvWA5yO4NbEXblHr4iowgp8SU9T6t5H+zrkCtH138taM eMbwkzG5zobH/sNf9WuHy7uU16qNGD32CRiMD9HVLqkc55WddcCNBOBjr2hJaK8XkmSw UtxcpGItua3FpcM+8ESX3rMfNzGNJ0nLBbTt0lLBIpsm+ZNFNsFOStkyGUBqwj9IC6ib wMEA== X-Gm-Message-State: ACrzQf00A4AIXNvRuXmsSpS3b2G73M3JT325Y6p44RAZZcvtSnM53QkV IoC/WMfWiWNBuc8dPKxG1sf453/0DdHe2g== X-Received: by 2002:a17:90b:4c52:b0:20d:489b:5607 with SMTP id np18-20020a17090b4c5200b0020d489b5607mr597178pjb.40.1666736719535; Tue, 25 Oct 2022 15:25:19 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b78-20020a621b51000000b0056b4c5dde61sm1898977pfb.98.2022.10.25.15.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 15:25:18 -0700 (PDT) From: Kees Cook To: Al Viro , ebiederm@xmission.com, eb@emlix.com Cc: Kees Cook , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] fs/exec.c: simplify initial stack size expansion Date: Tue, 25 Oct 2022 15:24:39 -0700 Message-Id: <166673667324.2128117.14471012472344174206.b4-ty@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <2017429.gqNitNVd0C@mobilepool36.emlix.com> References: <2017429.gqNitNVd0C@mobilepool36.emlix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Oct 2022 09:32:35 +0200, Rolf Eike Beer wrote: > I had a hard time trying to understand completely why it is using vm_end in > one side of the expression and vm_start in the other one, and using > something in the "if" clause that is not an exact copy of what is used > below. The whole point is that the stack_size variable that was used in the > "if" clause is the difference between vm_start and vm_end, which is not far > away but makes this thing harder to read than it must be. > > [...] Applied to for-next/execve, thanks! [1/1] fs/exec.c: simplify initial stack size expansion https://git.kernel.org/kees/c/bfb4a2b95875 -- Kees Cook