<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/sound/drivers, branch v4.7</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>ALSA: dummy: Fix a use-after-free at closing</title>
<updated>2016-06-24T13:18:32+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2016-06-24T13:15:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d5dbbe6569481bf12dcbe3e12cff72c5f78d272c'/>
<id>d5dbbe6569481bf12dcbe3e12cff72c5f78d272c</id>
<content type='text'>
syzkaller fuzzer spotted a potential use-after-free case in snd-dummy
driver when hrtimer is used as backend:
&gt; ==================================================================
&gt; BUG: KASAN: use-after-free in rb_erase+0x1b17/0x2010 at addr ffff88005e5b6f68
&gt;  Read of size 8 by task syz-executor/8984
&gt; =============================================================================
&gt; BUG kmalloc-192 (Not tainted): kasan: bad access detected
&gt; -----------------------------------------------------------------------------
&gt;
&gt; Disabling lock debugging due to kernel taint
&gt; INFO: Allocated in 0xbbbbbbbbbbbbbbbb age=18446705582212484632
&gt; ....
&gt; [&lt;      none      &gt;] dummy_hrtimer_create+0x49/0x1a0 sound/drivers/dummy.c:464
&gt; ....
&gt; INFO: Freed in 0xfffd8e09 age=18446705496313138713 cpu=2164287125 pid=-1
&gt; [&lt;      none      &gt;] dummy_hrtimer_free+0x68/0x80 sound/drivers/dummy.c:481
&gt; ....
&gt; Call Trace:
&gt;  [&lt;ffffffff8179e59e&gt;] __asan_report_load8_noabort+0x3e/0x40 mm/kasan/report.c:333
&gt;  [&lt;     inline     &gt;] rb_set_parent include/linux/rbtree_augmented.h:111
&gt;  [&lt;     inline     &gt;] __rb_erase_augmented include/linux/rbtree_augmented.h:218
&gt;  [&lt;ffffffff82ca5787&gt;] rb_erase+0x1b17/0x2010 lib/rbtree.c:427
&gt;  [&lt;ffffffff82cb02e8&gt;] timerqueue_del+0x78/0x170 lib/timerqueue.c:86
&gt;  [&lt;ffffffff814d0c80&gt;] __remove_hrtimer+0x90/0x220 kernel/time/hrtimer.c:903
&gt;  [&lt;     inline     &gt;] remove_hrtimer kernel/time/hrtimer.c:945
&gt;  [&lt;ffffffff814d23da&gt;] hrtimer_try_to_cancel+0x22a/0x570 kernel/time/hrtimer.c:1046
&gt;  [&lt;ffffffff814d2742&gt;] hrtimer_cancel+0x22/0x40 kernel/time/hrtimer.c:1066
&gt;  [&lt;ffffffff85420531&gt;] dummy_hrtimer_stop+0x91/0xb0 sound/drivers/dummy.c:417
&gt;  [&lt;ffffffff854228bf&gt;] dummy_pcm_trigger+0x17f/0x1e0 sound/drivers/dummy.c:507
&gt;  [&lt;ffffffff85392170&gt;] snd_pcm_do_stop+0x160/0x1b0 sound/core/pcm_native.c:1106
&gt;  [&lt;ffffffff85391b26&gt;] snd_pcm_action_single+0x76/0x120 sound/core/pcm_native.c:956
&gt;  [&lt;ffffffff85391e01&gt;] snd_pcm_action+0x231/0x290 sound/core/pcm_native.c:974
&gt;  [&lt;     inline     &gt;] snd_pcm_stop sound/core/pcm_native.c:1139
&gt;  [&lt;ffffffff8539754d&gt;] snd_pcm_drop+0x12d/0x1d0 sound/core/pcm_native.c:1784
&gt;  [&lt;ffffffff8539d3be&gt;] snd_pcm_common_ioctl1+0xfae/0x2150 sound/core/pcm_native.c:2805
&gt;  [&lt;ffffffff8539ee91&gt;] snd_pcm_capture_ioctl1+0x2a1/0x5e0 sound/core/pcm_native.c:2976
&gt;  [&lt;ffffffff8539f2ec&gt;] snd_pcm_kernel_ioctl+0x11c/0x160 sound/core/pcm_native.c:3020
&gt;  [&lt;ffffffff853d9a44&gt;] snd_pcm_oss_sync+0x3a4/0xa30 sound/core/oss/pcm_oss.c:1693
&gt;  [&lt;ffffffff853da27d&gt;] snd_pcm_oss_release+0x1ad/0x280 sound/core/oss/pcm_oss.c:2483
&gt;  .....

