aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2025-09-30 19:39:34 +0000
committerEd Maste <emaste@FreeBSD.org>2025-12-09 16:32:10 +0000
commit224d65015465d085f2e07edccef1f23a8c217b88 (patch)
treedad5705bd8eb0158e2887f99ea19b583b0a1769e
parent661b40ffdee25dd81d19fbbcd6cb09e3ec159342 (diff)
vt: Allow VT_SETMODE with frsig=0
Linux does not check that any of the signals in vt_mode VT_SETMODE ioctl (relsig, acqsig, frsig) are valid, but FreeBSD required that all three are valid. frsig is unusued in both Linux and FreeBSD, and software typically leaves it unset. To improve portability, allow frsig to be set to zero. PR: 289812 Reported by: Dušan Gvozdenović Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52835 (cherry picked from commit 5198c32210039d8dc92554647384eee75688848c)
-rw-r--r--sys/dev/vt/vt_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c
index b51ef6766de4..6d1012110678 100644
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -3044,9 +3044,9 @@ skip_thunk:
DPRINTF(5, "reset WAIT_ACQ, ");
return (0);
} else if (mode->mode == VT_PROCESS) {
- if (!ISSIGVALID(mode->relsig) ||
- !ISSIGVALID(mode->acqsig) ||
- !ISSIGVALID(mode->frsig)) {
+ if (!(ISSIGVALID(mode->relsig) &&
+ ISSIGVALID(mode->acqsig) &&
+ (mode->frsig == 0 || ISSIGVALID(mode->frsig)))) {
DPRINTF(5, "error EINVAL\n");
return (EINVAL);
}