From mboxrd@z Thu Jan 1 00:00:00 1970 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 9528DC83F22 for ; Thu, 17 Jul 2025 08:49:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A1118D000E; Thu, 17 Jul 2025 04:49:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B4BE8D0008; Thu, 17 Jul 2025 04:49:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E0E18D000D; Thu, 17 Jul 2025 04:49:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 2ED118D0008 for ; Thu, 17 Jul 2025 04:49:00 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 07EA5160562 for ; Thu, 17 Jul 2025 08:49:00 +0000 (UTC) X-FDA: 83673131640.09.5A059E8 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf30.hostedemail.com (Postfix) with ESMTP id 25C3280004 for ; Thu, 17 Jul 2025 08:48:57 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=d8oTzFqJ; dkim=pass header.d=linutronix.de header.s=2020e header.b=HZ6uFZe1; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf30.hostedemail.com: domain of t-8ch@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=t-8ch@linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1752742138; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7MpYHuvMjFWWKu6Z/zYB3Mv8gm+e0pCu+LkUQrZSY3U=; b=BByc3jlSpfJOICEy3D6MQY92S3wba9WJ97GjGdqyUJauYkO/VApT7hrFUU3p43PpVg9cSK EHoiego7lW5H80DR1p2WRIULHr7wcA16dHOxHsaucdbF+OhQCorQlGQ2xoUhVT1og2pxjy BDC3ywq0wEi8b9uJaLAhL7zW9GV4Xug= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1752742138; a=rsa-sha256; cv=none; b=FgpVB8ix5knBCJfQiqw3Af8wxWyZliSdsG1PByX5Ic3n9a8TFOA7QyHIogRB5RUtlgpAKr ceUygUp+DzTIFZgrtPkZu7yNBn2fHba8ZQQ3ge2qjE68YsFKf+dhQGBIbBw7seNWobzkgM Vk8TGZSjAh4BDHDZrtMB+mFJqFar74s= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=d8oTzFqJ; dkim=pass header.d=linutronix.de header.s=2020e header.b=HZ6uFZe1; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf30.hostedemail.com: domain of t-8ch@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=t-8ch@linutronix.de From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1752742135; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7MpYHuvMjFWWKu6Z/zYB3Mv8gm+e0pCu+LkUQrZSY3U=; b=d8oTzFqJXGnBOvO4zb6cDa5rul2gJUTTSkcahTe/BRpx/iywuRWwT4xroLXY6VNdnh3QZO RHV/IsU6AgdRkJxSFPZ7vIZP6F6jO33pX5kuHPHJGKUTJZYBPdGiDBtIJ/XHMAGEm/x4s2 ywLUAaHuzknRTE+wI83TTNrERZ7Rl1Ved/qv0OIMfaJd8jW9PdCqSZ9lR5xkQZZzGwVy2y n1fL3jCk/xaG/3+VrkeFrvHhEMimW3KwNzytnF1TI0iPHaKMHAL5z7oBRJSv9QM/cxO9q8 MPecXmf0A+I+NgNkN0GmLg8gxNIvH46QRwHVzubjmX+YMeVg9WnQ/9nUqa0oxA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1752742135; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7MpYHuvMjFWWKu6Z/zYB3Mv8gm+e0pCu+LkUQrZSY3U=; b=HZ6uFZe1pV6FRTSkcaX2SUoimPLdA9eDlpPYStwgYkLBSXHxZvPT4cQryUWLjvl4xnegwW BtIPfJ3KSAFlMtAg== Date: Thu, 17 Jul 2025 10:48:08 +0200 Subject: [PATCH v5 06/15] fs,fork,exit: export symbols necessary for KUnit UAPI support MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20250717-kunit-kselftests-v5-6-442b711cde2e@linutronix.de> References: <20250717-kunit-kselftests-v5-0-442b711cde2e@linutronix.de> In-Reply-To: <20250717-kunit-kselftests-v5-0-442b711cde2e@linutronix.de> To: Masahiro Yamada , Nathan Chancellor , Andrew Morton , Willy Tarreau , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Brendan Higgins , David Gow , Rae Moar , Shuah Khan , Jonathan Corbet , Nicolas Schier , Kees Cook , Alexander Viro , Christian Brauner , Jan Kara , Christoph Hellwig , Luis Chamberlain Cc: Christophe Leroy , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, workflows@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Nicolas Schier X-Developer-Signature: v=1; a=ed25519-sha256; t=1752742130; l=4941; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=e5INoDiN3Ni8QRATpOXYa4LnNZtNpkknNpkiBqwwmSY=; b=wfPAfz0Y4PnhHoB3TtD/RceiqTS+353VN2/ItMuXvqsLsEeUYNcSU3SR921UGRtIT0MxXYMPk 5poxQGlxv/wBEgVJPydBHOSY4lgE3Iw4v8Bg9/g2pPQIzqWk9ZPNFN8 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= X-Rspamd-Queue-Id: 25C3280004 X-Stat-Signature: cgjikr6dxjdwyriwzurqwng3jsz5zchs X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1752742137-911164 X-HE-Meta: U2FsdGVkX18fpH1TYddKhfLjrRwfkpTGWhdBsr8rp8gPjVgLLZ7SzXHkSM5QuWjH3bAeagqAxbCinuZYD1TN/C3BBhClTL4iJqxa+Ha18yd65UmPVmWqvMiPfFTioRZ5kCtEFE+g4wTsJfyh1gP7nWi05W1WyoHjv/kGIny9GxQPAe4MOU3RB4UrRWDCDkEdJlfhLdmDK+LbAs98IBACdz7+xF3mfRFwqfgpdGjXI6HDqag+vaIQ3bVZ5IK81DPw6N7565bpiFlvPF6/tJmj5HF8rM8DYEnIlZq9keVaGsTWSKkVUoqOhiOyen6NttZNmSAI2IC8Bw75AokS7PqQHTkAl/45vZEqrhSUwSHmHaPmkck54xiY5DZuVcKKpAJ+RJP4lpwLF6exNds7zEZ2zRbZ6IdTOescZf4W+GIy+HX4ryxgfe6ImUtxt+D9Xge2KA1CYa07+aDHIyHQLdS+NxFOZ4P2IxBCsqf9FEmwCUoySDaRl7sFECfHg7+KrQUqXmpD6BaFT8F3XIJizY9G6Z0J/jGIY/+hzSbXSg1gEPl88UIivLEfTeIyrifptztpU63Ps+LAbYwEZ5ci41gwsSPS/OCMMhFDn2FeQ7acdSnomYQwqW2Y5LhTCvgOhck85Dle3KGmYcIBDEheZ6dU/qed1bYzAAvWWlVuWK1/dMwyNjktRgt3s2LJ/zo6vQnC4wBSvAQ0BmliN5/oMlnZnYIzuCTFd9ISS5x6moUBm55n2pzq7GtobHs1H5w4DFX3SnbS6Hanz3+MbFXYhD7+Rbnelv0R8d2T5RvW8C33NGemtFe1rHKulGwKMOMjuqO3cwvrCItgZ+oM6MpOjEqutuHFX9nAfKGZl3h2soxKlqeeDC+jUDXWj68w5lXA8oqyybPwKgnjocp4B8DNlOS6s4iw5IHVrY4Mc3o8/2IcXsvZL1b40u+j+azfVoGo09FJYZgMPnkzD3vb+4LWu8H 4I2TLEcI bWNG9bpo/dKvxUR07NEv9fRyZpdJRB4grYRPnPlemk35Atrq5yD1nRb2qWVxLA30XQ65xyMgqZ0iXuublx4l3fF35Q8TJP7a683bNPuT94BRdJV4ii75HUru9TGCJru5AlweAszhRKhdUubxP4Fulfb6/Gxpoobfuq8wvqdGH1heDyh6baz36EXl5TiO1oSwUeOKDSZ+lQ67QT9mvO7+bkH8PBjZnpfcbBOUOyoTZB9fZZmUBpdZHibzA8eQfEIZOeBjBg3921wIZOt+q5YqAT34OlgVcs8we9S8KEiww37QXkEmXiRMcyySeCA66AF5PFdUMuHbTqWYlVS7ZZyuvhXxutATLIxJBJvcQw1X6K0l+BgXiXgJbdaVeeEY4Aja4YgN3kypWS6WiSksam60fMHmJkuaZ1pnjO2drq2bwPqc6nKUxJddyC1rgFkZG7Q62kEdc1NacQLoVopSftpUCfHzyAjLL10/kfc3qfK/JQD4qcEPOYB/PwgF12G+oyMQExsrV 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: The KUnit UAPI infrastructure starts userspace processes. As it should be able to be built as a module, export the necessary symbols. Signed-off-by: Thomas Weißschuh --- For details on how these are used, see patch 12: "kunit: Introduce UAPI testing framework". Any ideas on how to make this work without new exports are very welcome. --- fs/exec.c | 2 ++ fs/file.c | 1 + fs/filesystems.c | 2 ++ fs/fs_struct.c | 1 + fs/pipe.c | 2 ++ kernel/exit.c | 3 +++ kernel/fork.c | 2 ++ 7 files changed, 13 insertions(+) diff --git a/fs/exec.c b/fs/exec.c index 1f5fdd2e096e392b342f122d35aba4cf035441c7..13f7f27641942eddcb179bdd93d99b799d155813 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -68,6 +68,7 @@ #include #include #include +#include #include #include @@ -1919,6 +1920,7 @@ int kernel_execve(const char *kernel_filename, putname(filename); return retval; } +EXPORT_SYMBOL_GPL_FOR_MODULES(kernel_execve, "kunit-uapi"); static int do_execve(struct filename *filename, const char __user *const __user *__argv, diff --git a/fs/file.c b/fs/file.c index 3a3146664cf37115624e12f7f06826d48827e9d7..89d07feb9c328337451ce40cb0f368b6cb986c2c 100644 --- a/fs/file.c +++ b/fs/file.c @@ -1317,6 +1317,7 @@ int replace_fd(unsigned fd, struct file *file, unsigned flags) spin_unlock(&files->file_lock); return err; } +EXPORT_SYMBOL_GPL_FOR_MODULES(replace_fd, "kunit-uapi"); /** * receive_fd() - Install received file into file descriptor table diff --git a/fs/filesystems.c b/fs/filesystems.c index 95e5256821a53494d88f496193305a2e50e04444..a3a588f387bbd8268246d1026389deaadf265d0b 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c @@ -17,6 +17,7 @@ #include #include #include +#include /* * Handling of filesystem drivers list. @@ -45,6 +46,7 @@ void put_filesystem(struct file_system_type *fs) { module_put(fs->owner); } +EXPORT_SYMBOL_GPL_FOR_MODULES(put_filesystem, "kunit-uapi"); static struct file_system_type **find_filesystem(const char *name, unsigned len) { diff --git a/fs/fs_struct.c b/fs/fs_struct.c index 64c2d0814ed6889cc12603410e6e9dc44089586f..26340d225deba3f2ec30252293fdf417235a6a4a 100644 --- a/fs/fs_struct.c +++ b/fs/fs_struct.c @@ -46,6 +46,7 @@ void set_fs_pwd(struct fs_struct *fs, const struct path *path) if (old_pwd.dentry) path_put(&old_pwd); } +EXPORT_SYMBOL_GPL_FOR_MODULES(set_fs_pwd, "kunit-uapi"); static inline int replace_path(struct path *p, const struct path *old, const struct path *new) { diff --git a/fs/pipe.c b/fs/pipe.c index 45077c37bad154ef146b047834d35d489fcc4d8d..d6cb743d2cfc041f08b498a5a764e9a96dc34069 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -971,6 +972,7 @@ int create_pipe_files(struct file **res, int flags) file_set_fsnotify_mode(res[1], FMODE_NONOTIFY_PERM); return 0; } +EXPORT_SYMBOL_GPL_FOR_MODULES(create_pipe_files, "kunit-uapi"); static int __do_pipe_flags(int *fd, struct file **files, int flags) { diff --git a/kernel/exit.c b/kernel/exit.c index bd743900354ca5fc6c550f80e30393a632eb9a4e..610dffb1276ac60b475708587ca053f315fea9c3 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -70,6 +70,7 @@ #include #include #include +#include #include @@ -1005,6 +1006,7 @@ void __noreturn do_exit(long code) lockdep_free_task(tsk); do_task_dead(); } +EXPORT_SYMBOL_GPL_FOR_MODULES(do_exit, "kunit-uapi"); void __noreturn make_task_dead(int signr) { @@ -1887,6 +1889,7 @@ int kernel_wait(pid_t pid, int *stat) put_pid(wo.wo_pid); return ret; } +EXPORT_SYMBOL_GPL_FOR_MODULES(kernel_wait, "kunit-uapi"); SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr, int, options, struct rusage __user *, ru) diff --git a/kernel/fork.c b/kernel/fork.c index 1ee8eb11f38bae1d2eb6de9494aea94b7a19e6c3..5de7a9bc005ade6dcfbdfe1a63cadbef8782658c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -105,6 +105,7 @@ #include #include #include +#include #include #include @@ -2676,6 +2677,7 @@ pid_t user_mode_thread(int (*fn)(void *), void *arg, unsigned long flags) return kernel_clone(&args); } +EXPORT_SYMBOL_GPL_FOR_MODULES(user_mode_thread, "kunit-uapi"); #ifdef __ARCH_WANT_SYS_FORK SYSCALL_DEFINE0(fork) -- 2.50.0