A workaround is to call hrtimer_cancel() in dummy_hrtimer_sync() which
is called certainly before other blocking ops.

Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
syzkaller fuzzer spotted a potential use-after-free case in snd-dummy
driver when hrtimer is used as backend:
&gt; ==================================================================
&gt; BUG: KASAN: use-after-free in rb_erase+0x1b17/0x2010 at addr ffff88005e5b6f68
&gt;  Read of size 8 by task syz-executor/8984
&gt; =============================================================================
&gt; BUG kmalloc-192 (Not tainted): kasan: bad access detected
&gt; -----------------------------------------------------------------------------
&gt;
&gt; Disabling lock debugging due to kernel taint
&gt; INFO: Allocated in 0xbbbbbbbbbbbbbbbb age=18446705582212484632
&gt; ....
&gt; [&lt;      none      &gt;] dummy_hrtimer_create+0x49/0x1a0 sound/drivers/dummy.c:464
&gt; ....
&gt; INFO: Freed in 0xfffd8e09 age=18446705496313138713 cpu=2164287125 pid=-1
&gt; [&lt;      none      &gt;] dummy_hrtimer_free+0x68/0x80 sound/drivers/dummy.c:481
&gt; ....
&gt; Call Trace:
&gt;  [&lt;ffffffff8179e59e&gt;] __asan_report_load8_noabort+0x3e/0x40 mm/kasan/report.c:333
&gt;  [&lt;     inline     &gt;] rb_set_parent include/linux/rbtree_augmented.h:111
&gt;  [&lt;     inline     &gt;] __rb_erase_augmented include/linux/rbtree_augmented.h:218
&gt;  [&lt;ffffffff82ca5787&gt;] rb_erase+0x1b17/0x2010 lib/rbtree.c:427
&gt;  [&lt;ffffffff82cb02e8&gt;] timerqueue_del+0x78/0x170 lib/timerqueue.c:86
&gt;  [&lt;ffffffff814d0c80&gt;] __remove_hrtimer+0x90/0x220 kernel/time/hrtimer.c:903
&gt;  [&lt;     inline     &gt;] remove_hrtimer kernel/time/hrtimer.c:945
&gt;  [&lt;ffffffff814d23da&gt;] hrtimer_try_to_cancel+0x22a/0x570 kernel/time/hrtimer.c:1046
&gt;  [&lt;ffffffff814d2742&gt;] hrtimer_cancel+0x22/0x40 kernel/time/hrtimer.c:1066
&gt;  [&lt;ffffffff85420531&gt;] dummy_hrtimer_stop+0x91/0xb0 sound/drivers/dummy.c:417
&gt;  [&lt;ffffffff854228bf&gt;] dummy_pcm_trigger+0x17f/0x1e0 sound/drivers/dummy.c:507
&gt;  [&lt;ffffffff85392170&gt;] snd_pcm_do_stop+0x160/0x1b0 sound/core/pcm_native.c:1106
&gt;  [&lt;ffffffff85391b26&gt;] snd_pcm_action_single+0x76/0x120 sound/core/pcm_native.c:956
&gt;  [&lt;ffffffff85391e01&gt;] snd_pcm_action+0x231/0x290 sound/core/pcm_native.c:974
&gt;  [&lt;     inline     &gt;] snd_pcm_stop sound/core/pcm_native.c:1139
&gt;  [&lt;ffffffff8539754d&gt;] snd_pcm_drop+0x12d/0x1d0 sound/core/pcm_native.c:1784
&gt;  [&lt;ffffffff8539d3be&gt;] snd_pcm_common_ioctl1+0xfae/0x2150 sound/core/pcm_native.c:2805
&gt;  [&lt;ffffffff8539ee91&gt;] snd_pcm_capture_ioctl1+0x2a1/0x5e0 sound/core/pcm_native.c:2976
&gt;  [&lt;ffffffff8539f2ec&gt;] snd_pcm_kernel_ioctl+0x11c/0x160 sound/core/pcm_native.c:3020
&gt;  [&lt;ffffffff853d9a44&gt;] snd_pcm_oss_sync+0x3a4/0xa30 sound/core/oss/pcm_oss.c:1693
&gt;  [&lt;ffffffff853da27d&gt;] snd_pcm_oss_release+0x1ad/0x280 sound/core/oss/pcm_oss.c:2483
&gt;  .....

