From mboxrd@z Thu Jan 1 00:00:00 1970 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 2A8B32744D for ; Thu, 16 Jan 2025 00:18:10 +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=1736986691; cv=none; b=NSchPB+bpIxttMEl87do748UFz9yH+GkiVph7AgGLNCl3dQ4fZ3h4PjMfGZT6oF9ixf3TMQz1/nxmeq/JS1EYBrwOrVZgKatEiE2kA5OHOD2sxIkqla3rPpwWYT/Gv8aDLdnD5UZVxs+nCbpKm4VYTyyPWJR/pS9qgiiiEaYq1Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736986691; c=relaxed/simple; bh=bVoM5Vp6i9gPiGb2XOHvv3yUthzhNF+zly9zi8mTrBc=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=QBaMhrJOcQ1sOUNM7QVRCQQidqYZ4sY9ErHpdMYJ0HyHBU1Q3rCSqM1cpkeWVshII4vGLxw3qiGVbZw11GPD6tVaVljXtgBKJ7apVKly25abjvUWe8+GMl4JGbFUs7bvCVZLS3K9MIjInAFwHeQXoXBoW78dynKKmB70RSkeaaI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EEZW6b8H; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EEZW6b8H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EF28C4CED1; Thu, 16 Jan 2025 00:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736986690; bh=bVoM5Vp6i9gPiGb2XOHvv3yUthzhNF+zly9zi8mTrBc=; h=Date:From:To:Cc:Subject:From; b=EEZW6b8HcIU8+VjDZ8MzfGtbWRuHNSUxdnX0IvsX80Ik9d5RN66gXA9kBqihantkd dFes9g8JtfHulfP9WvG1VJwS/DOrf6/Z71rEnbcy5zu5NX2vWTV6ODvylPou8K8etz iZwdkeSj77RYBEeXzuZfEhZRmbBTgcaD1jjdM2C+Oaq5poUP9JqcNqJMCEzmyg/5Ql IQcYKOcJIGYZVp5h1JBKeZqSJNY+OuKGHDoGt6rVAes+nUEEk3EukNh6H4IvXwrRJH +BUw8xTohyCpsWy1cQiHcQDwMoaMFMDblwV/pJ8NOCErnKq0Y2uxzakf1npnFYNAnk 5aLWPYc+RPJxw== Date: Wed, 15 Jan 2025 16:18:07 -0800 From: Kees Cook To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Al Viro , Andy Lutomirski , Christian Brauner , =?iso-8859-1?Q?G=FCnther?= Noack , Jeff Xu , Kees Cook , Kees Cook , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Mimi Zohar , =?iso-8859-1?Q?N=EDcolas_F=2E_R=2E_A=2E?= Prado , Paul Moore , Roberto Sassu , Serge Hallyn , Shuah Khan , Stefan Berger Subject: [GIT PULL] AT_EXECVE_CHECK introduction for v6.14-rc1 Message-ID: <202501151612.CE6D0686@keescook> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi Linus, Please pull the AT_EXECVE_CHECK introduction for v6.14-rc1. I split this series from the core execve tree since it's had a life of its own as it has progressed from O_MAY_EXEC. :) This provides userspace with a way to opt in to performing "execability" checks for things that are executable but don't pass through execve(2) (e.g. scripts, dlopen libs, etc). It's seen quite a bit of discussion and review, and has lived in -next for the entire dev cycle. Included is documentation, samples, and extensive selftests. Thanks! -Kees The following changes since commit fac04efc5c793dccbd07e2d59af9f90b7fc0dca4: Linux 6.13-rc2 (2024-12-08 14:03:39 -0800) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git tags/AT_EXECVE_CHECK-v6.14-rc1 for you to fetch changes up to 95b3cdafd7cb74414070893445a9b731793f7b55: ima: instantiate the bprm_creds_for_exec() hook (2024-12-18 17:00:29 -0800) ---------------------------------------------------------------- AT_EXECVE_CHECK introduction for v6.14-rc1 - Implement AT_EXECVE_CHECK flag to execveat(2) (Mickaël Salaün) - Implement EXEC_RESTRICT_FILE and EXEC_DENY_INTERACTIVE securebits (Mickaël Salaün) - Add selftests and samples for AT_EXECVE_CHECK (Mickaël Salaün) ---------------------------------------------------------------- Mickaël Salaün (7): exec: Add a new AT_EXECVE_CHECK flag to execveat(2) security: Add EXEC_RESTRICT_FILE and EXEC_DENY_INTERACTIVE securebits selftests/exec: Add 32 tests for AT_EXECVE_CHECK and exec securebits selftests/landlock: Add tests for execveat + AT_EXECVE_CHECK samples/check-exec: Add set-exec selftests: ktap_helpers: Fix uninitialized variable samples/check-exec: Add an enlighten "inc" interpreter and 28 tests Mimi Zohar (1): ima: instantiate the bprm_creds_for_exec() hook Documentation/userspace-api/check_exec.rst | 144 +++++++ Documentation/userspace-api/index.rst | 1 + fs/exec.c | 20 +- include/linux/binfmts.h | 7 +- include/uapi/linux/audit.h | 1 + include/uapi/linux/fcntl.h | 4 + include/uapi/linux/securebits.h | 24 +- samples/Kconfig | 9 + samples/Makefile | 1 + samples/check-exec/.gitignore | 2 + samples/check-exec/Makefile | 15 + samples/check-exec/inc.c | 205 ++++++++++ samples/check-exec/run-script-ask.inc | 9 + samples/check-exec/script-ask.inc | 5 + samples/check-exec/script-exec.inc | 4 + samples/check-exec/script-noexec.inc | 4 + samples/check-exec/set-exec.c | 85 ++++ security/commoncap.c | 29 +- security/integrity/ima/ima_appraise.c | 27 +- security/integrity/ima/ima_main.c | 29 ++ security/security.c | 10 + tools/testing/selftests/exec/.gitignore | 4 + tools/testing/selftests/exec/Makefile | 19 +- tools/testing/selftests/exec/check-exec-tests.sh | 205 ++++++++++ tools/testing/selftests/exec/check-exec.c | 456 ++++++++++++++++++++++ tools/testing/selftests/exec/config | 2 + tools/testing/selftests/exec/false.c | 5 + tools/testing/selftests/kselftest/ktap_helpers.sh | 2 +- tools/testing/selftests/landlock/fs_test.c | 27 ++ 29 files changed, 1341 insertions(+), 14 deletions(-) create mode 100644 Documentation/userspace-api/check_exec.rst create mode 100644 samples/check-exec/.gitignore create mode 100644 samples/check-exec/Makefile create mode 100644 samples/check-exec/inc.c create mode 100755 samples/check-exec/run-script-ask.inc create mode 100755 samples/check-exec/script-ask.inc create mode 100755 samples/check-exec/script-exec.inc create mode 100644 samples/check-exec/script-noexec.inc create mode 100644 samples/check-exec/set-exec.c create mode 100755 tools/testing/selftests/exec/check-exec-tests.sh create mode 100644 tools/testing/selftests/exec/check-exec.c create mode 100644 tools/testing/selftests/exec/config create mode 100644 tools/testing/selftests/exec/false.c -- Kees Cook