Skip to content

Commit

Permalink
When adding a wsmux device to an existing wsmux device using
Browse files Browse the repository at this point in the history
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
  • Loading branch information
anton committed Feb 20, 2019
1 parent bab15b3 commit 1f8a38b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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 $ */

/*
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1f8a38b

Please sign in to comment.