A workaround is to call hrtimer_cancel() in dummy_hrtimer_sync() which
is called certainly before other blocking ops.

Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'akpm' (patches from Andrew)</title>
<updated>2016-03-19T02:26:54+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-03-19T02:26:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=814a2bf957739f367cbebfa1b60237387b72d0ee'/>
<id>814a2bf957739f367cbebfa1b60237387b72d0ee</id>
<content type='text'>
Merge second patch-bomb from Andrew Morton:

 - a couple of hotfixes

 - the rest of MM

 - a new timer slack control in procfs

 - a couple of procfs fixes

 - a few misc things

 - some printk tweaks

 - lib/ updates, notably to radix-tree.

 - add my and Nick Piggin's old userspace radix-tree test harness to
   tools/testing/radix-tree/.  Matthew said it was a godsend during the
   radix-tree work he did.

 - a few code-size improvements, switching to __always_inline where gcc
   screwed up.

 - partially implement character sets in sscanf

* emailed patches from Andrew Morton &lt;akpm@linux-foundation.org&gt;: (118 commits)
  sscanf: implement basic character sets
  lib/bug.c: use common WARN helper
  param: convert some "on"/"off" users to strtobool
  lib: add "on"/"off" support to kstrtobool
  lib: update single-char callers of strtobool()
  lib: move strtobool() to kstrtobool()
  include/linux/unaligned: force inlining of byteswap operations
  include/uapi/linux/byteorder, swab: force inlining of some byteswap operations
  include/asm-generic/atomic-long.h: force inlining of some atomic_long operations
  usb: common: convert to use match_string() helper
  ide: hpt366: convert to use match_string() helper
  ata: hpt366: convert to use match_string() helper
  power: ab8500: convert to use match_string() helper
  power: charger_manager: convert to use match_string() helper
  drm/edid: convert to use match_string() helper
  pinctrl: convert to use match_string() helper
  device property: convert to use match_string() helper
  lib/string: introduce match_string() helper
  radix-tree tests: add test for radix_tree_iter_next
  radix-tree tests: add regression3 test
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Merge second patch-bomb from Andrew Morton:

 - a couple of hotfixes

 - the rest of MM

 - a new timer slack control in procfs

 - a couple of procfs fixes

 - a few misc things

 - some printk tweaks

 - lib/ updates, notably to radix-tree.

 - add my and Nick Piggin's old userspace radix-tree test harness to
   tools/testing/radix-tree/.  Matthew said it was a godsend during the
   radix-tree work he did.

 - a few code-size improvements, switching to __always_inline where gcc
   screwed up.

 - partially implement character sets in sscanf

* emailed patches from Andrew Morton &lt;akpm@linux-foundation.org&gt;: (118 commits)
  sscanf: implement basic character sets
  lib/bug.c: use common WARN helper
  param: convert some "on"/"off" users to strtobool
  lib: add "on"/"off" support to kstrtobool
  lib: update single-char callers of strtobool()
  lib: move strtobool() to kstrtobool()
  include/linux/unaligned: force inlining of byteswap operations
  include/uapi/linux/byteorder, swab: force inlining of some byteswap operations
  include/asm-generic/atomic-long.h: force inlining of some atomic_long operations
  usb: common: convert to use match_string() helper
  ide: hpt366: convert to use match_string() helper
  ata: hpt366: convert to use match_string() helper
  power: ab8500: convert to use match_string() helper
  power: charger_manager: convert to use match_string() helper
  drm/edid: convert to use match_string() helper
  pinctrl: convert to use match_string() helper
  device property: convert to use match_string() helper
  lib/string: introduce match_string() helper
  radix-tree tests: add test for radix_tree_iter_next
  radix-tree tests: add regression3 test
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>sound: query dynamic DEBUG_PAGEALLOC setting</title>
<updated>2016-03-17T22:09:34+00:00</updated>
<author>
<name>Joonsoo Kim</name>
<email>iamjoonsoo.kim@lge.com</email>
</author>
<published>2016-03-17T21:17:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=505f6d22dbc63f333d1178dc80264e40b5c35268'/>
<id>505f6d22dbc63f333d1178dc80264e40b5c35268</id>
<content type='text'>
We can disable debug_pagealloc processing even if the code is compiled
with CONFIG_DEBUG_PAGEALLOC.  This patch changes the code to query
whether it is enabled or not in runtime.

