From: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
To: "Masahiro Yamada" <masahiroy@kernel.org>,
"Nathan Chancellor" <nathan@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Willy Tarreau" <w@1wt.eu>,
"Thomas Weißschuh" <linux@weissschuh.net>,
"Brendan Higgins" <brendan.higgins@linux.dev>,
"David Gow" <davidgow@google.com>, "Rae Moar" <rmoar@google.com>,
"Shuah Khan" <shuah@kernel.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Nicolas Schier" <nicolas.schier@linux.dev>
Cc: "Christophe Leroy" <christophe.leroy@csgroup.eu>,
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,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Kees Cook" <kees@kernel.org>,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
"Christian Brauner" <brauner@kernel.org>,
"Jan Kara" <jack@suse.cz>,
linux-mm@kvack.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH v4 06/15] fs,fork,exit: export symbols necessary for KUnit UAPI support
Date: Thu, 26 Jun 2025 08:10:14 +0200 [thread overview]
Message-ID: <20250626-kunit-kselftests-v4-6-48760534fef5@linutronix.de> (raw)
In-Reply-To: <20250626-kunit-kselftests-v4-0-48760534fef5@linutronix.de>
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 <thomas.weissschuh@linutronix.de>
---
To: Kees Cook <kees@kernel.org>
To: Alexander Viro <viro@zeniv.linux.org.uk>
To: Christian Brauner <brauner@kernel.org>
To: Jan Kara <jack@suse.cz>
Cc: linux-mm@kvack.org
Cc: linux-fsdevel@vger.kernel.org
./get_maintainer.pl would have also Cc-ed all of the memory management and
scheduler maintainers. I trimmed the list to only BINFMT/EXEC and VFS.
---
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 <linux/user_events.h>
#include <linux/rseq.h>
#include <linux/ksm.h>
+#include <linux/export.h>
#include <linux/uaccess.h>
#include <asm/mmu_context.h>
@@ -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 <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/fs_parser.h>
+#include <linux/export.h>
/*
* 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 <linux/watch_queue.h>
#include <linux/sysctl.h>
#include <linux/sort.h>
+#include <linux/export.h>
#include <linux/uaccess.h>
#include <asm/ioctls.h>
@@ -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 <linux/user_events.h>
#include <linux/uaccess.h>
#include <linux/pidfs.h>
+#include <linux/export.h>
#include <uapi/linux/wait.h>
@@ -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 <uapi/linux/pidfd.h>
#include <linux/pidfs.h>
#include <linux/tick.h>
+#include <linux/export.h>
#include <asm/pgalloc.h>
#include <linux/uaccess.h>
@@ -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
next prev parent reply other threads:[~2025-06-26 6:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-26 6:10 [PATCH v4 00/15] kunit: Introduce UAPI testing framework Thomas Weißschuh
2025-06-26 6:10 ` Thomas Weißschuh [this message]
2025-07-11 10:35 ` [PATCH v4 06/15] fs,fork,exit: export symbols necessary for KUnit UAPI support Thomas Weißschuh
2025-07-11 15:44 ` Al Viro
2025-07-14 5:52 ` Thomas Weißschuh
2025-07-14 8:12 ` Christian Brauner
2025-07-16 5:30 ` Thomas Weißschuh
2025-07-16 6:21 ` Christoph Hellwig
2025-07-16 8:39 ` Thomas Weißschuh
2025-07-16 11:11 ` Christoph Hellwig
2025-07-16 11:33 ` Thomas Weißschuh
2025-07-16 11:36 ` Christoph Hellwig
2025-07-16 12:47 ` Thomas Weißschuh
2025-07-16 12:57 ` Christoph Hellwig
2025-06-26 6:10 ` [PATCH v4 12/15] kunit: Introduce UAPI testing framework Thomas Weißschuh
2025-06-26 18:11 ` Benjamin Berg
2025-06-27 4:20 ` Thomas Weißschuh
2025-06-27 6:58 ` Benjamin Berg
2025-06-27 8:27 ` Thomas Weißschuh
2025-07-07 18:18 ` [PATCH v4 00/15] " Jonathan Corbet
2025-07-08 5:51 ` Thomas Weißschuh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250626-kunit-kselftests-v4-6-48760534fef5@linutronix.de \
--to=thomas.weissschuh@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=brendan.higgins@linux.dev \
--cc=christophe.leroy@csgroup.eu \
--cc=corbet@lwn.net \
--cc=davidgow@google.com \
--cc=jack@suse.cz \
--cc=kees@kernel.org \
--cc=kunit-dev@googlegroups.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@weissschuh.net \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=nicolas.schier@linux.dev \
--cc=rmoar@google.com \
--cc=shuah@kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=w@1wt.eu \
--cc=workflows@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).