summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-01-28 07:54:16 +0100
committerWilly Tarreau <w@1wt.eu>2016-03-12 14:25:44 +0100
commit65391b651bfa5f59ce8045bf3a71c84ca9a169c0 (patch)
tree580821a7f18122db6a6197ff792ade72a0674215
parent276533d5acbfde1ed13cbc4ddf6ff22ce32d0a75 (diff)
downloadlwn-65391b651bfa5f59ce8045bf3a71c84ca9a169c0.tar.gz
lwn-65391b651bfa5f59ce8045bf3a71c84ca9a169c0.zip
ALSA: dummy: Disable switching timer backend via sysfs
commit 7ee96216c31aabe1eb42fb91ff50dae9fcd014b2 upstream. 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> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r--sound/drivers/dummy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index 252e04ce602f..7136c7a6ebce 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -171,7 +171,7 @@ MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-128) for dummy driver.");
module_param(fake_buffer, bool, 0444);
MODULE_PARM_DESC(fake_buffer, "Fake buffer allocations.");
#ifdef CONFIG_HIGH_RES_TIMERS
-module_param(hrtimer, bool, 0644);
+module_param(hrtimer, bool, 0444);
MODULE_PARM_DESC(hrtimer, "Use hrtimer as the timer source.");
#endif