[akpm@linux-foundation.org: export _debug_pagealloc_enabled to modules]
Signed-off-by: Joonsoo Kim &lt;iamjoonsoo.kim@lge.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Acked-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Chris Metcalf &lt;cmetcalf@ezchip.com&gt;
Cc: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Cc: Christoph Lameter &lt;cl@linux.com&gt;
Cc: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We can disable debug_pagealloc processing even if the code is compiled
with CONFIG_DEBUG_PAGEALLOC.  This patch changes the code to query
whether it is enabled or not in runtime.

[akpm@linux-foundation.org: export _debug_pagealloc_enabled to modules]
Signed-off-by: Joonsoo Kim &lt;iamjoonsoo.kim@lge.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Acked-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Chris Metcalf &lt;cmetcalf@ezchip.com&gt;
Cc: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Cc: Christoph Lameter &lt;cl@linux.com&gt;
Cc: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: portman2x4: fix NULL pointer dereference</title>
<updated>2016-03-02T15:23:24+00:00</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-03-02T11:40:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=03367bf7fd30165bda3b037b3078cfa231ba33b7'/>
<id>03367bf7fd30165bda3b037b3078cfa231ba33b7</id>
<content type='text'>
While registering pardev, the irq_func was also registered. As a result
when we tried to probe for the card, an interrupt was generated and in
the ISR we tried to dereference private_data. But private_data is still
NULL as we have not yet done portman_create(). Lets probe for the device
after card is created.

Fixes: e6a1b7e88046 ("ALSA: portman2x4 - use new parport device model")
Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While registering pardev, the irq_func was also registered. As a result
when we tried to probe for the card, an interrupt was generated and in
the ISR we tried to dereference private_data. But private_data is still
NULL as we have not yet done portman_create(). Lets probe for the device
after card is created.

Fixes: e6a1b7e88046 ("ALSA: portman2x4 - use new parport device model")
Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: mts64: fix NULL pointer dereference</title>
<updated>2016-02-29T12:23:46+00:00</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-02-29T12:13:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0bbf7e025fc89ded4925daeaf3619722b13b12d4'/>
<id>0bbf7e025fc89ded4925daeaf3619722b13b12d4</id>
<content type='text'>
While registering pardev, the irq_func was also registered. As a
result when we tried to probe for the card, an interrupt was generated
and in the ISR we tried to dereference private_data. But private_data
is still NULL as we have not yet done snd_mts64_create(). Lets probe
for the card after mts64 is created.

Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Fixes: 94a573500d48 ("ALSA: mts64: use new parport device model")
Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While registering pardev, the irq_func was also registered. As a
result when we tried to probe for the card, an interrupt was generated
and in the ISR we tried to dereference private_data. But private_data
is still NULL as we have not yet done snd_mts64_create(). Lets probe
for the card after mts64 is created.

Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Fixes: 94a573500d48 ("ALSA: mts64: use new parport device model")
Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: mts64: use new parport device model</title>
<updated>2016-02-22T14:01:43+00:00</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-02-22T13:22:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=94a573500d48e780e5b23d307d6e6b05e6af7d2a'/>
<id>94a573500d48e780e5b23d307d6e6b05e6af7d2a</id>
<content type='text'>
Modify mts64 driver to use the new parallel port device model.
The advantage of using the device model is that the driver gets binded
to the hardware, we get the feature of hotplug, we can bind/unbind the
driver at runtime.
The changes are in the way the driver gets registered with the parallel
port subsystem and the temporary device to probe mts64 card is removed
and mts64_probe() is used in the probe callback.

Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modify mts64 driver to use the new parallel port device model.
The advantage of using the device model is that the driver gets binded
to the hardware, we get the feature of hotplug, we can bind/unbind the
driver at runtime.
The changes are in the way the driver gets registered with the parallel
port subsystem and the temporary device to probe mts64 card is removed
and mts64_probe() is used in the probe callback.

Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: portman2x4 - use new parport device model</title>
<updated>2016-02-18T10:19:15+00:00</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-02-17T12:56:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e6a1b7e88046055989b8b59c1d648fda4e606f34'/>
<id>e6a1b7e88046055989b8b59c1d648fda4e606f34</id>
<content type='text'>
Modify portman driver to use the new parallel port device model.
The advantage of using the device model is that the device gets binded
to the hardware, we get the feature of hotplug, we can bind/unbind
the driver at runtime.
The changes are in the way the driver gets registered with the
parallel port subsystem and the temporary device to probe portman card
is removed and portman_probe() is used in the probe callback.

Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modify portman driver to use the new parallel port device model.
The advantage of using the device model is that the device gets binded
to the hardware, we get the feature of hotplug, we can bind/unbind
the driver at runtime.
The changes are in the way the driver gets registered with the
parallel port subsystem and the temporary device to probe portman card
is removed and portman_probe() is used in the probe callback.

