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)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 11 Jul 2014 12:33:51 +0000 (13:33 +0100)
commit79b789d8e20e22196285ac98247b5aeee2cade17
treeb030c5c4aa600260870d3f89b72fed38f2d6c8be
parent0e2e43eca302b31f64ebfe4734fd2cc7358c4555
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: Ben Hutchings <ben@decadent.org.uk>
sound/core/control.c