git: 3f4d641f7e69 - stable/14 - vt(4): allow up to _SIG_MAXSIG (128) for VT_SETMODE
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 12 Apr 2026 13:44:18 UTC
The branch stable/14 has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=3f4d641f7e6973e6d544c10ac9c0203333b36ecd
commit 3f4d641f7e6973e6d544c10ac9c0203333b36ecd
Author: Quentin Thébault <quentin.thebault@defenso.fr>
AuthorDate: 2026-01-14 00:14:22 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2026-04-12 13:43:41 +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
(cherry picked from commit 5e1c7867e1b9a8abe7307d01087cddc057e39859)
---
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 9ca2a547b067..d365187b037f 100644
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -3055,9 +3055,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);
}