Signed-off-by: Sudip Mukherjee &lt;sudip@vectorindia.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: dummy: Implement timer backend switching more safely</title>
<updated>2016-02-08T07:15:35+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2016-02-02T14:27:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ddce57a6f0a2d8d1bfacfa77f06043bc760403c2'/>
<id>ddce57a6f0a2d8d1bfacfa77f06043bc760403c2</id>
<content type='text'>
Currently the selected timer backend is referred at any moment from
the running PCM callbacks.  When the backend is switched, it's
possible to lead to inconsistency from the running backend.  This was
pointed by syzkaller fuzzer, and the commit [7ee96216c31a: ALSA:
dummy: Disable switching timer backend via sysfs] disabled the dynamic
switching for avoiding the crash.

This patch improves the handling of timer backend switching.  It keeps
the reference to the selected backend during the whole operation of an
opened stream so that it won't be changed by other streams.

Together with this change, the hrtimer parameter is reenabled as
writable now.

NOTE: this patch also turned out to fix the still remaining race.
Namely, ops was still replaced dynamically at dummy_pcm_open:

  static int dummy_pcm_open(struct snd_pcm_substream *substream)
  {
  ....
          dummy-&gt;timer_ops = &amp;dummy_systimer_ops;
          if (hrtimer)
                  dummy-&gt;timer_ops = &amp;dummy_hrtimer_ops;

Since dummy-&gt;timer_ops is common among all streams, and when the
replacement happens during accesses of other streams, it may lead to a
crash.  This was actually triggered by syzkaller fuzzer and KASAN.

This patch rewrites the code not to use the ops shared by all streams
any longer, too.

BugLink: http://lkml.kernel.org/r/CACT4Y+aZ+xisrpuM6cOXbL21DuM0yVxPYXf4cD4Md9uw0C3dBQ@mail.gmail.com
Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently the selected timer backend is referred at any moment from
the running PCM callbacks.  When the backend is switched, it's
possible to lead to inconsistency from the running backend.  This was
pointed by syzkaller fuzzer, and the commit [7ee96216c31a: ALSA:
dummy: Disable switching timer backend via sysfs] disabled the dynamic
switching for avoiding the crash.

This patch improves the handling of timer backend switching.  It keeps
the reference to the selected backend during the whole operation of an
opened stream so that it won't be changed by other streams.

Together with this change, the hrtimer parameter is reenabled as
writable now.

NOTE: this patch also turned out to fix the still remaining race.
Namely, ops was still replaced dynamically at dummy_pcm_open:

  static int dummy_pcm_open(struct snd_pcm_substream *substream)
  {
  ....
          dummy-&gt;timer_ops = &amp;dummy_systimer_ops;
          if (hrtimer)
                  dummy-&gt;timer_ops = &amp;dummy_hrtimer_ops;

Since dummy-&gt;timer_ops is common among all streams, and when the
replacement happens during accesses of other streams, it may lead to a
crash.  This was actually triggered by syzkaller fuzzer and KASAN.

This patch rewrites the code not to use the ops shared by all streams
any longer, too.

BugLink: http://lkml.kernel.org/r/CACT4Y+aZ+xisrpuM6cOXbL21DuM0yVxPYXf4cD4Md9uw0C3dBQ@mail.gmail.com
Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: dummy: Disable switching timer backend via sysfs</title>
<updated>2016-01-28T07:13:54+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2016-01-28T06:54:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7ee96216c31aabe1eb42fb91ff50dae9fcd014b2'/>
<id>7ee96216c31aabe1eb42fb91ff50dae9fcd014b2</id>
<content type='text'>
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 &lt;dvyukov@google.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;dvyukov@google.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'sound-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound</title>
<updated>2016-01-17T20:05:31+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-01-17T20:05:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a016af2e70bfca23f2f5de7d8708157b86ea374d'/>
<id>a016af2e70bfca23f2f5de7d8708157b86ea374d</id>
<content type='text'>
Pull sound updates from Takashi Iwai:
 "We've had quite busy weeks in this cycle.  Looking at ALSA core, the
  significant changes are a few fixes wrt timer and sequencer ioctls
  that have been revealed by fuzzer recently.  Other than that, ASoC
  core got a few updates about DAI link handling, but these are rather
  straightforward refactoring.

  In drivers scene, ASoC received quite lots of new drivers in addition
  to bunch of updates for still ongoing Intel Skylake support and
  topology API.  HD-audio gained a new HDMI/DP hotplug notification via
  component.  FireWire got a pile of code refactoring/updates with
  SCS.1x driver integration.

  More highlights are shown below.

  [ NOTE: this contains also many commits for DRM.  This is due to the
    pull of drm stable branch into sound tree, as the base of i915 audio
    component work for HD-audio.  The highlights below don't contain
    these DRM changes, as these are supposed to be pulled via drm tree
    in anyway sooner or later.  ]

  Core:
   - Handful fixes to harden ALSA timer and sequencer ioctls against
     races reported by syzkaller fuzzer
   - Irq description string can be unique to each card; only for
     HD-audio for now

  ASoC:
   - Conversion of the array of DAI links to a list for supporting
     dynamically adding and removing DAI links
   - Topology API enhancements to make everything more component based
     and being able to specify PCM links via topology
   - Some more fixes for the topology code, though it is still not final
     and ready for enabling in production; we really need to get to the
     point where that can be done
   - A pile of changes for Intel SkyLake drivers which hopefully deliver
     some useful initial functionality for systems with this chipset,
     though there is more work still to come
   - Lots of new features and cleanups for the Renesas drivers
   - ANC support for WM5110
   - New drivers: Imagination Technologies IPs, Atmel class D speaker,
     Cirrus CS47L24 and WM1831, Dialog DA7128, Realtek RT5659 and
     RT56156, Rockchip RK3036, TI PC3168A, and AMD ACP
   - Rename PCM1792a driver to be generic pcm179x

  HD-Audio:
   - Use audio component for i915 HDMI/DP hotplug handling
   - On-demand binding with i915 driver
   - bdl_pos_adj parameter adjustment for Baytrail controllers
   - Enable power_save_node for CX20722; this shouldn't lead to
     regression, hopefully
   - Kabylake HDMI/DP codec support
   - Quirks for Lenovo E50-80, Dell Latitude E-series, and other Dell
     machines
   - A few code refactoring

  FireWire:
   - Lots of code cleanup and refactoring
   - Integrate the support of SCS.1x devices into snd-oxfw driver;
     snd-scs1x driver is obsoleted

  USB-audio:
   - Fix possible NULL dereference at disconnection
   - A regression fix for Native Instruments devices

  Misc:
   - A few code cleanups of fm801 driver"

* tag 'sound-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (722 commits)
  ALSA: timer: Code cleanup
  ALSA: timer: Harden slave timer list handling
  ALSA: hda - Add fixup for Dell Latitidue E6540
  ALSA: timer: Fix race among timer ioctls
  ALSA: hda - add codec support for Kabylake display audio codec
  ALSA: timer: Fix double unlink of active_list
  ALSA: usb-audio: Fix mixer ctl regression of Native Instrument devices
  ALSA: hda - fix the headset mic detection problem for a Dell laptop
  ALSA: hda - Fix white noise on Dell Latitude E5550
  ALSA: hda_intel: add card number to irq description
  ALSA: seq: Fix race at timer setup and close
  ALSA: seq: Fix missing NULL check at remove_events ioctl
  ALSA: usb-audio: Avoid calling usb_autopm_put_interface() at disconnect
  ASoC: hdac_hdmi: remove unused hdac_hdmi_query_pin_connlist
  ASoC: AMD: Add missing include file
  ALSA: hda - Fixup inverted internal mic for Lenovo E50-80
  ALSA: usb: Add native DSD support for Oppo HA-1
  ASoC: Make aux_dev more like a generic component
  ASoC: bcm2835: cleanup includes by ordering them alphabetically
  ASoC: AMD: Manage ACP 2.x SRAM banks power
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull sound updates from Takashi Iwai:
 "We've had quite busy weeks in this cycle.  Looking at ALSA core, the
  significant changes are a few fixes wrt timer and sequencer ioctls
  that have been revealed by fuzzer recently.  Other than that, ASoC
  core got a few updates about DAI link handling, but these are rather
  straightforward refactoring.

  In drivers scene, ASoC received quite lots of new drivers in addition
  to bunch of updates for still ongoing Intel Skylake support and
  topology API.  HD-audio gained a new HDMI/DP hotplug notification via
  component.  FireWire got a pile of code refactoring/updates with
  SCS.1x driver integration.

  More highlights are shown below.

  [ NOTE: this contains also many commits for DRM.  This is due to the
    pull of drm stable branch into sound tree, as the base of i915 audio
    component work for HD-audio.  The highlights below don't contain
    these DRM changes, as these are supposed to be pulled via drm tree
    in anyway sooner or later.  ]

  Core:
   - Handful fixes to harden ALSA timer and sequencer ioctls against
     races reported by syzkaller fuzzer
   - Irq description string can be unique to each card; only for
     HD-audio for now

  ASoC:
   - Conversion of the array of DAI links to a list for supporting
     dynamically adding and removing DAI links
   - Topology API enhancements to make everything more component based
     and being able to specify PCM links via topology
   - Some more fixes for the topology code, though it is still not final
     and ready for enabling in production; we really need to get to the
     point where that can be done
   - A pile of changes for Intel SkyLake drivers which hopefully deliver
     some useful initial functionality for systems with this chipset,
     though there is more work still to come
   - Lots of new features and cleanups for the Renesas drivers
   - ANC support for WM5110
   - New drivers: Imagination Technologies IPs, Atmel class D speaker,
     Cirrus CS47L24 and WM1831, Dialog DA7128, Realtek RT5659 and
     RT56156, Rockchip RK3036, TI PC3168A, and AMD ACP
   - Rename PCM1792a driver to be generic pcm179x

  HD-Audio:
   - Use audio component for i915 HDMI/DP hotplug handling
   - On-demand binding with i915 driver
   - bdl_pos_adj parameter adjustment for Baytrail controllers
   - Enable power_save_node for CX20722; this shouldn't lead to
     regression, hopefully
   - Kabylake HDMI/DP codec support
   - Quirks for Lenovo E50-80, Dell Latitude E-series, and other Dell
     machines
   - A few code refactoring

  FireWire:
   - Lots of code cleanup and refactoring
   - Integrate the support of SCS.1x devices into snd-oxfw driver;
     snd-scs1x driver is obsoleted

  USB-audio:
   - Fix possible NULL dereference at disconnection
   - A regression fix for Native Instruments devices

  Misc:
   - A few code cleanups of fm801 driver"

* tag 'sound-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (722 commits)
  ALSA: timer: Code cleanup
  ALSA: timer: Harden slave timer list handling
  ALSA: hda - Add fixup for Dell Latitidue E6540
  ALSA: timer: Fix race among timer ioctls
  ALSA: hda - add codec support for Kabylake display audio codec
  ALSA: timer: Fix double unlink of active_list
  ALSA: usb-audio: Fix mixer ctl regression of Native Instrument devices
  ALSA: hda - fix the headset mic detection problem for a Dell laptop
  ALSA: hda - Fix white noise on Dell Latitude E5550
  ALSA: hda_intel: add card number to irq description
  ALSA: seq: Fix race at timer setup and close
  ALSA: seq: Fix missing NULL check at remove_events ioctl
  ALSA: usb-audio: Avoid calling usb_autopm_put_interface() at disconnect
  ASoC: hdac_hdmi: remove unused hdac_hdmi_query_pin_connlist
  ASoC: AMD: Add missing include file
  ALSA: hda - Fixup inverted internal mic for Lenovo E50-80
  ALSA: usb: Add native DSD support for Oppo HA-1
  ASoC: Make aux_dev more like a generic component
  ASoC: bcm2835: cleanup includes by ordering them alphabetically
  ASoC: AMD: Manage ACP 2.x SRAM banks power
  ...
</pre>
</div>
</content>
</entry>
</feed>
