From: Alexey Khoroshilov Date: Sat, 9 Nov 2013 21:28:43 +0000 (-0300) Subject: [media] dvb_demux: fix deadlock in dmx_section_feed_release_filter() X-Git-Tag: v3.13-rc4~25^2~26 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6633327d59067fe16128d66968cd50a10ca7a09c;p=pandora-kernel.git [media] dvb_demux: fix deadlock in dmx_section_feed_release_filter() dmx_section_feed_release_filter() locks dvbdmx->mutex and if the feed is still filtering, it calls feed->stop_filtering(feed). stop_filtering() is implemented by dmx_section_feed_stop_filtering() that first of all try to lock the same mutex: dvbdmx->mutex. That leads to a deadlock. It does not happen often in practice because all callers of release_filter() stop filtering by themselves. So the problem can happen in case of race condition only. The patch releases dvbdmx->mutex before call to feed->stop_filtering(feed) and reacquires the mutex after that. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed