From patchwork Wed Jan 24 20:05:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 13529620 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 098B2C47DDF for ; Wed, 24 Jan 2024 20:05:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8EF166B0098; Wed, 24 Jan 2024 15:05:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 89ED86B0099; Wed, 24 Jan 2024 15:05:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78D548D0001; Wed, 24 Jan 2024 15:05:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 662B16B0098 for ; Wed, 24 Jan 2024 15:05:14 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 40D3AA0D1B for ; Wed, 24 Jan 2024 20:05:14 +0000 (UTC) X-FDA: 81715283748.12.6D3C35F Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by imf02.hostedemail.com (Postfix) with ESMTP id A023D80024 for ; Wed, 24 Jan 2024 20:05:12 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=It+UiOeJ; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf02.hostedemail.com: domain of keescook@chromium.org designates 209.85.215.172 as permitted sender) smtp.mailfrom=keescook@chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706126712; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=8Y7koMM394YcEzPAIuYhiOvpOOgnTMayLM5RiqJ5YNw=; b=BEgSOM+oFTLavlxyF+z9yrwbJIB6UQa9G3cQH01SYpOiNPDdRZ0UQRsnnbUnoLIlPjLSbr VAnWwwKWYnnnTAGvTWIg0xRsF/yEqzV/mEoP/Co3XQ807w/CtKwH6LukKGc+Up1tlOI2uA RBjv1RWSesBAX0fcSfF99vzJmL6gmWs= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=It+UiOeJ; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf02.hostedemail.com: domain of keescook@chromium.org designates 209.85.215.172 as permitted sender) smtp.mailfrom=keescook@chromium.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706126712; a=rsa-sha256; cv=none; b=JG7gJ6a1rDck3+Ikjfd9R8uO4PJBhS/Td9SC3ngmqlqGQGvHgNP/AAn0KqpVWQJAy4XFPH j2H32tsa/VraNxkkYBRT3ckztshBiyOqW8oWfFPOHc/fn2X9+9b+59B+/pe+hK2QrS0rbW 8VMUk+8ikEWgyUdsgLMDwDJOXs4uEpU= Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-5cfb81124ecso4304695a12.2 for ; Wed, 24 Jan 2024 12:05:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1706126711; x=1706731511; darn=kvack.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=8Y7koMM394YcEzPAIuYhiOvpOOgnTMayLM5RiqJ5YNw=; b=It+UiOeJ1bhLR3p+zH89TcgXQckpKOdyhKtC82tMOhwM+9lNb2tO3Yt2EQPOEi0UUd 4DBWCjwDK+B1KJMoU2gWnDpoFzAye0CckS0YmQM66PQxlfHn/q1XkJ+oiZzqhsMtXDnf RitFqnVPoQ6OSj/KmUIlOg3oS3NRql9i8a5Uc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706126711; x=1706731511; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8Y7koMM394YcEzPAIuYhiOvpOOgnTMayLM5RiqJ5YNw=; b=A5BOCgAeKCuDKyanJPHhwFlylWVpYeW33HU6iIK74oLhA813SyZgpG5DvOhcB8pZ7o W2hVDP9Iu9Zqc3vXrrTP7koOtMwgii8Dq36V4dVpkQuzSnZ05IA23U67jmoEmWL58SXq zpbU9aqCknYE6pV4yGg5qN6VBmpojhA/rPLISwnwCqTueMbsiQiCmSIvz8IRBdGINZOy zwwE69aEH1cMTqFQFEt+R3uM2TXRCaA7rdNAwXgWo8aw7jIWK8+/FWpvk02EV/WrQ2Dv XlM53oghhLuAVPYAKAP1WEjqbTKmpDdtcIbYvZYUaauQQ4C0Zb1T6bgaalrLn+KUEsjX YXiw== X-Gm-Message-State: AOJu0YyQr2aa/EFy1Dk0FN/qmfTGbSxeGJ9cTrNtzsLelSZ+8MCR4y03 qZVZqPxxegUrX6cFCyY4yCTn+igr9OKX/4m6mtnnHFZ1NOtTJKxdVwARtVngkA== X-Google-Smtp-Source: AGHT+IHyOJEA1doA9PRcDsZemMCTGq4AfFgxZO9zVue12fkcWcsq7bdPSJK+1tDHuQmnMlfwSX/5jw== X-Received: by 2002:a05:6a20:3b1c:b0:19c:32be:628 with SMTP id c28-20020a056a203b1c00b0019c32be0628mr1149240pzh.81.1706126711561; Wed, 24 Jan 2024 12:05:11 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id f28-20020aa79d9c000000b006d9a13b491csm14013414pfq.212.2024.01.24.12.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 12:05:11 -0800 (PST) Date: Wed, 24 Jan 2024 12:05:10 -0800 From: Kees Cook To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Alexander Viro , Alexey Dobriyan , Andrew Morton , Askar Safin , Bernd Edlinger , Christian Brauner , Eric Biederman , Jan Kara , Kees Cook , Kentaro Takeda , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Sebastian Andrzej Siewior , Tetsuo Handa Subject: [GIT PULL] execve fixes for v6.8-rc2 Message-ID: <202401241201.A53405B0D1@keescook> MIME-Version: 1.0 Content-Disposition: inline X-Rspamd-Queue-Id: A023D80024 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 4cpsqd5soedz7nd8fh4e4c8k3z9ctcmb X-HE-Tag: 1706126712-439166 X-HE-Meta: U2FsdGVkX1+dg4TPTbxg9oAbNE7/1Y4U/0oc52gh5eoDCyIACiExGp7JE8NcR9zvUetwBv95OD9wWhxxHXwepostg2pe8slmBBd+cP1MEqZuf+5Ecb0yRiwY4aFdsvBQyNQtbV/It50I2P7LtjZAQp7QRVK4lbWBubaiCP8lD8A1Gv9DRUPEn70z0/BSqmsTma9IT4Cc4g5+pW/EmouKpUkrRhfa2Ke8XcmSlRlXu1LRIAHC1oUWSwKmQKcNaoLHxsoirQ38bM+7S01f1SmyVEb0pMO/4yi5saKN2fylRwS0xGLFrnjOJviOWc8ruID8qY3oMCbvlkk4Ew1i23Of/d6B7D2U1RNShlYiPGJZsumKU6nOoBVmNVj3nk2MMkMbUwZxOfL+sj5kvkcuax6OxV8QW89d6Ez9ogrVApDKdB+beeA+G656DolkDIAdViAAYorvcr6OeJrQjUV3YZakMBiW6xlgQpuG3A3rAMWpQQk9BN+8j6dCsvqyuqxPpwxM32OaFOygva4nu/YO2ogjD883mzF1D4OaHrvaqubZsoNrO8c2mNCVH44DK7wsO3riZ99cSTLdknq67TtJxSDGF/r5UnU8RYznqKS8/5nOmvUl+g3w2zZUpHWPo3rPxrLS3ausrwl1NjsRWBYc7eHje/ym5dGYeVFKXQyNRzxF+fVo3ePJU63RAE7hclAon9TRVc3oM0l1oFvafWmzuL8ZSghvv9e/gwv9OSoy/TfVycdbN3PHDnrxHLIiyn+GLsQrcluw9zXG5mRIw0ddGW8JqmCdN6OQsHuh/1srZwoVatF48mDNj/nrFEogjbRhuSQhk0vlrhA++WXlMPNR74lpDulWVKG8h7lmTjX+RZAnfunWoCNs2Oi5Pvj59JoFHtUZKE+C+0+r7NBh5+Tl2E8ZRULAKTCeHocWWXMRQUBKZe/JxbldTu1zqFbYyO+cBulQU3llXySi3XAq2rX3ukK gKJPJnOq R9lFyZMdRflffxg0SpLo6ZIhFg4Q+JTIxmyQSWJNWC/JepUiApWGe2GBUhG+OZL5ICJ31WNUqZSOp4Is= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Linus, Please pull these execve fixes for v6.8-rc2. One change was sent as part of the original -rc1 PR, one is a recent fix, and the rest are cleanups related to moving the open() earlier. I was waiting for a couple -next cycles since -rc1, and since we were already working on the in_execve fix, I figured I should send this PR now too. Thanks! -Kees The following changes since commit 6613476e225e090cc9aad49be7fa504e290dd33d: Linux 6.8-rc1 (2024-01-21 14:11:32 -0800) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git tags/execve-v6.8-rc2 for you to fetch changes up to 90383cc07895183c75a0db2460301c2ffd912359: exec: Distinguish in_execve from in_exec (2024-01-24 11:48:52 -0800) ---------------------------------------------------------------- execve fixes for v6.8-rc2 - Fix error handling in begin_new_exec() (Bernd Edlinger) - MAINTAINERS: specifically mention ELF (Alexey Dobriyan) - Various cleanups related to earlier open() (Askar Safin, Kees Cook) ---------------------------------------------------------------- Alexey Dobriyan (1): ELF, MAINTAINERS: specifically mention ELF Askar Safin (1): exec: remove useless comment Bernd Edlinger (1): exec: Fix error handling in begin_new_exec() Kees Cook (2): exec: Add do_close_execat() helper exec: Distinguish in_execve from in_exec MAINTAINERS | 3 ++- fs/exec.c | 39 ++++++++++++++++++++++++++++++--------- include/linux/sched.h | 2 +- kernel/fork.c | 1 + 4 files changed, 34 insertions(+), 11 deletions(-)