Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1950230rdb; Sun, 21 Jan 2024 00:05:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGTbGGpugWIJfe/vR7POhGW3AzV0TEHejJvmiAj3df+9tG/4DdJ9fOZtO6CJ6IQbgDsfgfi X-Received: by 2002:a05:6808:18b:b0:3bd:a592:588b with SMTP id w11-20020a056808018b00b003bda592588bmr2627879oic.81.1705824344071; Sun, 21 Jan 2024 00:05:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705824344; cv=pass; d=google.com; s=arc-20160816; b=c1y1AJJLG2qj7kIPgRx3KoxWjbCRWfqczM/BAGj1EBbstPHLtZG+qrIrvqa1OPLpJv ObeeJnxKVVQXuuP+LrHu6GX/kxN0yXMW0PuhW065DxIKL8d3zAhE7kGyy1v0m07OOpND HyWtO1bLyHZe+Q32202yoYUe/XssMKTRV7qwb3C76rYP/iwShc/nni2Lx7fC5LXwhUJw JlPFj/RWBtokgdzswK6tfl1KUpx3LmucXvQSNGcs3pvYkTJmvSIhhUIcasZox4DC/Nv3 q8sUfVAE3cW/DeHT0Yy/4aKxx4B4JQAwBI6F8nj3ztu+9nscR2MIxhL/CbwXslbI4FQP 2q1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:references:in-reply-to :user-agent:subject:cc:to:from:date:dkim-signature; bh=5m4YMZwIUsFW11vATiJB7Zw30FIia+5scna6ZtxzJaE=; fh=AGWvyy1EBl6x1DJFEywiNO1/yIFGcO1Kb2jzlzfuvsg=; b=pV2Dh8RfXq1IiD6w+BmY18tNpNImS897UeEvtVQsJb3CQx1fl4bfVRUEIBZQdA783l kjnxGb6cHtiquRVvtiYAGsTu7SaYE/E5XZJtkOTP+mWsE0RTjqrFVXz3ouChjdu02IvO 3CLg2Lwmtu6LiH+UERc9FNwGCV9dWYpITVUNNBf2n8E6szZb9JiL+bjIKShvfow2pFRZ wKu2pkHpq0QjK8NXdIg6+yB77c2eQsCaXxim90tUieoK/o5rT0ENRaAXr95uPpSgdlp8 qZCMGSGNVQqjxl9ejrykyWYlw0FyM6lwq9ZSk0dGNd84JkG48Mn++Azwc4XWhY3QXZ9B h29Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Oa8nTVig; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-31984-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31984-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f16-20020a63dc50000000b005ce0a6eb0cdsi6349996pgj.442.2024.01.21.00.05.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 00:05:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31984-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Oa8nTVig; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-31984-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31984-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8065D282BCF for ; Sun, 21 Jan 2024 08:05:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BFFE0364B1; Sun, 21 Jan 2024 08:05:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Oa8nTVig" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC9C4364AA for ; Sun, 21 Jan 2024 08:05:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705824336; cv=none; b=EOeFg4lpQC0ULRRxvq26cSAayed4bMCoT3wr7hlKfmUXF58n+EJ0dOOSO5geZ+/pWMoXrAlD5Ak3ngby7d67gb+VhnGYpJmYSe41VWu4adpe84tE0k9QgfM778WyYlJMXAoYWY/Q77y7IX57r3SiyYcYAo8j7DyWHqoWtx+SAkU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705824336; c=relaxed/simple; bh=5m4YMZwIUsFW11vATiJB7Zw30FIia+5scna6ZtxzJaE=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=owQ6H7ycB68ymPTm3VFnflnjiRZ7YyupfpOcNaHzP7UHQplUg0UFRdzoBcDsoADWZj79rP6IP9wB5KJC9541MFysClCmJK3yc8r0ov7xNAQmGK/GDXqRKLSeoa+Ab+PnaYzo3ntcI/hOsAFRaKSeM16LeB6D46GrLHRAyeXSMc8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Oa8nTVig; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 245B7C433F1; Sun, 21 Jan 2024 08:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705824336; bh=5m4YMZwIUsFW11vATiJB7Zw30FIia+5scna6ZtxzJaE=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=Oa8nTVig4JVK3qSWt/+4HZB/e2JNYSS5N4YMCFFdG/kVtciiFfAV494+aMuMiVTrt Fq1wj3Jw07Z52+UUarm78rX0aBkhuaGwfPw1/SRnJevNjANcvVyHmtQRGMm7wBYCIe Mvz3Fkkw4M06tzuYQFz0WPu1ZOPp7W8dqoOxCCXpvui8Hr/2Q17nqHk9W9Fiyu2sxO BLOTSnW6NzaosPjGq4B47lFazdRRASnuNfk8iRs1RFVYIXjkmVjDMeeGhA9w64HjF5 4dJUVausT+pBpV732kSnOK0TWWWjKc+YkBNOLcoIFfoYF6eApNexcOjLjKsFEvclCc bJkrM2/VVaaXw== Date: Sun, 21 Jan 2024 00:05:34 -0800 From: Kees Cook To: Linus Torvalds , Al Viro CC: Josh Triplett , Kees Cook , linux-kernel@vger.kernel.org, Alexey Dobriyan Subject: Re: [GIT PULL] execve updates for v6.8-rc1 User-Agent: K-9 Mail for Android In-Reply-To: References: <202401081028.0E908F9E0A@keescook> <20240111094711.GT1674809@ZenIV> <20240111100501.GU1674809@ZenIV> Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On January 20, 2024 2:18:36 PM PST, Linus Torvalds wrote: >End result: I committed my "move do_open_execat() to the beginning of >execve()" patch, since it's clearly an improvement on the existing >behavior, and that whole "struct file allocations are unnecessarily >expensive" issue is a separate thing=2E Thanks! I'll add the other bits of refactoring I did in my version of the = clean-up (I created do_close_execat() for the repeated "allow_write_access(= file); fput(file);" calls, along with some comments): https://lore=2Ekernel=2Eorg/lkml/202209161637=2E9EDAF6B18@keescook/ I like your removal of the "out" label! :) -Kees --=20 Kees Cook