From patchwork Sat Jul 20 17:03:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 13737852 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 E1A12C3DA49 for ; Sat, 20 Jul 2024 17:03:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 329C66B0083; Sat, 20 Jul 2024 13:03:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D73F6B0085; Sat, 20 Jul 2024 13:03:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1ED196B0088; Sat, 20 Jul 2024 13:03:26 -0400 (EDT) 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 020D06B0083 for ; Sat, 20 Jul 2024 13:03:25 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8F689160DA0 for ; Sat, 20 Jul 2024 17:03:25 +0000 (UTC) X-FDA: 82360751970.11.82E5AA5 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id DFA80180009 for ; Sat, 20 Jul 2024 17:03:22 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=B5Dg2ad4; 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=1721494981; 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=DD8blc4Dkr/fYQQNLmQe/HMzDFBGrDfuo0usIl3QQsQ=; b=JmLvm4aWnjFViPbRUVBOKSQNspmSTWAskJhr+dgI20zavBBIFWpjEpUsjKi3Q8fSmvNzFD 3F26OJnPjkgXpm11S5t19g49Qfkcw7g1nq64BSN45a44++hOIovCxk3se5mNa8+cbz47IW EkCPNodiWw3hkNJqmxaacfrMk6XYq0Q= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=B5Dg2ad4; 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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721494981; a=rsa-sha256; cv=none; b=Ugz7VlgvihUJqWm5J3QiMzkOBJl8Wywxtqd+5w7RgGHwJ1u5LKdsoiE0EVvlxSsMRy+7pI icAn6/oEeMMUg+LQHgCrHcIl9DxK07KIcFB3tBgwQTzMTafbH5RQy+BxfkWKrN0eWmE/It A3EfwhLfLQmHUu/WkzJCQ7VJrImRleE= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0257660DDD; Sat, 20 Jul 2024 17:03:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 906AAC2BD10; Sat, 20 Jul 2024 17:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721495001; bh=qEBnWjm61+wRL7eX7/aXBBow1IWLbMAFODhMXVKb66I=; h=From:To:Cc:Subject:Date:From; b=B5Dg2ad45KT0c+aLELUY73/HAtGV0LUyYyyCQIQ3V5vKWqEBuJRiSwzZPKphZ8kDf LUTypv8n6DiTx3KaCR5g2IJTlWyZL6pnooxye/0914n+njnCfySNckMHTGQzhH0Ykc lcLSzJs/UNhb/c0y01zlLq7scJY6Lw7mOlkFOwxa3P3qpF3uvpaZl+7Io1UtJ9r7m/ 1c2CuB1dFir4cbRnNR4/Ak76nHilJIBzzFVATVlphDB5P+ipa2B33tLaq2NTQ1NuxZ Ph8ZKkPWLHWL5EKhIf2KbDRLs+3KK5igy+9nqo6ojGudBfmeOTRYII4bMuINJBtBaU qYiU9oEYJ7H6g== From: Kees Cook To: Al Viro , David Gow Cc: Kees Cook , SeongJae Park , Christian Brauner , Jan Kara , Eric Biederman , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH v2] execve: Move KUnit tests to tests/ subdirectory Date: Sat, 20 Jul 2024 10:03:14 -0700 Message-Id: <20240720170310.it.942-kees@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3013; i=kees@kernel.org; h=from:subject:message-id; bh=qEBnWjm61+wRL7eX7/aXBBow1IWLbMAFODhMXVKb66I=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBmm+3S2HZ6G04SOgBaf9X+62wdW1PD/xOdySwpS zQvUQDcMn+JAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCZpvt0gAKCRCJcvTf3G3A Jk8QD/9EfZpLg6iOLyQ4Dg0xACvfCEXKq8zLBTn5Sh9/QL/0sd8qANQ55YcNuTTD3do7gY4l/5o Lgn+SdVj8xHwDsXIK98k6PoACOa/7dZ7Rq4cvx1233JcgD3eDpLtzwPNFDJcimcJuRpKs/pW70H mVtZrQ1Cp6W2ZgJ4+eZVcdgPzpMxXO5ZjjW6GKLBmPiWjRV3aNb4Cn38AgsPqYas1TZE1yJWUUm pX0lOBLLN18y58UYvdy6A4jY/skZkawIYztFytr0fga81BmBsXR11I9nvliTk9RhulTAC2jTnP3 maMlJyJ0p5GYOBSgbZV05eTSDLP6xyP6bbx6325savLbu8W6vxSPVJckOczUvxpriqgJFsm/UyO eWWhPztdKnIKoxk/3uBp7wYVuW6jVSwf/fsflkwrb4OKILlvjAcSTNGR5v/6FFksKdezaNLgEaT pS6CNIGNR22/jw0bQrqhZW9Plu/86CKiMIR7191iWXyjXW/VMae3BaZmxm4kzilxGx7vtKP4pQx OUF7/8PbLayR8SqOxLnrKuxAX8PPPTC74Owm58xFDolw/EWCaawCqHgTtW6NOjI0CZQyaB1GcHE /b//nIoqUUnghDoQmFjGt8Ezcgru1hFOD8N7N+YMWLtRiaIXwoq9MqXGruulHNnE6YKdsGDvZCc kOW46 yLGjK8GP kg== X-Developer-Key: i=kees@kernel.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: DFA80180009 X-Stat-Signature: wtzkx1c5wueqhncjo63k868fh4j58oce X-Rspam-User: X-HE-Tag: 1721495002-636902 X-HE-Meta: U2FsdGVkX19TPkbFWe0DMpV2ONQKL3zNhli122jjqduDy1uGCB9rTyAIz+pR/DoWXtR/xPrPekfQHfRzQ5Jp1Q9Gp0dOTHVML2XFmbq/ef817+T7R8/sJEiOIblaSkh+rxMsT9uYjsJf1wUb47DdFzWRv4QRHz/jaDirfxK/ZtyNLYs1cJh4qM8ywrjps9wIFwRHnwLl1+67bXkvW4c9FrIXTROnJZZz26uhXdmkXsV69NSdS9plvGDBwTXVNHV7bvOBI3WvURSwGbEbqcQD9820qEnn0Kdf7V6qrIbMuPdHeMemyhL4+V9+U9NZcuwzQXaCC/UQgczLtp0R+xgT6g/c8vo2j019z0Wn9OfgeuQTc4i/tmivRNx7C7ivRdbgcDNYF4gvLEIMsYGLHhpoDvWWig85QVwffF4NIPiaOIPmiEemHI8n7gDvf2kI0v1ckMZ6/SU5JMr+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mIRGbwXBUssAGjdsYN7UjGBvh4vo5A== 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. Reviewed-by: David Gow Reviewed-by: SeongJae Park Signed-off-by: Kees Cook Acked-by: Christian Brauner --- v1: https://lore.kernel.org/lkml/20240717212230.work.346-kees@kernel.org/ v2: file suffix changed to _kunit instead of _test I'll toss this into -next and send it to Linus before -rc1 closes. --- Cc: David Gow Cc: Alexander Viro Cc: Christian Brauner Cc: Jan Kara Cc: Eric Biederman 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/{binfmt_elf_test.c => tests/binfmt_elf_kunit.c} | 0 fs/{exec_test.c => tests/exec_kunit.c} | 0 5 files changed, 5 insertions(+), 4 deletions(-) rename fs/{binfmt_elf_test.c => tests/binfmt_elf_kunit.c} (100%) rename fs/{exec_test.c => tests/exec_kunit.c} (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 8dfbe998f175..396bd1f1e4b9 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_*_kunit.c +F: fs/tests/exec_kunit.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..04e748c5955f 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_kunit.c" #endif diff --git a/fs/exec.c b/fs/exec.c index 5b580ff8d955..32d6537ece07 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_kunit.c" #endif diff --git a/fs/binfmt_elf_test.c b/fs/tests/binfmt_elf_kunit.c similarity index 100% rename from fs/binfmt_elf_test.c rename to fs/tests/binfmt_elf_kunit.c diff --git a/fs/exec_test.c b/fs/tests/exec_kunit.c similarity index 100% rename from fs/exec_test.c rename to fs/tests/exec_kunit.c