Page MenuHomeFreeBSD

sound: Unlock around uiomove() in midi_{read,write}()
Needs ReviewPublic

Authored by christos on Mon, Dec 8, 4:03 PM.
Tags
None
Referenced Files
F139427154: D54130.id167716.diff
Thu, Dec 11, 11:22 PM
F139424968: D54130.id.diff
Thu, Dec 11, 10:45 PM
F139384662: D54130.diff
Thu, Dec 11, 1:21 PM
Subscribers

Details

Reviewers
markj
emaste
Summary

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69128
Build 66011: arc lint + arc unit

Event Timeline

sys/dev/sound/midi/midi.c
474

are there any struct snd_midimembers that could be invalid after dropping and reacquiring the lock? E.g. could m->flags & M_RX no longer be true?

sys/dev/sound/midi/midi.c
474

The only place where M_RX gets cleared is in midi_close(), so I'm not sure we should worry about this, since by that time we'll have closed and midi_read() will just need to flush. Or am I missing something?

sys/dev/sound/midi/midi.c
551

used is calculated above: used = MIN(MIDIQ_AVAIL(m->outq), uio->uio_resid). What if the amount of available space changed while the lock was dropped?