From patchwork Wed Jul 17 21:22:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 13735806 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 24AC8C3DA5D for ; Wed, 17 Jul 2024 21:22:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC6756B00BD; Wed, 17 Jul 2024 17:22:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A75D86B00BE; Wed, 17 Jul 2024 17:22:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 964586B00BF; Wed, 17 Jul 2024 17:22:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 783246B00BD for ; Wed, 17 Jul 2024 17:22:40 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id EB0118102D for ; Wed, 17 Jul 2024 21:22:39 +0000 (UTC) X-FDA: 82350518838.22.F422D47 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id 3AD62180010 for ; Wed, 17 Jul 2024 21:22:36 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hPiqK0nH; spf=pass (imf06.hostedemail.com: domain of kees@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=kees@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721251318; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=hju/OjGAZpcPsyLtCI11VIRKrhykuaqAEg4EJQrwT2w=; b=owlZ2+zTSWGyHj0kOemSrdxYG8VNWMBgZTb3QhWh4NGEiVTViEDTyPVpcJ9zz0zQDuTBQC mkdUGOk3VzP9WjXMcRb8hNSuDCquKIQs/uTL26TEDK14Y5qmsjtL3iEHa+M9TkbqVYQn+0 YLNM/OI+qf/UwkN8XsFlOU0tExCFCRA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721251318; a=rsa-sha256; cv=none; b=8PMQ8ktTMYzYJizIcMvQ8mc7N96j5hb7sae8nTXo2VPIqDek7/uhJVDUcwcISFKd7G/OJy KL1yXyE1BCdANv33XYBwMYdcRJ/BL4Oal2sroaAw7iMzIppACI1nrvcC0S+omJpNKOuoT6 4vtCsCfnXDGv1M968pdR5R6Y+qqwZxA= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hPiqK0nH; spf=pass (imf06.hostedemail.com: domain of kees@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=kees@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 00CF86179D; Wed, 17 Jul 2024 21:22:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99C9DC2BD10; Wed, 17 Jul 2024 21:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721251355; bh=YCziOMnrRecac0Wts4T5B9xkrgY8ubZsqNRaZ+L02IM=; h=From:To:Cc:Subject:Date:From; b=hPiqK0nH3OOxE+BYCcq+liH41hELurgeXzrpbUs2wQWZZYR+wUv1tt4aDnMwphmkD vGpAnE4YnT17aJa7Xup93Fjuk3kXMTTJXcoql2dn36CzLzMwIxavTqZTBHLk6sgs1B cV0/6IB5cZ720Afe8C5+rNM67coZd6jLwoDKYc/EYX6eeH67iAQimrFNTzk1DsQTq1 PiRIELvK3ZGrgAbXErVr6aHlSy7S5+L1IlLtz9mjuETHKi/ORbaHxuGGRmtlml4g2t rphNIfy9BlLPmgzJpFditPs2Z+9xHxeLj5OW1OoXWbjolRqUF/xvYYLcjJjz7XQUeg 6lDn5k/7jHCkg== From: Kees Cook To: Al Viro Cc: Kees Cook , Christian Brauner , Jan Kara , Eric Biederman , David Gow , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH] execve: Move KUnit tests to tests/ subdirectory Date: Wed, 17 Jul 2024 14:22:34 -0700 Message-Id: <20240717212230.work.346-kees@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2666; i=kees@kernel.org; h=from:subject:message-id; bh=YCziOMnrRecac0Wts4T5B9xkrgY8ubZsqNRaZ+L02IM=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBmmDYZ6lDl5Gdke5gK3g98RQwDevl2XHLN5auYZ rOolZfBf+SJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCZpg2GQAKCRCJcvTf3G3A Jo5VD/4nuVehBFuUbkYqfQGY4HxiAjH4wfC4/6lz+8Gr0mjWcIW22a+0bAEvrRJwzZB3Fo9QpGj MrAz30BLnnPAiBoZN9CIIHvH7Tbf5Kh/SuM1argM5qWeIRTD+nknPrHXdzwjnJazxscwrFkbaYz AVS2gNRdyVQu5o/WzCI52LMbb5iufVAl9qw5lyRzafPdemarOnMY83PBW78QbtE/uLEgD6lAiXH v/AbU79a9sfHe6A/KqGTDBSqhIqrCTvrDZtVKFUlkE8roM8vNrwmvDEUIzZbV/kvJkCXkDeR78j nod8sItmsa9IoHBkPLharsn+j/c8aOv6+78QpRxoYjEuwxwpd9V4GYMsgSS8zHZ8FFqx8DvXMcs jYyqnW7L3fsQPPU6Qnjv87n/+hp1bvWxoc/9H5AIDWlkVtl2o/8TbMPvdbm7D0nTJ2S0hw3CNM8 Hm/X/YeAqVq4etWd9nKLDlUiFkxxL7feH0jSmDvPX7YV3YLdoD1bbmmuPEL8Rfg+BYcVDepxXAP 8VtDg1SSdCqXKGIOYlSUdWyhh9RXEc4EuAmg0exB3OkIf5WIrTpBH798v/wO2yPzlY/ID9b7DPt ge9lWXiWPfBf3oMydJaTtkaag3C3hUflMIwRHLs1P4EVCYEY3ZX2DMx6pe79y7HpmFUuYTuXkEI p2cpJ 7ub3cWrs Bw== X-Developer-Key: i=kees@kernel.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 X-Rspamd-Queue-Id: 3AD62180010 X-Stat-Signature: ntauoy1cosqs5y6mucj71c4mdpmh58hq X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1721251356-910262 X-HE-Meta: U2FsdGVkX19vYPSgbJPJNY77+x4+nNsVWcrHXIV9Zc7dH4OJGxwcU3zUzPOHnhLTkiB6uQwehwVdH7zLgtKMGCSKa6XJrZJVc3LONDmgLpmvTe5dcjNo32J9j75xG4Lg5MpML5tlDzjvHNtC1Xx4PBvRpSi8izMC0A3BWI1h+CHNjVUmEefEkauvSbSy/lUTJGCnBLRf92PTyzS6ZzcbZCDjrIzMC1BM5ZSRRzI5KHlu5LsCmJPYAYkI3oF97+zUu+DJJkUQWl4PsoKFMsjszhq9m6T5yUCV4xQaUiSeTqPU17LqvaRMLx4NOIxkjQIcWENvL0mScy/dxha7YBl+X9gpl6lwoW9Gg0oCSrsFML94IzTwYwfjQjtelETWfhBOTH7YJIJHJa1HJOGV6YT4QC5To/YwvXDPKfk/UEcMRC1Z9w9QbNVi8EACGMdqgJkN3+W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9sfprEjKF3/0eZsTw46w== 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: Move the exec KUnit tests into a separate directory to avoid polluting the local directory namespace. Additionally update MAINTAINERS for the new files and mark myself as Maintainer. Signed-off-by: Kees Cook Reviewed-by: David Gow Reviewed-by: SeongJae Park --- I'll toss this into -next and send it to Linus before -rc1 closes. --- Cc: Alexander Viro Cc: Christian Brauner Cc: Jan Kara Cc: Eric Biederman Cc: David Gow Cc: Linus Torvalds Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org --- MAINTAINERS | 5 +++-- fs/binfmt_elf.c | 2 +- fs/exec.c | 2 +- fs/{ => tests}/binfmt_elf_test.c | 0 fs/{ => tests}/exec_test.c | 0 5 files changed, 5 insertions(+), 4 deletions(-) rename fs/{ => tests}/binfmt_elf_test.c (100%) rename fs/{ => tests}/exec_test.c (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 8dfbe998f175..35474718c05b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8211,8 +8211,8 @@ S: Maintained F: rust/kernel/net/phy.rs EXEC & BINFMT API, ELF +M: Kees Cook R: Eric Biederman -R: Kees Cook L: linux-mm@kvack.org S: Supported T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/execve @@ -8220,7 +8220,8 @@ F: Documentation/userspace-api/ELF.rst F: fs/*binfmt_*.c F: fs/Kconfig.binfmt F: fs/exec.c -F: fs/exec_test.c +F: fs/tests/binfmt_*_test.c +F: fs/tests/exec_test.c F: include/linux/binfmts.h F: include/linux/elf.h F: include/uapi/linux/binfmts.h diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 40111451aa95..1a032811b304 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -2152,5 +2152,5 @@ core_initcall(init_elf_binfmt); module_exit(exit_elf_binfmt); #ifdef CONFIG_BINFMT_ELF_KUNIT_TEST -#include "binfmt_elf_test.c" +#include "tests/binfmt_elf_test.c" #endif diff --git a/fs/exec.c b/fs/exec.c index 5b580ff8d955..5a59063c50b1 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -2244,5 +2244,5 @@ fs_initcall(init_fs_exec_sysctls); #endif /* CONFIG_SYSCTL */ #ifdef CONFIG_EXEC_KUNIT_TEST -#include "exec_test.c" +#include "tests/exec_test.c" #endif diff --git a/fs/binfmt_elf_test.c b/fs/tests/binfmt_elf_test.c similarity index 100% rename from fs/binfmt_elf_test.c rename to fs/tests/binfmt_elf_test.c diff --git a/fs/exec_test.c b/fs/tests/exec_test.c similarity index 100% rename from fs/exec_test.c rename to fs/tests/exec_test.c