lkml.org 
[lkml]   [2019]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[BUG] ALSA: core: seq: a possible double-lock bug in snd_seq_midisynth_remove()
Date
In snd_seq_midisynth_remove(), there is a possible double-lock bug:
snd_seq_midisynth_remove()
    mutex_lock(&register_mutex); -- line 421
    snd_seq_delete_kernel_client() --- line 436
        seq_free_client() -- line 2244
            mutex_lock(&register_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

\
 
 \ /
  Last update: 2019-07-29 05:55    [W:0.031 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site