summaryrefslogtreecommitdiffstats
path: root/sys/dev/snp
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2007-12-03 14:02:27 +0000
committerkib <kib@FreeBSD.org>2007-12-03 14:02:27 +0000
commit4be0c75a36346a1cf37872bbe96d191f17fc43c9 (patch)
tree4fa9a4f171731c82febb40c597a5f4368ccf060b /sys/dev/snp
parent7d7c31228433aa17ba3a8530ba4e041628e08a50 (diff)
downloadFreeBSD-src-4be0c75a36346a1cf37872bbe96d191f17fc43c9.zip
FreeBSD-src-4be0c75a36346a1cf37872bbe96d191f17fc43c9.tar.gz
Do not allow the SNPSTTY ioctl for the snoop device that has a tty
attached. Otherwise, the snp->snp_tty would be overwritten, while the tty line discipline still set to the snpdisc. Then snplwrite() causes panic because ttytosnp() cannot find the snp. MFC after: 1 week
Diffstat (limited to 'sys/dev/snp')
-rw-r--r--sys/dev/snp/snp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index 08c6c55..2365634 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -502,6 +502,9 @@ snpioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
s = *(int *)data;
if (s < 0)
return (snp_down(snp));
+ if (snp->snp_tty != NULL)
+ return (EBUSY);
+
if (fget(td, s, &fp) != 0)
return (EINVAL);
if (fp->f_type != DTYPE_VNODE ||
OpenPOWER on IntegriCloud