OSDN Git Service

ALSA: bebob: use address returned by kmalloc() instead of kernel stack for streaming...
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 9 Sep 2018 13:25:12 +0000 (22:25 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Sep 2018 09:55:55 +0000 (02:55 -0700)
commitc143935a34a50e1a6dfba3da2da8809ebe90f2d1
tree33f1a752c217aa2c9020f7dabf8b1fd8985a0613
parent28114caeb0ab2edb0181866a040965cd74169571
ALSA: bebob: use address returned by kmalloc() instead of kernel stack for streaming DMA mapping

commit 493626f2d87a74e6dbea1686499ed6e7e600484e upstream.

When executing 'fw_run_transaction()' with 'TCODE_WRITE_BLOCK_REQUEST',
an address of 'payload' argument is used for streaming DMA mapping by
'firewire_ohci' module if 'size' argument is larger than 8 byte.
Although in this case the address should not be on kernel stack, current
implementation of ALSA bebob driver uses data in kernel stack for a cue
to boot M-Audio devices. This often brings unexpected result, especially
for a case of CONFIG_VMAP_STACK=y.

This commit fixes the bug.

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=201021
Reference: https://forum.manjaro.org/t/firewire-m-audio-410-driver-wont-load-firmware/51165
Fixes: a2b2a7798fb6('ALSA: bebob: Send a cue to load firmware for M-Audio Firewire series')
Cc: <stable@vger.kernel.org> # v3.16+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/firewire/bebob/bebob_maudio.c