ALSA: dummy: Disable switching timer backend via sysfs
authorTakashi Iwai <tiwai@suse.de>
Thu, 28 Jan 2016 06:54:16 +0000 (07:54 +0100)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 15 Feb 2016 20:45:26 +0000 (15:45 -0500)
commitf6b4419806e546fb02f91bed03572362e2623879
treed43cf38b48276073e3b7f9c68f6d1d012b5a7009
parent2fbdb6c658f4a10c649fd57c42a5199d2a8032d8
ALSA: dummy: Disable switching timer backend via sysfs

[ Upstream commit 7ee96216c31aabe1eb42fb91ff50dae9fcd014b2 ]

ALSA dummy driver can switch the timer backend between system timer
and hrtimer via its hrtimer module option.  This can be also switched
dynamically via sysfs, but it may lead to a memory corruption when
switching is done while a PCM stream is running; the stream instance
for the newly switched timer method tries to access the memory that
was allocated by another timer method although the sizes differ.

As the simplest fix, this patch just disables the switch via sysfs by
dropping the writable bit.

BugLink: http://lkml.kernel.org/r/CACT4Y+ZGEeEBntHW5WHn2GoeE0G_kRrCmUh6=dWyy-wfzvuJLg@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
sound/drivers/dummy.c