[alsa-devel] [BUG] ALSA: core: seq: a possible double-lock bug in snd_seq_midisynth_remove()
![](https://secure.gravatar.com/avatar/4848aeaf682057e3138fb95de577f035.jpg?s=120&d=mm&r=g)
In snd_seq_midisynth_remove(), there is a possible double-lock bug: snd_seq_midisynth_remove() mutex_lock(®ister_mutex); -- line 421 snd_seq_delete_kernel_client() --- line 436 seq_free_client() -- line 2244 mutex_lock(®ister_mutex); -- line 294
This bug is found by a static analysis tool STCheck written by us.
I do not know how to correctly fix this bug, so I only report it. A possible fix is to release the mutex lock before calling seq_free_client() in snd_seq_delete_kernel_client() and then acquiring the lock again after calling seq_free_client().
Best wishes, Jia-Ju Bai
![](https://secure.gravatar.com/avatar/5b19e9d0e834ea10ef75803718ad564b.jpg?s=120&d=mm&r=g)
On Mon, 29 Jul 2019 05:54:07 +0200, Jia-Ju Bai wrote:
In snd_seq_midisynth_remove(), there is a possible double-lock bug: snd_seq_midisynth_remove() mutex_lock(®ister_mutex); -- line 421 snd_seq_delete_kernel_client() --- line 436 seq_free_client() -- line 2244 mutex_lock(®ister_mutex); -- line 294
This bug is found by a static analysis tool STCheck written by us.
No, it's a false-positive report. Both register_mutex's are static, hence they are local to each file. That is, you're looking at two different mutexes.
Takashi
participants (2)
-
Jia-Ju Bai
-
Takashi Iwai