]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerTakashi Iwai <tiwai@suse.de>
Wed, 18 Jun 2014 13:12:33 +0000 (15:12 +0200)
commit2e11c487b8b1579b6e5a88ab1f16da5394b7d830
tree65d9ee5f96dacb86a33d3a8cd786e876563d93ac
parent081ef54181a1ff0d2c7e189052277797ff8dd0dd
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.

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