From a850d55262986a85c85793efdd961accc757bf36 Mon Sep 17 00:00:00 2001 From: anton Date: Wed, 20 Feb 2019 17:54:35 +0000 Subject: When adding a wsmux device to an existing wsmux device using ioctl(WSMUXIO_ADD_DEVICE), two distinct locks of the same type are acquired. Thus, witness will emit warning. Since acquiring two different locks of the same type is harmless in this context, relax the witness check by flagging the locks as RWL_DUPOK. ok visa@ Reported-by: syzbot+249e483406a1f7843915@syzkaller.appspotmail.com --- sys/dev/wscons/wsmux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/wscons/wsmux.c b/sys/dev/wscons/wsmux.c index e5a72f2dd26..f1458d3b636 100644 --- a/sys/dev/wscons/wsmux.c +++ b/sys/dev/wscons/wsmux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmux.c,v 1.41 2019/02/19 07:03:29 anton Exp $ */ +/* $OpenBSD: wsmux.c,v 1.42 2019/02/20 17:54:34 anton Exp $ */ /* $NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $ */ /* @@ -608,7 +608,7 @@ wsmux_create(const char *name, int unit) if (sc == NULL) return (NULL); TAILQ_INIT(&sc->sc_cld); - rw_init(&sc->sc_lock, "wsmuxlk"); + rw_init_flags(&sc->sc_lock, "wsmuxlk", RWL_DUPOK); snprintf(sc->sc_base.me_dv.dv_xname, sizeof sc->sc_base.me_dv.dv_xname, "%s%d", name, unit); sc->sc_base.me_dv.dv_unit = unit; -- cgit v1.2.3