From: Helge Deller <deller@kernel.org>
To: qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@gmail.com>
Cc: "Yoshinori Sato" <yoshinori.sato@nifty.com>,
"Cédric Le Goater" <clg@redhat.com>,
"Helge Deller" <deller@gmx.de>,
"Laurent Vivier" <laurent@vivier.eu>,
"Matt Turner" <mattst88@gmail.com>,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>
Subject: [PULL 2/3] linux-user: fix guards for the fsmount(2) syscall series
Date: Tue, 28 Jul 2026 11:16:32 +0200 [thread overview]
Message-ID: <20260728091633.29765-3-deller@kernel.org> (raw)
In-Reply-To: <20260728091633.29765-1-deller@kernel.org>
From: Matt Turner <mattst88@gmail.com>
The fsopen(), fsconfig(), fsmount() and fspick() implementations are
guarded by defined(NR_fsopen) rather than defined(__NR_fsopen). No such
macro exists, so the guard is never true and the entire series compiles
out. Guests calling any of the four get -ENOSYS, which for example makes
systemd's credential setup fail with EXIT_CREDENTIALS for most units.
The strace bits for fsconfig() have the same typo.
Check if FSCONFIG_SET_FLAG is defined to avoid build errors in the strace
code on some older distributions (Helge).
Fixes: 767c32fe6983 ("linux-user: implement fsmount(2) series of syscalls")
Fixes: 6e0aa9f6c731 ("linux-user/strace: add fsmount series of syscalls")
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Helge Deller <deller@gmx.de>
Signed-off-by: Helge Deller <deller@gmx.de>
---
linux-user/strace.c | 2 +-
linux-user/strace.list | 2 +-
linux-user/syscall.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/linux-user/strace.c b/linux-user/strace.c
index 3a81cc95f4..bc43a95a77 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -4344,7 +4344,7 @@ print_statx(CPUArchState *cpu_env, const struct syscallname *name,
}
#endif
-#if defined(TARGET_NR_fsconfig) && defined(NR_fsconfig)
+#if defined(TARGET_NR_fsconfig) && defined(__NR_fsconfig) && defined(FSCONFIG_SET_FLAG)
static void
print_fsconfig_cmd_name(int cmd)
{
diff --git a/linux-user/strace.list b/linux-user/strace.list
index e363892e0a..25ace05187 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -1725,7 +1725,7 @@
#ifdef TARGET_NR_fsopen
{ TARGET_NR_fsopen, "fsopen", "%s(%s,%d)", NULL, NULL },
#endif
-#if defined(TARGET_NR_fsconfig) && defined(NR_fsconfig)
+#if defined(TARGET_NR_fsconfig) && defined(__NR_fsconfig) && defined(FSCONFIG_SET_FLAG)
{ TARGET_NR_fsconfig, "fsconfig", NULL, print_fsconfig, NULL },
#endif
#ifdef TARGET_NR_fsmount
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 3da5530d42..740142825d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9740,7 +9740,7 @@ _syscall5(int, sys_move_mount, int, __from_dfd, const char *, __from_pathname,
int, __to_dfd, const char *, __to_pathname, unsigned int, flag)
#endif
-#if defined(TARGET_NR_fsopen) && defined(NR_fsopen)
+#if defined(TARGET_NR_fsopen) && defined(__NR_fsopen)
#define __NR_sys_fsopen __NR_fsopen
_syscall2(int, sys_fsopen, const char *, fs_name, unsigned int, flags);
#define __NR_sys_fsconfig __NR_fsconfig
@@ -14485,7 +14485,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
return do_map_shadow_stack(cpu_env, arg1, arg2, arg3);
#endif
-#if defined(TARGET_NR_fsopen) && defined(NR_fsopen)
+#if defined(TARGET_NR_fsopen) && defined(__NR_fsopen)
case TARGET_NR_fsopen:
{
p = lock_user_string(arg1);
--
2.54.0
next prev parent reply other threads:[~2026-07-28 9:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 9:16 [PULL 0/3] Linux user patches Helge Deller
2026-07-28 9:16 ` [PULL 1/3] linux-user: Guard local FUTEX_CMD_MASK definition Helge Deller
2026-07-28 9:16 ` Helge Deller [this message]
2026-07-28 9:16 ` [PULL 3/3] linux-user/sh4: allow full 32-bit address space Helge Deller
2026-07-28 15:31 ` [PULL 0/3] Linux user patches Stefan Hajnoczi
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=20260728091633.29765-3-deller@kernel.org \
--to=deller@kernel.org \
--cc=clg@redhat.com \
--cc=deller@gmx.de \
--cc=laurent@vivier.eu \
--cc=mattst88@gmail.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=yoshinori.sato@nifty.com \
/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