⬢ DragonFlyBSD Kernel Audit
DF-5605 / code-reading.txt
← back to finding ↓ download raw
DF-5605 code-reading evidence — no shared holder of the mixer lock exists in-tree
==============================================================================
$ grep -rn "mixer_get_lock" sys/ --include=*.c --include=*.h | grep -v uaudio_pcm | grep -v mixer.c | grep -v mixer.h
sys/bus/u4b/audio/uaudio.c:5359:  sc->sc_mixer_lock = mixer_get_lock(m);
$ grep -n "lockmgr(sc->sc_mixer_lock" sys/bus/u4b/audio/uaudio.c
2753:  lockmgr(sc->sc_mixer_lock, LK_EXCLUSIVE);
2764:  lockmgr(sc->sc_mixer_lock, LK_RELEASE);
2772:  lockmgr(sc->sc_mixer_lock, LK_EXCLUSIVE);
2783:  lockmgr(sc->sc_mixer_lock, LK_RELEASE);
3019:  lockmgr(sc->sc_mixer_lock, LK_EXCLUSIVE);
3031:  lockmgr(sc->sc_mixer_lock, LK_RELEASE);
$ grep -rn "LK_SHARED" sys/dev/sound/
(no hits)
# lock creation (sound.c:92-99): snd_mtxcreate -> lockinit(m, desc, 0, LK_CANRECURSE)
# lockowned semantics (kern_lock.c:1361-1378): "We can only guess re: shared locks"
#   if (count & LKC_XMASK) return (lk_lockholder == td);
#   else return ((count & LKC_SMASK) != 0);
# precise alternative used by the sound core itself (mixer.c:273, mixer.c:346):
#   lockstatus(m->lock, curthread) == LK_EXCLUSIVE