ALSA: fireworks: accessing to user space outside spinlock
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Wed, 31 Aug 2016 13:58:42 +0000 (22:58 +0900)
committerTakashi Iwai <tiwai@suse.de>
Wed, 31 Aug 2016 14:17:15 +0000 (16:17 +0200)
commit4132c9535689080909b2b756e36fef320e0bbe8c
tree9f30fa84c9ce173059e7250cba2722a3e763b159
parent09934be9a8e6691670cec6e6d66fc319a77e79c9
ALSA: fireworks: accessing to user space outside spinlock

In hwdep interface of fireworks driver, accessing to user space is in a
critical section with disabled local interrupt. Depending on architecture,
accessing to user space can cause page fault exception. Then local
processor stores machine status and handles the synchronous event. A
handler corresponding to the event can call task scheduler to wait for
preparing pages. In a case of usage of single core processor, the state to
disable local interrupt is worse because it don't handle usual interrupts
from hardware.

This commit fixes this bug, performing the accessing outside spinlock. This
commit also gives up counting the number of queued response messages to
simplify ring-buffer management.

Reported-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Cc: stable@vger.kernel.org
Fixes: 48c03cd10268('ALSA: fireworks: Add command/response functionality into hwdep interface')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/fireworks/fireworks.h
sound/firewire/fireworks/fireworks_hwdep.c
sound/firewire/fireworks/fireworks_proc.c
sound/firewire/fireworks/fireworks_transaction.c