git: 2aa874ba94b4 - main - linux: Pass a valid thread pointer to linux_msg()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 22 Nov 2026 17:41:29 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=2aa874ba94b466a08806ff08018696d4669c338a
commit 2aa874ba94b466a08806ff08018696d4669c338a
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-11-22 15:37:35 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-11-22 17:41:07 +0000
linux: Pass a valid thread pointer to linux_msg()
linux_msg() will dereference that pointer if a debugging flag is set.
Reported by: Tianyi Chen <hi@tychen.cc>
Fixes: 3965de642c29 ("linux: Add inotify support")
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
---
sys/compat/linux/linux_file.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 851064537b39..6a6e8bbd1cb7 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -1958,13 +1958,12 @@ linux_writev(struct thread *td, struct linux_writev_args *args)
}
static int
-linux_inotify_init_flags(int l_flags)
+linux_inotify_init_flags(struct thread *td, int l_flags)
{
int bsd_flags;
if ((l_flags & ~(LINUX_IN_CLOEXEC | LINUX_IN_NONBLOCK)) != 0)
- linux_msg(NULL, "inotify_init1 unsupported flags 0x%x",
- l_flags);
+ linux_msg(td, "inotify_init1 unsupported flags 0x%x", l_flags);
bsd_flags = 0;
if ((l_flags & LINUX_IN_CLOEXEC) != 0)
@@ -1979,7 +1978,7 @@ inotify_init_common(struct thread *td, int flags)
{
struct specialfd_inotify si;
- si.flags = linux_inotify_init_flags(flags);
+ si.flags = linux_inotify_init_flags(td, flags);
return (kern_specialfd(td, SPECIALFD_INOTIFY, &si));
}
@@ -2055,7 +2054,7 @@ linux_inotify_add_watch(struct thread *td,
struct linux_inotify_add_watch_args *args)
{
if ((args->mask & ~(LINUX_IN_ALL_EVENTS | LINUX_IN_ALL_FLAGS)) != 0) {
- linux_msg(NULL, "inotify_add_watch unsupported flags 0x%x",
+ linux_msg(td, "inotify_add_watch unsupported flags 0x%x",
args->mask);
return (EINVAL);
}