ALSA: control: Don't access controls outside of protected regions
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 18 Jun 2014 11:32:33 +0000 (13:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Jun 2014 19:15:43 +0000 (15:15 -0400)
commit1637a83bb15491efb3e7c8cd746471ef3710e79d
treebb3304df1522e788ecb2ac3eaa57dc505479a37a
parent99e6d92ad48b8df440f9466c82c839b74ce95dcd
ALSA: control: Don't access controls outside of protected regions

commit fd9f26e4eca5d08a27d12c0933fceef76ed9663d upstream.

A control that is visible on the card->controls list can be freed at any time.
This means we must not access any of its memory while not holding the
controls_rw_lock. Otherwise we risk a use after free access.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/control.c