git: 33d9fbf5f953 - main - linuxulator: Accept 0 as signal in rt_sigqueueinfo

From: Ryan Moeller <rmoeller_at_FreeBSD.org>
Date: Tue, 13 Oct 2026 16:44:01 UTC
The branch main has been updated by rmoeller:

URL: https://cgit.FreeBSD.org/src/commit/?id=33d9fbf5f95301f6eefbbf7e7fd49b4e9c098919

commit 33d9fbf5f95301f6eefbbf7e7fd49b4e9c098919
Author:     Ryan Moeller <rmoeller@FreeBSD.org>
AuthorDate: 2026-10-13 16:42:45 +0000
Commit:     Ryan Moeller <rmoeller@FreeBSD.org>
CommitDate: 2026-10-13 16:42:45 +0000

    linuxulator: Accept 0 as signal in rt_sigqueueinfo
    
    Linux allows 0 as a signal for rt_sigqueueinfo(2) the same as it does
    for kill(2).  This is used to check for process existence and
    permissions.
    
    Allow this value through as a special case in linux_rt_siqgueueinfo the
    same way as was done for linux_kill.
    
    Before this change, lio_listio(3) would fail with EINVAL under
    Linuxulator.  Now it is functional.
    
    MFC after:      1 week
    Reviewed by:    kevans
    Approved by:    kevans (mentor)
    Differential Revision:  https://reviews.freebsd.org/D60574
---
 sys/compat/linux/linux_signal.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c
index c247a5eb67cf..3f1596321042 100644
--- a/sys/compat/linux/linux_signal.c
+++ b/sys/compat/linux/linux_signal.c
@@ -822,7 +822,10 @@ linux_rt_sigqueueinfo(struct thread *td, struct linux_rt_sigqueueinfo_args *args
 	int error;
 	int sig;
 
-	if (!LINUX_SIG_VALID(args->sig))
+	/*
+	 * Allow signal 0 as a means to check for privileges
+	 */
+	if (!LINUX_SIG_VALID(args->sig) && args->sig != 0)
 		return (EINVAL);
 
 	error = copyin(args->info, &linfo, sizeof(linfo));
@@ -833,7 +836,11 @@ linux_rt_sigqueueinfo(struct thread *td, struct linux_rt_sigqueueinfo_args *args
 		/* SI_USER, SI_KERNEL */
 		return (EPERM);
 
-	sig = linux_to_bsd_signal(args->sig);
+	if (args->sig > 0)
+		sig = linux_to_bsd_signal(args->sig);
+	else
+		sig = 0;
+
 	ksiginfo_init(&ksi);
 	error = lsiginfo_to_siginfo(td, &linfo, &ksi.ksi_info, sig);
 	if (error != 0)