On Sat, Apr 16, 2022 at 05:38:22PM +0200, J. Hannken-Illjes wrote: > > On 16. Apr 2022, at 17:27, Tobias Nygren <t...@netbsd.org> wrote: > > > > On Sat, 16 Apr 2022 16:51:31 +0200 > > Thomas Klausner <w...@netbsd.org> wrote: > > > >> panic: kernel diagnostic assertion "VOP_ISLOCKED(vp) == LK_EXCLUSIVE" > >> failed: file "/usr/src/sys/miscfs/specfs/spec_vnops.c", line 1555 > >> cpu1: Begin traceback... > >> vpanic() > >> kern_assert() > >> spec_close() at netbsd:spec_close+0x2fc > >> VOP_CLOE() at netbsd:vop_close+0x42 > >> sequenceropen() at netbsd:sequenceropen+0x359 > > > > "cat /dev/sequencer" as a regular user is enough to trigger this. In > > the midiseq_open() error path it is trying to VOP_CLOSE without the > > vnode lock held. Maybe this patch helps. (Someone with filesystem > > clue please sanity check this.) > > > > --- sys/dev/sequencer.c 31 Mar 2022 19:30:15 -0000 1.76 > > +++ sys/dev/sequencer.c 16 Apr 2022 15:23:54 -0000 > > @@ -1452,8 +1452,9 @@ midiseq_open(int unit, int flags) > > if ((mi.props & MIDI_PROP_CAN_INPUT) == 0) > > flags &= ~FREAD; > > if ((flags & (FREAD|FWRITE)) == 0) { > > + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); > > VOP_CLOSE(vp, oflags, kauth_cred_get()); > > - vrele(vp); > > + vput(vp); > > return NULL; > > } > > Already committed by Taylor R Campbell as sequencer.c Rev. 1.79 > on 2022/04/16 11:13:10.
Thanks - I can confirm that a kernel from yesterday doesn't have the issue any longer. Thomas