diff options
author | phk <phk@FreeBSD.org> | 2001-05-28 20:22:12 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-05-28 20:22:12 +0000 |
commit | aaaac2aa6c3354e4ebeaff3cd35e2bd6213ed558 (patch) | |
tree | 418889dbcd427a45b74465b3fdc19ca5faa62167 /sys/kern | |
parent | 5da52a693669c7c3d781e9165f365a1b96dc2e8f (diff) | |
download | FreeBSD-src-aaaac2aa6c3354e4ebeaff3cd35e2bd6213ed558.zip FreeBSD-src-aaaac2aa6c3354e4ebeaff3cd35e2bd6213ed558.tar.gz |
With the new kernel dev_t conversions done at release 4.X,
it becomes possible to trap in ptsstop() in kern/tty_pty.c
if the slave side has never been opened during the life of a kernel.
What happens is that calls to ttyflush() done from ptyioctl() for the
controlling side end up calling ptsstop() [via (*tp->t_stop)(tp, <X>)]
which evaluates the following:
struct pt_ioctl *pti = tp->t_dev->si_drv1;
In order for tp->t_dev to be set, the slave device must first be
opened in ttyopen() [kern/tty.c].
It appears that the only problem is calls to (*tp->t_stop)(tp, <n>),
so this could also happen with other ioctls initiated by the
controlling side before the slave has been opened.
PR: 27698
Submitted by: David Bein bein@netapp.com
MFC after: 6 days
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/tty_pty.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index d533070..37a3126 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -156,6 +156,7 @@ ptyinit(dev_t devc) devs->si_drv1 = devc->si_drv1 = pt; devs->si_tty = devc->si_tty = &pt->pt_tty; + pt->pt_tty.t_dev = devs; ttyregister(&pt->pt_tty); return (devc); } |