ALSA: control: Protect user controls against concurrent access
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 18 Jun 2014 11:32:31 +0000 (13:32 +0200)
committersungmin ha <sungmin82.ha@samsung.com>
Wed, 18 Mar 2015 05:04:06 +0000 (14:04 +0900)
commit4a69f6b238c3c7e3eba8e3ca85f806c237973944
tree14c2a5cf3c2220d73d3dfd849a1c065ef0b00a25
parentb1e302415b11ecd4871beab458938b98d7e3dc0e
ALSA: control: Protect user controls against concurrent access

The user-control put and get handlers as well as the tlv do not protect against
concurrent access from multiple threads. Since the state of the control is not
updated atomically it is possible that either two write operations or a write
and a read operation race against each other. Both can lead to arbitrary memory
disclosure. This patch introduces a new lock that protects user-controls from
concurrent access. Since applications typically access controls sequentially
than in parallel a single lock per card should be fine.

Change-Id: I410a5f62c03053acb6b89afaabeb9706ad9c20a3
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/core.h
sound/core/control.c
sound/core/init.c