summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/pcvt/pcvt_ext.c
diff options
context:
space:
mode:
authorjmg <jmg@FreeBSD.org>1997-03-02 14:03:33 +0000
committerjmg <jmg@FreeBSD.org>1997-03-02 14:03:33 +0000
commit0a4f73a54dca9a1a4592ce4453b1e1d928a56c33 (patch)
tree6e768065e7ae30da28183db9dea2daeb7e5351a0 /sys/i386/isa/pcvt/pcvt_ext.c
parent56a4d1b13d3e25f568af21419fdc208f5a688e80 (diff)
downloadFreeBSD-src-0a4f73a54dca9a1a4592ce4453b1e1d928a56c33.zip
FreeBSD-src-0a4f73a54dca9a1a4592ce4453b1e1d928a56c33.tar.gz
add the same fix to pcvt that I did to syscons. Make sure that the signals
provided by the user are valid else return EINVAL. Reviewed-by: joerg
Diffstat (limited to 'sys/i386/isa/pcvt/pcvt_ext.c')
-rw-r--r--sys/i386/isa/pcvt/pcvt_ext.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_ext.c b/sys/i386/isa/pcvt/pcvt_ext.c
index e8a75bb..b27575f 100644
--- a/sys/i386/isa/pcvt/pcvt_ext.c
+++ b/sys/i386/isa/pcvt/pcvt_ext.c
@@ -72,6 +72,8 @@
#include <i386/isa/pcvt/pcvt_hdr.h> /* global include */
+#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
+
static int s3testwritable( void );
static int et4000_col( int );
static int wd90c11_col( int );
@@ -2505,9 +2507,15 @@ usl_vt_ioctl(Dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
return EBUSY; /* already in use on this VT */
}
- vsp->smode = newmode;
- vsp->proc = p;
- vsp->pid = p->p_pid;
+ if (ISSIGVALID(newmode->relsig) && ISSIGVALID(newmode->acqsig)
+ && ISSIGVALID(newmode->frsig)) {
+ vsp->smode = newmode;
+ vsp->proc = p;
+ vsp->pid = p->p_pid;
+ } else {
+ splx(opri);
+ return EINVAL;
+ }
#if PCVT_FREEBSD > 206
/*
OpenPOWER on IntegriCloud