git: 5e1c7867e1b9 - main - vt(4): allow up to _SIG_MAXSIG (128) for VT_SETMODE

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Wed, 14 Jan 2026 00:23:08 UTC
The branch main has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=5e1c7867e1b9a8abe7307d01087cddc057e39859

commit 5e1c7867e1b9a8abe7307d01087cddc057e39859
Author:     Quentin Thébault <quentin.thebault@defenso.fr>
AuthorDate: 2026-01-14 00:14:22 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2026-01-14 00:15:30 +0000

    vt(4): allow up to _SIG_MAXSIG (128) for VT_SETMODE
    
    VT_SETMODE ioctl currently checks the provided signal numbers with its
    own ISSIGVALID macro that uses NSIG (32) as a maximum, although the code
    that will actually send the signal in sys/kern/kern_sig.c uses
    _SIG_VALID which allows up to _SIG_MAXSIG (128).
    
    This change aligns the vt code with the kernel internals and enables the
    use of higher signal numbers so that applications are not limited to
    SIGUSR1 and SIGUSR2 for vt release and acquire signals.
    
    Signed-off-by:  Quentin Thébault <quentin.thebault@defenso.fr>
    Reviewed by:    emaste, imp, kevans
    Differential Revision:  https://reviews.freebsd.org/D53615
---
 sys/dev/vt/vt.h      | 1 -
 sys/dev/vt/vt_core.c | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/sys/dev/vt/vt.h b/sys/dev/vt/vt.h
index 8e35a81bc101..4abe99e4ab13 100644
--- a/sys/dev/vt/vt.h
+++ b/sys/dev/vt/vt.h
@@ -81,7 +81,6 @@
 #else
 #define	DPRINTF(_l, ...)	do {} while (0)
 #endif
-#define	ISSIGVALID(sig)	((sig) > 0 && (sig) < NSIG)
 
 #define	VT_SYSCTL_INT(_name, _default, _descr)				\
 int vt_##_name = (_default);						\
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c
index 5e8f7b1d0bb7..a6a5f0eeff9d 100644
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -3046,9 +3046,9 @@ skip_thunk:
 				DPRINTF(5, "reset WAIT_ACQ, ");
 			return (0);
 		} else if (mode->mode == VT_PROCESS) {
-			if (!(ISSIGVALID(mode->relsig) &&
-			    ISSIGVALID(mode->acqsig) &&
-			    (mode->frsig == 0 || ISSIGVALID(mode->frsig)))) {
+			if (!(_SIG_VALID(mode->relsig) &&
+			    _SIG_VALID(mode->acqsig) &&
+			    (mode->frsig == 0 || _SIG_VALID(mode->frsig)))) {
 				DPRINTF(5, "error EINVAL\n");
 				return (EINVAL);
 			}