diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2018-05-15 08:57:22 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2018-05-15 08:57:22 +0000 |
commit | cad8d1592a0432b91744d32fb80c797986c753e6 (patch) | |
tree | c13f4f008a6c337967b5057fc4f6b43f295e1fa6 /sys | |
parent | 1cb626f394cc1e5d7e7c56c8c8d42d7957bcffd1 (diff) |
Grab the KERNEL_LOCK() in pppasyncstart/pppasyncrelinq/pppasyncctlp.
The tty layer still relies on it to serialize access to its data.
Fixes crashes reported & tested by form@ via mikeb@.
ok mikeb@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/ppp_tty.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c index bb1dba2e09b..389441bf349 100644 --- a/sys/net/ppp_tty.c +++ b/sys/net/ppp_tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppp_tty.c,v 1.48 2018/02/19 08:59:52 mpi Exp $ */ +/* $OpenBSD: ppp_tty.c,v 1.49 2018/05/15 08:57:21 mpi Exp $ */ /* $NetBSD: ppp_tty.c,v 1.12 1997/03/24 21:23:10 christos Exp $ */ /* @@ -255,6 +255,7 @@ pppasyncrelinq(struct ppp_softc *sc) { int s; + KERNEL_LOCK(); s = spltty(); m_freem(sc->sc_outm); sc->sc_outm = NULL; @@ -268,6 +269,7 @@ pppasyncrelinq(struct ppp_softc *sc) sc->sc_flags &= ~SC_TIMEOUT; } splx(s); + KERNEL_UNLOCK(); } /* @@ -496,6 +498,7 @@ pppasyncstart(struct ppp_softc *sc) struct mbuf *m2; int s; + KERNEL_LOCK(); idle = 0; while (CCOUNT(&tp->t_outq) < tp->t_hiwat) { /* @@ -662,6 +665,7 @@ pppasyncstart(struct ppp_softc *sc) } splx(s); + KERNEL_UNLOCK(); } /* @@ -674,12 +678,14 @@ pppasyncctlp(struct ppp_softc *sc) struct tty *tp; int s; + KERNEL_LOCK(); /* Put a placeholder byte in canq for ttpoll()/ttnread(). */ s = spltty(); tp = (struct tty *) sc->sc_devp; putc(0, &tp->t_canq); ttwakeup(tp); splx(s); + KERNEL_UNLOCK(); } /* |