summaryrefslogtreecommitdiff
path: root/sys/dev/wscons/wsmuxvar.h
diff options
context:
space:
mode:
authoranton <anton@cvs.openbsd.org>2019-02-18 17:39:15 +0000
committeranton <anton@cvs.openbsd.org>2019-02-18 17:39:15 +0000
commitcf9eada7cb85f159d879c702a20fd4935d8e9d95 (patch)
treecfed1bd43b2314139b813d4599dbf77cde743fa6 /sys/dev/wscons/wsmuxvar.h
parent9a5c3a9be3de231d70acb57cf6287f2347645739 (diff)
Serialize access to the list of attached child devices belonging to a
wsmux. When invoking wsevsrc_* functions on a attached child device, underlying driver can sleep; this introduces a race where another thread is able to modify the list leading to all kinds of corruptions. ok visa@ Reported-by: syzbot+03f7377a9848d7d008c9@syzkaller.appspotmail.com
Diffstat (limited to 'sys/dev/wscons/wsmuxvar.h')
-rw-r--r--sys/dev/wscons/wsmuxvar.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/wscons/wsmuxvar.h b/sys/dev/wscons/wsmuxvar.h
index 4d62521573c..20627191afb 100644
--- a/sys/dev/wscons/wsmuxvar.h
+++ b/sys/dev/wscons/wsmuxvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsmuxvar.h,v 1.10 2014/01/26 17:48:08 miod Exp $ */
+/* $OpenBSD: wsmuxvar.h,v 1.11 2019/02/18 17:39:14 anton Exp $ */
/* $NetBSD: wsmuxvar.h,v 1.10 2005/04/30 03:47:12 augustss Exp $ */
/*
@@ -77,6 +77,7 @@ struct wsmux_softc {
struct wsevsrc sc_base;
struct proc *sc_p; /* open proc */
TAILQ_HEAD(, wsevsrc) sc_cld; /* list of children */
+ struct rwlock sc_lock; /* lock for sc_cld */
u_int32_t sc_kbd_layout; /* current layout of keyboard */
#ifdef WSDISPLAY_COMPAT_RAWKBD
int sc_rawkbd; /* A hack to remember the kbd mode */