<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/sound, branch v4.4.21</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: timer: fix NULL pointer dereference on memory allocation failure</title>
<updated>2016-09-15T06:27:54+00:00</updated>
<author>
<name>Vegard Nossum</name>
<email>vegard.nossum@oracle.com</email>
</author>
<published>2016-08-28T22:33:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f5b004e4edb87ea4c0a72a72191f33d372d08251'/>
<id>f5b004e4edb87ea4c0a72a72191f33d372d08251</id>
<content type='text'>
commit 8ddc05638ee42b18ba4fe99b5fb647fa3ad20456 upstream.

I hit this with syzkaller:

    kasan: CONFIG_KASAN_INLINE enabled
    kasan: GPF could be caused by NULL-ptr deref or user memory access
    general protection fault: 0000 [#1] PREEMPT SMP KASAN
    CPU: 0 PID: 1327 Comm: a.out Not tainted 4.8.0-rc2+ #190
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
    task: ffff88011278d600 task.stack: ffff8801120c0000
    RIP: 0010:[&lt;ffffffff82c8ba07&gt;]  [&lt;ffffffff82c8ba07&gt;] snd_hrtimer_start+0x77/0x100
    RSP: 0018:ffff8801120c7a60  EFLAGS: 00010006
    RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000007
    RDX: 0000000000000009 RSI: 1ffff10023483091 RDI: 0000000000000048
    RBP: ffff8801120c7a78 R08: ffff88011a5cf768 R09: ffff88011a5ba790
    R10: 0000000000000002 R11: ffffed00234b9ef1 R12: ffff880114843980
    R13: ffffffff84213c00 R14: ffff880114843ab0 R15: 0000000000000286
    FS:  00007f72958f3700(0000) GS:ffff88011aa00000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000603001 CR3: 00000001126ab000 CR4: 00000000000006f0
    Stack:
     ffff880114843980 ffff880111eb2dc0 ffff880114843a34 ffff8801120c7ad0
     ffffffff82c81ab1 0000000000000000 ffffffff842138e0 0000000100000000
     ffff880111eb2dd0 ffff880111eb2dc0 0000000000000001 ffff880111eb2dc0
    Call Trace:
     [&lt;ffffffff82c81ab1&gt;] snd_timer_start1+0x331/0x670
     [&lt;ffffffff82c85bfd&gt;] snd_timer_start+0x5d/0xa0
     [&lt;ffffffff82c8795e&gt;] snd_timer_user_ioctl+0x88e/0x2830
     [&lt;ffffffff8159f3a0&gt;] ? __follow_pte.isra.49+0x430/0x430
     [&lt;ffffffff82c870d0&gt;] ? snd_timer_pause+0x80/0x80
     [&lt;ffffffff815a26fa&gt;] ? do_wp_page+0x3aa/0x1c90
     [&lt;ffffffff8132762f&gt;] ? put_prev_entity+0x108f/0x21a0
     [&lt;ffffffff82c870d0&gt;] ? snd_timer_pause+0x80/0x80
     [&lt;ffffffff816b0733&gt;] do_vfs_ioctl+0x193/0x1050
     [&lt;ffffffff813510af&gt;] ? cpuacct_account_field+0x12f/0x1a0
     [&lt;ffffffff816b05a0&gt;] ? ioctl_preallocate+0x200/0x200
     [&lt;ffffffff81002f2f&gt;] ? syscall_trace_enter+0x3cf/0xdb0
     [&lt;ffffffff815045ba&gt;] ? __context_tracking_exit.part.4+0x9a/0x1e0
     [&lt;ffffffff81002b60&gt;] ? exit_to_usermode_loop+0x190/0x190
     [&lt;ffffffff82001a97&gt;] ? check_preemption_disabled+0x37/0x1e0
     [&lt;ffffffff81d93889&gt;] ? security_file_ioctl+0x89/0xb0
     [&lt;ffffffff816b167f&gt;] SyS_ioctl+0x8f/0xc0
     [&lt;ffffffff816b15f0&gt;] ? do_vfs_ioctl+0x1050/0x1050
     [&lt;ffffffff81005524&gt;] do_syscall_64+0x1c4/0x4e0
     [&lt;ffffffff83c32b2a&gt;] entry_SYSCALL64_slow_path+0x25/0x25
    Code: c7 c7 c4 b9 c8 82 48 89 d9 4c 89 ee e8 63 88 7f fe e8 7e 46 7b fe 48 8d 7b 48 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 &lt;0f&gt; b6 04 02 84 c0 74 04 84 c0 7e 65 80 7b 48 00 74 0e e8 52 46
    RIP  [&lt;ffffffff82c8ba07&gt;] snd_hrtimer_start+0x77/0x100
     RSP &lt;ffff8801120c7a60&gt;
    ---[ end trace 5955b08db7f2b029 ]---

This can happen if snd_hrtimer_open() fails to allocate memory and
returns an error, which is currently not checked by snd_timer_open():

    ioctl(SNDRV_TIMER_IOCTL_SELECT)
     - snd_timer_user_tselect()
	- snd_timer_close()
	   - snd_hrtimer_close()
	      - (struct snd_timer *) t-&gt;private_data = NULL
        - snd_timer_open()
           - snd_hrtimer_open()
              - kzalloc() fails; t-&gt;private_data is still NULL

    ioctl(SNDRV_TIMER_IOCTL_START)
     - snd_timer_user_start()
	- snd_timer_start()
	   - snd_timer_start1()
	      - snd_hrtimer_start()
		- t-&gt;private_data == NULL // boom

Signed-off-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 8ddc05638ee42b18ba4fe99b5fb647fa3ad20456 upstream.

I hit this with syzkaller:

    kasan: CONFIG_KASAN_INLINE enabled
    kasan: GPF could be caused by NULL-ptr deref or user memory access
    general protection fault: 0000 [#1] PREEMPT SMP KASAN
    CPU: 0 PID: 1327 Comm: a.out Not tainted 4.8.0-rc2+ #190
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
    task: ffff88011278d600 task.stack: ffff8801120c0000
    RIP: 0010:[&lt;ffffffff82c8ba07&gt;]  [&lt;ffffffff82c8ba07&gt;] snd_hrtimer_start+0x77/0x100
    RSP: 0018:ffff8801120c7a60  EFLAGS: 00010006
    RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000007
    RDX: 0000000000000009 RSI: 1ffff10023483091 RDI: 0000000000000048
    RBP: ffff8801120c7a78 R08: ffff88011a5cf768 R09: ffff88011a5ba790
    R10: 0000000000000002 R11: ffffed00234b9ef1 R12: ffff880114843980
    R13: ffffffff84213c00 R14: ffff880114843ab0 R15: 0000000000000286
    FS:  00007f72958f3700(0000) GS:ffff88011aa00000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000603001 CR3: 00000001126ab000 CR4: 00000000000006f0
    Stack:
     ffff880114843980 ffff880111eb2dc0 ffff880114843a34 ffff8801120c7ad0
     ffffffff82c81ab1 0000000000000000 ffffffff842138e0 0000000100000000
     ffff880111eb2dd0 ffff880111eb2dc0 0000000000000001 ffff880111eb2dc0
    Call Trace:
     [&lt;ffffffff82c81ab1&gt;] snd_timer_start1+0x331/0x670
     [&lt;ffffffff82c85bfd&gt;] snd_timer_start+0x5d/0xa0
     [&lt;ffffffff82c8795e&gt;] snd_timer_user_ioctl+0x88e/0x2830
     [&lt;ffffffff8159f3a0&gt;] ? __follow_pte.isra.49+0x430/0x430
     [&lt;ffffffff82c870d0&gt;] ? snd_timer_pause+0x80/0x80
     [&lt;ffffffff815a26fa&gt;] ? do_wp_page+0x3aa/0x1c90
     [&lt;ffffffff8132762f&gt;] ? put_prev_entity+0x108f/0x21a0
     [&lt;ffffffff82c870d0&gt;] ? snd_timer_pause+0x80/0x80
     [&lt;ffffffff816b0733&gt;] do_vfs_ioctl+0x193/0x1050
     [&lt;ffffffff813510af&gt;] ? cpuacct_account_field+0x12f/0x1a0
     [&lt;ffffffff816b05a0&gt;] ? ioctl_preallocate+0x200/0x200
     [&lt;ffffffff81002f2f&gt;] ? syscall_trace_enter+0x3cf/0xdb0
     [&lt;ffffffff815045ba&gt;] ? __context_tracking_exit.part.4+0x9a/0x1e0
     [&lt;ffffffff81002b60&gt;] ? exit_to_usermode_loop+0x190/0x190
     [&lt;ffffffff82001a97&gt;] ? check_preemption_disabled+0x37/0x1e0
     [&lt;ffffffff81d93889&gt;] ? security_file_ioctl+0x89/0xb0
     [&lt;ffffffff816b167f&gt;] SyS_ioctl+0x8f/0xc0
     [&lt;ffffffff816b15f0&gt;] ? do_vfs_ioctl+0x1050/0x1050
     [&lt;ffffffff81005524&gt;] do_syscall_64+0x1c4/0x4e0
     [&lt;ffffffff83c32b2a&gt;] entry_SYSCALL64_slow_path+0x25/0x25
    Code: c7 c7 c4 b9 c8 82 48 89 d9 4c 89 ee e8 63 88 7f fe e8 7e 46 7b fe 48 8d 7b 48 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 &lt;0f&gt; b6 04 02 84 c0 74 04 84 c0 7e 65 80 7b 48 00 74 0e e8 52 46
    RIP  [&lt;ffffffff82c8ba07&gt;] snd_hrtimer_start+0x77/0x100
     RSP &lt;ffff8801120c7a60&gt;
    ---[ end trace 5955b08db7f2b029 ]---

This can happen if snd_hrtimer_open() fails to allocate memory and
returns an error, which is currently not checked by snd_timer_open():

    ioctl(SNDRV_TIMER_IOCTL_SELECT)
     - snd_timer_user_tselect()
	- snd_timer_close()
	   - snd_hrtimer_close()
	      - (struct snd_timer *) t-&gt;private_data = NULL
        - snd_timer_open()
           - snd_hrtimer_open()
              - kzalloc() fails; t-&gt;private_data is still NULL

    ioctl(SNDRV_TIMER_IOCTL_START)
     - snd_timer_user_start()
	- snd_timer_start()
	   - snd_timer_start1()
	      - snd_hrtimer_start()
		- t-&gt;private_data == NULL // boom

Signed-off-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: timer: fix division by zero after SNDRV_TIMER_IOCTL_CONTINUE</title>
<updated>2016-09-15T06:27:54+00:00</updated>
<author>
<name>Vegard Nossum</name>
<email>vegard.nossum@oracle.com</email>
</author>
<published>2016-08-28T22:33:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6fd91313bfcfd44cebcb2a55dbeeb606ee3cd710'/>
<id>6fd91313bfcfd44cebcb2a55dbeeb606ee3cd710</id>
<content type='text'>
commit 6b760bb2c63a9e322c0e4a0b5daf335ad93d5a33 upstream.

I got this:

    divide error: 0000 [#1] PREEMPT SMP KASAN
    CPU: 1 PID: 1327 Comm: a.out Not tainted 4.8.0-rc2+ #189
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
    task: ffff8801120a9580 task.stack: ffff8801120b0000
    RIP: 0010:[&lt;ffffffff82c8bd9a&gt;]  [&lt;ffffffff82c8bd9a&gt;] snd_hrtimer_callback+0x1da/0x3f0
    RSP: 0018:ffff88011aa87da8  EFLAGS: 00010006
    RAX: 0000000000004f76 RBX: ffff880112655e88 RCX: 0000000000000000
    RDX: 0000000000000000 RSI: ffff880112655ea0 RDI: 0000000000000001
    RBP: ffff88011aa87e00 R08: ffff88013fff905c R09: ffff88013fff9048
    R10: ffff88013fff9050 R11: 00000001050a7b8c R12: ffff880114778a00
    R13: ffff880114778ab4 R14: ffff880114778b30 R15: 0000000000000000
    FS:  00007f071647c700(0000) GS:ffff88011aa80000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000603001 CR3: 0000000112021000 CR4: 00000000000006e0
    Stack:
     0000000000000000 ffff880114778ab8 ffff880112655ea0 0000000000004f76
     ffff880112655ec8 ffff880112655e80 ffff880112655e88 ffff88011aa98fc0
     00000000b97ccf2b dffffc0000000000 ffff88011aa98fc0 ffff88011aa87ef0
    Call Trace:
     &lt;IRQ&gt;
     [&lt;ffffffff813abce7&gt;] __hrtimer_run_queues+0x347/0xa00
     [&lt;ffffffff82c8bbc0&gt;] ? snd_hrtimer_close+0x130/0x130
     [&lt;ffffffff813ab9a0&gt;] ? retrigger_next_event+0x1b0/0x1b0
     [&lt;ffffffff813ae1a6&gt;] ? hrtimer_interrupt+0x136/0x4b0
     [&lt;ffffffff813ae220&gt;] hrtimer_interrupt+0x1b0/0x4b0
     [&lt;ffffffff8120f91e&gt;] local_apic_timer_interrupt+0x6e/0xf0
     [&lt;ffffffff81227ad3&gt;] ? kvm_guest_apic_eoi_write+0x13/0xc0
     [&lt;ffffffff83c35086&gt;] smp_apic_timer_interrupt+0x76/0xa0
     [&lt;ffffffff83c3416c&gt;] apic_timer_interrupt+0x8c/0xa0
     &lt;EOI&gt;
     [&lt;ffffffff83c3239c&gt;] ? _raw_spin_unlock_irqrestore+0x2c/0x60
     [&lt;ffffffff82c8185d&gt;] snd_timer_start1+0xdd/0x670
     [&lt;ffffffff82c87015&gt;] snd_timer_continue+0x45/0x80
     [&lt;ffffffff82c88100&gt;] snd_timer_user_ioctl+0x1030/0x2830
     [&lt;ffffffff8159f3a0&gt;] ? __follow_pte.isra.49+0x430/0x430
     [&lt;ffffffff82c870d0&gt;] ? snd_timer_pause+0x80/0x80
     [&lt;ffffffff815a26fa&gt;] ? do_wp_page+0x3aa/0x1c90
     [&lt;ffffffff815aa4f8&gt;] ? handle_mm_fault+0xbc8/0x27f0
     [&lt;ffffffff815a9930&gt;] ? __pmd_alloc+0x370/0x370
     [&lt;ffffffff82c870d0&gt;] ? snd_timer_pause+0x80/0x80
     [&lt;ffffffff816b0733&gt;] do_vfs_ioctl+0x193/0x1050
     [&lt;ffffffff816b05a0&gt;] ? ioctl_preallocate+0x200/0x200
     [&lt;ffffffff81002f2f&gt;] ? syscall_trace_enter+0x3cf/0xdb0
     [&lt;ffffffff815045ba&gt;] ? __context_tracking_exit.part.4+0x9a/0x1e0
     [&lt;ffffffff81002b60&gt;] ? exit_to_usermode_loop+0x190/0x190
     [&lt;ffffffff82001a97&gt;] ? check_preemption_disabled+0x37/0x1e0
     [&lt;ffffffff81d93889&gt;] ? security_file_ioctl+0x89/0xb0
     [&lt;ffffffff816b167f&gt;] SyS_ioctl+0x8f/0xc0
     [&lt;ffffffff816b15f0&gt;] ? do_vfs_ioctl+0x1050/0x1050
     [&lt;ffffffff81005524&gt;] do_syscall_64+0x1c4/0x4e0
     [&lt;ffffffff83c32b2a&gt;] entry_SYSCALL64_slow_path+0x25/0x25
    Code: e8 fc 42 7b fe 8b 0d 06 8a 50 03 49 0f af cf 48 85 c9 0f 88 7c 01 00 00 48 89 4d a8 e8 e0 42 7b fe 48 8b 45 c0 48 8b 4d a8 48 99 &lt;48&gt; f7 f9 49 01 c7 e8 cb 42 7b fe 48 8b 55 d0 48 b8 00 00 00 00
    RIP  [&lt;ffffffff82c8bd9a&gt;] snd_hrtimer_callback+0x1da/0x3f0
     RSP &lt;ffff88011aa87da8&gt;
    ---[ end trace 6aa380f756a21074 ]---

The problem happens when you call ioctl(SNDRV_TIMER_IOCTL_CONTINUE) on a
completely new/unused timer -- it will have -&gt;sticks == 0, which causes a
divide by 0 in snd_hrtimer_callback().

Signed-off-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6b760bb2c63a9e322c0e4a0b5daf335ad93d5a33 upstream.

I got this:

    divide error: 0000 [#1] PREEMPT SMP KASAN
    CPU: 1 PID: 1327 Comm: a.out Not tainted 4.8.0-rc2+ #189
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
    task: ffff8801120a9580 task.stack: ffff8801120b0000
    RIP: 0010:[&lt;ffffffff82c8bd9a&gt;]  [&lt;ffffffff82c8bd9a&gt;] snd_hrtimer_callback+0x1da/0x3f0
    RSP: 0018:ffff88011aa87da8  EFLAGS: 00010006
    RAX: 0000000000004f76 RBX: ffff880112655e88 RCX: 0000000000000000
    RDX: 0000000000000000 RSI: ffff880112655ea0 RDI: 0000000000000001
    RBP: ffff88011aa87e00 R08: ffff88013fff905c R09: ffff88013fff9048
    R10: ffff88013fff9050 R11: 00000001050a7b8c R12: ffff880114778a00
    R13: ffff880114778ab4 R14: ffff880114778b30 R15: 0000000000000000
    FS:  00007f071647c700(0000) GS:ffff88011aa80000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000603001 CR3: 0000000112021000 CR4: 00000000000006e0
    Stack:
     0000000000000000 ffff880114778ab8 ffff880112655ea0 0000000000004f76
     ffff880112655ec8 ffff880112655e80 ffff880112655e88 ffff88011aa98fc0
     00000000b97ccf2b dffffc0000000000 ffff88011aa98fc0 ffff88011aa87ef0
    Call Trace:
     &lt;IRQ&gt;
     [&lt;ffffffff813abce7&gt;] __hrtimer_run_queues+0x347/0xa00
     [&lt;ffffffff82c8bbc0&gt;] ? snd_hrtimer_close+0x130/0x130
     [&lt;ffffffff813ab9a0&gt;] ? retrigger_next_event+0x1b0/0x1b0
     [&lt;ffffffff813ae1a6&gt;] ? hrtimer_interrupt+0x136/0x4b0
     [&lt;ffffffff813ae220&gt;] hrtimer_interrupt+0x1b0/0x4b0
     [&lt;ffffffff8120f91e&gt;] local_apic_timer_interrupt+0x6e/0xf0
     [&lt;ffffffff81227ad3&gt;] ? kvm_guest_apic_eoi_write+0x13/0xc0
     [&lt;ffffffff83c35086&gt;] smp_apic_timer_interrupt+0x76/0xa0
     [&lt;ffffffff83c3416c&gt;] apic_timer_interrupt+0x8c/0xa0
     &lt;EOI&gt;
     [&lt;ffffffff83c3239c&gt;] ? _raw_spin_unlock_irqrestore+0x2c/0x60
     [&lt;ffffffff82c8185d&gt;] snd_timer_start1+0xdd/0x670
     [&lt;ffffffff82c87015&gt;] snd_timer_continue+0x45/0x80
     [&lt;ffffffff82c88100&gt;] snd_timer_user_ioctl+0x1030/0x2830
     [&lt;ffffffff8159f3a0&gt;] ? __follow_pte.isra.49+0x430/0x430
     [&lt;ffffffff82c870d0&gt;] ? snd_timer_pause+0x80/0x80
     [&lt;ffffffff815a26fa&gt;] ? do_wp_page+0x3aa/0x1c90
     [&lt;ffffffff815aa4f8&gt;] ? handle_mm_fault+0xbc8/0x27f0
     [&lt;ffffffff815a9930&gt;] ? __pmd_alloc+0x370/0x370
     [&lt;ffffffff82c870d0&gt;] ? snd_timer_pause+0x80/0x80
     [&lt;ffffffff816b0733&gt;] do_vfs_ioctl+0x193/0x1050
     [&lt;ffffffff816b05a0&gt;] ? ioctl_preallocate+0x200/0x200
     [&lt;ffffffff81002f2f&gt;] ? syscall_trace_enter+0x3cf/0xdb0
     [&lt;ffffffff815045ba&gt;] ? __context_tracking_exit.part.4+0x9a/0x1e0
     [&lt;ffffffff81002b60&gt;] ? exit_to_usermode_loop+0x190/0x190
     [&lt;ffffffff82001a97&gt;] ? check_preemption_disabled+0x37/0x1e0
     [&lt;ffffffff81d93889&gt;] ? security_file_ioctl+0x89/0xb0
     [&lt;ffffffff816b167f&gt;] SyS_ioctl+0x8f/0xc0
     [&lt;ffffffff816b15f0&gt;] ? do_vfs_ioctl+0x1050/0x1050
     [&lt;ffffffff81005524&gt;] do_syscall_64+0x1c4/0x4e0
     [&lt;ffffffff83c32b2a&gt;] entry_SYSCALL64_slow_path+0x25/0x25
    Code: e8 fc 42 7b fe 8b 0d 06 8a 50 03 49 0f af cf 48 85 c9 0f 88 7c 01 00 00 48 89 4d a8 e8 e0 42 7b fe 48 8b 45 c0 48 8b 4d a8 48 99 &lt;48&gt; f7 f9 49 01 c7 e8 cb 42 7b fe 48 8b 55 d0 48 b8 00 00 00 00
    RIP  [&lt;ffffffff82c8bd9a&gt;] snd_hrtimer_callback+0x1da/0x3f0
     RSP &lt;ffff88011aa87da8&gt;
    ---[ end trace 6aa380f756a21074 ]---

The problem happens when you call ioctl(SNDRV_TIMER_IOCTL_CONTINUE) on a
completely new/unused timer -- it will have -&gt;sticks == 0, which causes a
divide by 0 in snd_hrtimer_callback().

Signed-off-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: timer: fix NULL pointer dereference in read()/ioctl() race</title>
<updated>2016-09-15T06:27:54+00:00</updated>
<author>
<name>Vegard Nossum</name>
<email>vegard.nossum@oracle.com</email>
</author>
<published>2016-08-28T08:13:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6664ad65f31ecb35f4f7d8208036b5dbc7640740'/>
<id>6664ad65f31ecb35f4f7d8208036b5dbc7640740</id>
<content type='text'>
commit 11749e086b2766cccf6217a527ef5c5604ba069c upstream.

I got this with syzkaller:

    ==================================================================
    BUG: KASAN: null-ptr-deref on address 0000000000000020
    Read of size 32 by task syz-executor/22519
    CPU: 1 PID: 22519 Comm: syz-executor Not tainted 4.8.0-rc2+ #169
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2
    014
     0000000000000001 ffff880111a17a00 ffffffff81f9f141 ffff880111a17a90
     ffff880111a17c50 ffff880114584a58 ffff880114584a10 ffff880111a17a80
     ffffffff8161fe3f ffff880100000000 ffff880118d74a48 ffff880118d74a68
    Call Trace:
     [&lt;ffffffff81f9f141&gt;] dump_stack+0x83/0xb2
     [&lt;ffffffff8161fe3f&gt;] kasan_report_error+0x41f/0x4c0
     [&lt;ffffffff8161ff74&gt;] kasan_report+0x34/0x40
     [&lt;ffffffff82c84b54&gt;] ? snd_timer_user_read+0x554/0x790
     [&lt;ffffffff8161e79e&gt;] check_memory_region+0x13e/0x1a0
     [&lt;ffffffff8161e9c1&gt;] kasan_check_read+0x11/0x20
     [&lt;ffffffff82c84b54&gt;] snd_timer_user_read+0x554/0x790
     [&lt;ffffffff82c84600&gt;] ? snd_timer_user_info_compat.isra.5+0x2b0/0x2b0
     [&lt;ffffffff817d0831&gt;] ? proc_fault_inject_write+0x1c1/0x250
     [&lt;ffffffff817d0670&gt;] ? next_tgid+0x2a0/0x2a0
     [&lt;ffffffff8127c278&gt;] ? do_group_exit+0x108/0x330
     [&lt;ffffffff8174653a&gt;] ? fsnotify+0x72a/0xca0
     [&lt;ffffffff81674dfe&gt;] __vfs_read+0x10e/0x550
     [&lt;ffffffff82c84600&gt;] ? snd_timer_user_info_compat.isra.5+0x2b0/0x2b0
     [&lt;ffffffff81674cf0&gt;] ? do_sendfile+0xc50/0xc50
     [&lt;ffffffff81745e10&gt;] ? __fsnotify_update_child_dentry_flags+0x60/0x60
     [&lt;ffffffff8143fec6&gt;] ? kcov_ioctl+0x56/0x190
     [&lt;ffffffff81e5ada2&gt;] ? common_file_perm+0x2e2/0x380
     [&lt;ffffffff81746b0e&gt;] ? __fsnotify_parent+0x5e/0x2b0
     [&lt;ffffffff81d93536&gt;] ? security_file_permission+0x86/0x1e0
     [&lt;ffffffff816728f5&gt;] ? rw_verify_area+0xe5/0x2b0
     [&lt;ffffffff81675355&gt;] vfs_read+0x115/0x330
     [&lt;ffffffff81676371&gt;] SyS_read+0xd1/0x1a0
     [&lt;ffffffff816762a0&gt;] ? vfs_write+0x4b0/0x4b0
     [&lt;ffffffff82001c2c&gt;] ? __this_cpu_preempt_check+0x1c/0x20
     [&lt;ffffffff8150455a&gt;] ? __context_tracking_exit.part.4+0x3a/0x1e0
     [&lt;ffffffff816762a0&gt;] ? vfs_write+0x4b0/0x4b0
     [&lt;ffffffff81005524&gt;] do_syscall_64+0x1c4/0x4e0
     [&lt;ffffffff810052fc&gt;] ? syscall_return_slowpath+0x16c/0x1d0
     [&lt;ffffffff83c3276a&gt;] entry_SYSCALL64_slow_path+0x25/0x25
    ==================================================================

There are a couple of problems that I can see:

 - ioctl(SNDRV_TIMER_IOCTL_SELECT), which potentially sets
   tu-&gt;queue/tu-&gt;tqueue to NULL on memory allocation failure, so read()
   would get a NULL pointer dereference like the above splat

 - the same ioctl() can free tu-&gt;queue/to-&gt;tqueue which means read()
   could potentially see (and dereference) the freed pointer

We can fix both by taking the ioctl_lock mutex when dereferencing
-&gt;queue/-&gt;tqueue, since that's always held over all the ioctl() code.

Just looking at the code I find it likely that there are more problems
here such as tu-&gt;qhead pointing outside the buffer if the size is
changed concurrently using SNDRV_TIMER_IOCTL_PARAMS.

Signed-off-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 11749e086b2766cccf6217a527ef5c5604ba069c upstream.

I got this with syzkaller:

    ==================================================================
    BUG: KASAN: null-ptr-deref on address 0000000000000020
    Read of size 32 by task syz-executor/22519
    CPU: 1 PID: 22519 Comm: syz-executor Not tainted 4.8.0-rc2+ #169
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2
    014
     0000000000000001 ffff880111a17a00 ffffffff81f9f141 ffff880111a17a90
     ffff880111a17c50 ffff880114584a58 ffff880114584a10 ffff880111a17a80
     ffffffff8161fe3f ffff880100000000 ffff880118d74a48 ffff880118d74a68
    Call Trace:
     [&lt;ffffffff81f9f141&gt;] dump_stack+0x83/0xb2
     [&lt;ffffffff8161fe3f&gt;] kasan_report_error+0x41f/0x4c0
     [&lt;ffffffff8161ff74&gt;] kasan_report+0x34/0x40
     [&lt;ffffffff82c84b54&gt;] ? snd_timer_user_read+0x554/0x790
     [&lt;ffffffff8161e79e&gt;] check_memory_region+0x13e/0x1a0
     [&lt;ffffffff8161e9c1&gt;] kasan_check_read+0x11/0x20
     [&lt;ffffffff82c84b54&gt;] snd_timer_user_read+0x554/0x790
     [&lt;ffffffff82c84600&gt;] ? snd_timer_user_info_compat.isra.5+0x2b0/0x2b0
     [&lt;ffffffff817d0831&gt;] ? proc_fault_inject_write+0x1c1/0x250
     [&lt;ffffffff817d0670&gt;] ? next_tgid+0x2a0/0x2a0
     [&lt;ffffffff8127c278&gt;] ? do_group_exit+0x108/0x330
     [&lt;ffffffff8174653a&gt;] ? fsnotify+0x72a/0xca0
     [&lt;ffffffff81674dfe&gt;] __vfs_read+0x10e/0x550
     [&lt;ffffffff82c84600&gt;] ? snd_timer_user_info_compat.isra.5+0x2b0/0x2b0
     [&lt;ffffffff81674cf0&gt;] ? do_sendfile+0xc50/0xc50
     [&lt;ffffffff81745e10&gt;] ? __fsnotify_update_child_dentry_flags+0x60/0x60
     [&lt;ffffffff8143fec6&gt;] ? kcov_ioctl+0x56/0x190
     [&lt;ffffffff81e5ada2&gt;] ? common_file_perm+0x2e2/0x380
     [&lt;ffffffff81746b0e&gt;] ? __fsnotify_parent+0x5e/0x2b0
     [&lt;ffffffff81d93536&gt;] ? security_file_permission+0x86/0x1e0
     [&lt;ffffffff816728f5&gt;] ? rw_verify_area+0xe5/0x2b0
     [&lt;ffffffff81675355&gt;] vfs_read+0x115/0x330
     [&lt;ffffffff81676371&gt;] SyS_read+0xd1/0x1a0
     [&lt;ffffffff816762a0&gt;] ? vfs_write+0x4b0/0x4b0
     [&lt;ffffffff82001c2c&gt;] ? __this_cpu_preempt_check+0x1c/0x20
     [&lt;ffffffff8150455a&gt;] ? __context_tracking_exit.part.4+0x3a/0x1e0
     [&lt;ffffffff816762a0&gt;] ? vfs_write+0x4b0/0x4b0
     [&lt;ffffffff81005524&gt;] do_syscall_64+0x1c4/0x4e0
     [&lt;ffffffff810052fc&gt;] ? syscall_return_slowpath+0x16c/0x1d0
     [&lt;ffffffff83c3276a&gt;] entry_SYSCALL64_slow_path+0x25/0x25
    ==================================================================

There are a couple of problems that I can see:

 - ioctl(SNDRV_TIMER_IOCTL_SELECT), which potentially sets
   tu-&gt;queue/tu-&gt;tqueue to NULL on memory allocation failure, so read()
   would get a NULL pointer dereference like the above splat

 - the same ioctl() can free tu-&gt;queue/to-&gt;tqueue which means read()
   could potentially see (and dereference) the freed pointer

We can fix both by taking the ioctl_lock mutex when dereferencing
-&gt;queue/-&gt;tqueue, since that's always held over all the ioctl() code.

Just looking at the code I find it likely that there are more problems
here such as tu-&gt;qhead pointing outside the buffer if the size is
changed concurrently using SNDRV_TIMER_IOCTL_PARAMS.

Signed-off-by: Vegard Nossum &lt;vegard.nossum@oracle.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: hda - Enable subwoofer on Dell Inspiron 7559</title>
<updated>2016-09-15T06:27:54+00:00</updated>
<author>
<name>Kai-Heng Feng</name>
<email>kai.heng.feng@canonical.com</email>
</author>
<published>2016-08-30T07:36:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=857fbd7a74d2cb1a396f4733536e10e74c4908a6'/>
<id>857fbd7a74d2cb1a396f4733536e10e74c4908a6</id>
<content type='text'>
commit fd06c77eb9200b53d421da5fffe0dcd894b5d72a upstream.

The subwoofer on Inspiron 7559 was disabled originally.
Applying a pin fixup to node 0x1b can enable it and make it work.

Old pin: 0x411111f0
New pin: 0x90170151

Signed-off-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit fd06c77eb9200b53d421da5fffe0dcd894b5d72a upstream.

The subwoofer on Inspiron 7559 was disabled originally.
Applying a pin fixup to node 0x1b can enable it and make it work.

Old pin: 0x411111f0
New pin: 0x90170151

Signed-off-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: hda - Add headset mic quirk for Dell Inspiron 5468</title>
<updated>2016-09-15T06:27:53+00:00</updated>
<author>
<name>Shrirang Bagul</name>
<email>shrirang.bagul@canonical.com</email>
</author>
<published>2016-08-29T07:19:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=eea36eb2c42be7e1eba65bb17cfa1018270184b1'/>
<id>eea36eb2c42be7e1eba65bb17cfa1018270184b1</id>
<content type='text'>
commit 311042d1b67d9a1856a8e1294e7729fb86f64014 upstream.

This patch enables headset microphone on some variants of
Dell Inspiron 5468. (Dell SSID 0x07ad)

BugLink: https://bugs.launchpad.net/bugs/1617900
Signed-off-by: Shrirang Bagul &lt;shrirang.bagul@canonical.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 311042d1b67d9a1856a8e1294e7729fb86f64014 upstream.

This patch enables headset microphone on some variants of
Dell Inspiron 5468. (Dell SSID 0x07ad)

BugLink: https://bugs.launchpad.net/bugs/1617900
Signed-off-by: Shrirang Bagul &lt;shrirang.bagul@canonical.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: rawmidi: Fix possible deadlock with virmidi registration</title>
<updated>2016-09-15T06:27:53+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2016-08-30T12:45:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=42c51d003bfd58b3d1bc966ad25f69c5b4974f9b'/>
<id>42c51d003bfd58b3d1bc966ad25f69c5b4974f9b</id>
<content type='text'>
commit 816f318b2364262a51024096da7ca3b84e78e3b5 upstream.

When a seq-virmidi driver is initialized, it registers a rawmidi
instance with its callback to create an associated seq kernel client.
Currently it's done throughly in rawmidi's register_mutex context.
Recently it was found that this may lead to a deadlock another rawmidi
device that is being attached with the sequencer is accessed, as both
open with the same register_mutex.  This was actually triggered by
syzkaller, as Dmitry Vyukov reported:

======================================================
 [ INFO: possible circular locking dependency detected ]
 4.8.0-rc1+ #11 Not tainted
 -------------------------------------------------------
 syz-executor/7154 is trying to acquire lock:
  (register_mutex#5){+.+.+.}, at: [&lt;ffffffff84fd6d4b&gt;] snd_rawmidi_kernel_open+0x4b/0x260 sound/core/rawmidi.c:341

 but task is already holding lock:
  (&amp;grp-&gt;list_mutex){++++.+}, at: [&lt;ffffffff850138bb&gt;] check_and_subscribe_port+0x5b/0x5c0 sound/core/seq/seq_ports.c:495

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -&gt; #1 (&amp;grp-&gt;list_mutex){++++.+}:
    [&lt;ffffffff8147a3a8&gt;] lock_acquire+0x208/0x430 kernel/locking/lockdep.c:3746
    [&lt;ffffffff863f6199&gt;] down_read+0x49/0xc0 kernel/locking/rwsem.c:22
    [&lt;     inline     &gt;] deliver_to_subscribers sound/core/seq/seq_clientmgr.c:681
    [&lt;ffffffff85005c5e&gt;] snd_seq_deliver_event+0x35e/0x890 sound/core/seq/seq_clientmgr.c:822
    [&lt;ffffffff85006e96&gt;] &gt; snd_seq_kernel_client_dispatch+0x126/0x170 sound/core/seq/seq_clientmgr.c:2418
    [&lt;ffffffff85012c52&gt;] snd_seq_system_broadcast+0xb2/0xf0 sound/core/seq/seq_system.c:101
    [&lt;ffffffff84fff70a&gt;] snd_seq_create_kernel_client+0x24a/0x330 sound/core/seq/seq_clientmgr.c:2297
    [&lt;     inline     &gt;] snd_virmidi_dev_attach_seq sound/core/seq/seq_virmidi.c:383
    [&lt;ffffffff8502d29f&gt;] snd_virmidi_dev_register+0x29f/0x750 sound/core/seq/seq_virmidi.c:450
    [&lt;ffffffff84fd208c&gt;] snd_rawmidi_dev_register+0x30c/0xd40 sound/core/rawmidi.c:1645
    [&lt;ffffffff84f816d3&gt;] __snd_device_register.part.0+0x63/0xc0 sound/core/device.c:164
    [&lt;     inline     &gt;] __snd_device_register sound/core/device.c:162
    [&lt;ffffffff84f8235d&gt;] snd_device_register_all+0xad/0x110 sound/core/device.c:212
    [&lt;ffffffff84f7546f&gt;] snd_card_register+0xef/0x6c0 sound/core/init.c:749
    [&lt;ffffffff85040b7f&gt;] snd_virmidi_probe+0x3ef/0x590 sound/drivers/virmidi.c:123
    [&lt;ffffffff833ebf7b&gt;] platform_drv_probe+0x8b/0x170 drivers/base/platform.c:564
    ......

 -&gt; #0 (register_mutex#5){+.+.+.}:
    [&lt;     inline     &gt;] check_prev_add kernel/locking/lockdep.c:1829
    [&lt;     inline     &gt;] check_prevs_add kernel/locking/lockdep.c:1939
    [&lt;     inline     &gt;] validate_chain kernel/locking/lockdep.c:2266
    [&lt;ffffffff814791f4&gt;] __lock_acquire+0x4d44/0x4d80 kernel/locking/lockdep.c:3335
    [&lt;ffffffff8147a3a8&gt;] lock_acquire+0x208/0x430 kernel/locking/lockdep.c:3746
    [&lt;     inline     &gt;] __mutex_lock_common kernel/locking/mutex.c:521
    [&lt;ffffffff863f0ef1&gt;] mutex_lock_nested+0xb1/0xa20 kernel/locking/mutex.c:621
    [&lt;ffffffff84fd6d4b&gt;] snd_rawmidi_kernel_open+0x4b/0x260 sound/core/rawmidi.c:341
    [&lt;ffffffff8502e7c7&gt;] midisynth_subscribe+0xf7/0x350 sound/core/seq/seq_midi.c:188
    [&lt;     inline     &gt;] subscribe_port sound/core/seq/seq_ports.c:427
    [&lt;ffffffff85013cc7&gt;] check_and_subscribe_port+0x467/0x5c0 sound/core/seq/seq_ports.c:510
    [&lt;ffffffff85015da9&gt;] snd_seq_port_connect+0x2c9/0x500 sound/core/seq/seq_ports.c:579
    [&lt;ffffffff850079b8&gt;] snd_seq_ioctl_subscribe_port+0x1d8/0x2b0 sound/core/seq/seq_clientmgr.c:1480
    [&lt;ffffffff84ffe9e4&gt;] snd_seq_do_ioctl+0x184/0x1e0 sound/core/seq/seq_clientmgr.c:2225
    [&lt;ffffffff84ffeae8&gt;] snd_seq_kernel_client_ctl+0xa8/0x110 sound/core/seq/seq_clientmgr.c:2440
    [&lt;ffffffff85027664&gt;] snd_seq_oss_midi_open+0x3b4/0x610 sound/core/seq/oss/seq_oss_midi.c:375
    [&lt;ffffffff85023d67&gt;] snd_seq_oss_synth_setup_midi+0x107/0x4c0 sound/core/seq/oss/seq_oss_synth.c:281
    [&lt;ffffffff8501b0a8&gt;] snd_seq_oss_open+0x748/0x8d0 sound/core/seq/oss/seq_oss_init.c:274
    [&lt;ffffffff85019d8a&gt;] odev_open+0x6a/0x90 sound/core/seq/oss/seq_oss.c:138
    [&lt;ffffffff84f7040f&gt;] soundcore_open+0x30f/0x640 sound/sound_core.c:639
    ......

 other info that might help us debug this:

 Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(&amp;grp-&gt;list_mutex);
                                lock(register_mutex#5);
                                lock(&amp;grp-&gt;list_mutex);
   lock(register_mutex#5);

 *** DEADLOCK ***
======================================================

The fix is to simply move the registration parts in
snd_rawmidi_dev_register() to the outside of the register_mutex lock.
The lock is needed only to manage the linked list, and it's not
necessarily to cover the whole initialization process.

Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 816f318b2364262a51024096da7ca3b84e78e3b5 upstream.

When a seq-virmidi driver is initialized, it registers a rawmidi
instance with its callback to create an associated seq kernel client.
Currently it's done throughly in rawmidi's register_mutex context.
Recently it was found that this may lead to a deadlock another rawmidi
device that is being attached with the sequencer is accessed, as both
open with the same register_mutex.  This was actually triggered by
syzkaller, as Dmitry Vyukov reported:

======================================================
 [ INFO: possible circular locking dependency detected ]
 4.8.0-rc1+ #11 Not tainted
 -------------------------------------------------------
 syz-executor/7154 is trying to acquire lock:
  (register_mutex#5){+.+.+.}, at: [&lt;ffffffff84fd6d4b&gt;] snd_rawmidi_kernel_open+0x4b/0x260 sound/core/rawmidi.c:341

 but task is already holding lock:
  (&amp;grp-&gt;list_mutex){++++.+}, at: [&lt;ffffffff850138bb&gt;] check_and_subscribe_port+0x5b/0x5c0 sound/core/seq/seq_ports.c:495

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -&gt; #1 (&amp;grp-&gt;list_mutex){++++.+}:
    [&lt;ffffffff8147a3a8&gt;] lock_acquire+0x208/0x430 kernel/locking/lockdep.c:3746
    [&lt;ffffffff863f6199&gt;] down_read+0x49/0xc0 kernel/locking/rwsem.c:22
    [&lt;     inline     &gt;] deliver_to_subscribers sound/core/seq/seq_clientmgr.c:681
    [&lt;ffffffff85005c5e&gt;] snd_seq_deliver_event+0x35e/0x890 sound/core/seq/seq_clientmgr.c:822
    [&lt;ffffffff85006e96&gt;] &gt; snd_seq_kernel_client_dispatch+0x126/0x170 sound/core/seq/seq_clientmgr.c:2418
    [&lt;ffffffff85012c52&gt;] snd_seq_system_broadcast+0xb2/0xf0 sound/core/seq/seq_system.c:101
    [&lt;ffffffff84fff70a&gt;] snd_seq_create_kernel_client+0x24a/0x330 sound/core/seq/seq_clientmgr.c:2297
    [&lt;     inline     &gt;] snd_virmidi_dev_attach_seq sound/core/seq/seq_virmidi.c:383
    [&lt;ffffffff8502d29f&gt;] snd_virmidi_dev_register+0x29f/0x750 sound/core/seq/seq_virmidi.c:450
    [&lt;ffffffff84fd208c&gt;] snd_rawmidi_dev_register+0x30c/0xd40 sound/core/rawmidi.c:1645
    [&lt;ffffffff84f816d3&gt;] __snd_device_register.part.0+0x63/0xc0 sound/core/device.c:164
    [&lt;     inline     &gt;] __snd_device_register sound/core/device.c:162
    [&lt;ffffffff84f8235d&gt;] snd_device_register_all+0xad/0x110 sound/core/device.c:212
    [&lt;ffffffff84f7546f&gt;] snd_card_register+0xef/0x6c0 sound/core/init.c:749
    [&lt;ffffffff85040b7f&gt;] snd_virmidi_probe+0x3ef/0x590 sound/drivers/virmidi.c:123
    [&lt;ffffffff833ebf7b&gt;] platform_drv_probe+0x8b/0x170 drivers/base/platform.c:564
    ......

 -&gt; #0 (register_mutex#5){+.+.+.}:
    [&lt;     inline     &gt;] check_prev_add kernel/locking/lockdep.c:1829
    [&lt;     inline     &gt;] check_prevs_add kernel/locking/lockdep.c:1939
    [&lt;     inline     &gt;] validate_chain kernel/locking/lockdep.c:2266
    [&lt;ffffffff814791f4&gt;] __lock_acquire+0x4d44/0x4d80 kernel/locking/lockdep.c:3335
    [&lt;ffffffff8147a3a8&gt;] lock_acquire+0x208/0x430 kernel/locking/lockdep.c:3746
    [&lt;     inline     &gt;] __mutex_lock_common kernel/locking/mutex.c:521
    [&lt;ffffffff863f0ef1&gt;] mutex_lock_nested+0xb1/0xa20 kernel/locking/mutex.c:621
    [&lt;ffffffff84fd6d4b&gt;] snd_rawmidi_kernel_open+0x4b/0x260 sound/core/rawmidi.c:341
    [&lt;ffffffff8502e7c7&gt;] midisynth_subscribe+0xf7/0x350 sound/core/seq/seq_midi.c:188
    [&lt;     inline     &gt;] subscribe_port sound/core/seq/seq_ports.c:427
    [&lt;ffffffff85013cc7&gt;] check_and_subscribe_port+0x467/0x5c0 sound/core/seq/seq_ports.c:510
    [&lt;ffffffff85015da9&gt;] snd_seq_port_connect+0x2c9/0x500 sound/core/seq/seq_ports.c:579
    [&lt;ffffffff850079b8&gt;] snd_seq_ioctl_subscribe_port+0x1d8/0x2b0 sound/core/seq/seq_clientmgr.c:1480
    [&lt;ffffffff84ffe9e4&gt;] snd_seq_do_ioctl+0x184/0x1e0 sound/core/seq/seq_clientmgr.c:2225
    [&lt;ffffffff84ffeae8&gt;] snd_seq_kernel_client_ctl+0xa8/0x110 sound/core/seq/seq_clientmgr.c:2440
    [&lt;ffffffff85027664&gt;] snd_seq_oss_midi_open+0x3b4/0x610 sound/core/seq/oss/seq_oss_midi.c:375
    [&lt;ffffffff85023d67&gt;] snd_seq_oss_synth_setup_midi+0x107/0x4c0 sound/core/seq/oss/seq_oss_synth.c:281
    [&lt;ffffffff8501b0a8&gt;] snd_seq_oss_open+0x748/0x8d0 sound/core/seq/oss/seq_oss_init.c:274
    [&lt;ffffffff85019d8a&gt;] odev_open+0x6a/0x90 sound/core/seq/oss/seq_oss.c:138
    [&lt;ffffffff84f7040f&gt;] soundcore_open+0x30f/0x640 sound/sound_core.c:639
    ......

 other info that might help us debug this:

 Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(&amp;grp-&gt;list_mutex);
                                lock(register_mutex#5);
                                lock(&amp;grp-&gt;list_mutex);
   lock(register_mutex#5);

 *** DEADLOCK ***
======================================================

The fix is to simply move the registration parts in
snd_rawmidi_dev_register() to the outside of the register_mutex lock.
The lock is needed only to manage the linked list, and it's not
necessarily to cover the whole initialization process.

Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: fireworks: accessing to user space outside spinlock</title>
<updated>2016-09-15T06:27:53+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2016-08-31T13:58:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e6c4138bc1e6021be12eba70bb90a2ea2a3dc96a'/>
<id>e6c4138bc1e6021be12eba70bb90a2ea2a3dc96a</id>
<content type='text'>
commit 6b1ca4bcadf9ef077cc5f03c6822ba276ed14902 upstream.

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 &lt;vaishali.thakkar@oracle.com&gt;
Fixes: 555e8a8f7f14('ALSA: fireworks: Add command/response functionality into hwdep interface')
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6b1ca4bcadf9ef077cc5f03c6822ba276ed14902 upstream.

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 &lt;vaishali.thakkar@oracle.com&gt;
Fixes: 555e8a8f7f14('ALSA: fireworks: Add command/response functionality into hwdep interface')
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: firewire-tascam: accessing to user space outside spinlock</title>
<updated>2016-09-15T06:27:53+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2016-08-31T11:15:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ad3bccfd7d6c0d9b263977492f2f712f1859b5b2'/>
<id>ad3bccfd7d6c0d9b263977492f2f712f1859b5b2</id>
<content type='text'>
commit 04b2d9c9c319277ad4fbbb71855c256a9f4d5f98 upstream.

In hwdep interface of firewire-tascam 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 handle 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 doesn't handle usual interrupts
from hardware.

This commit fixes this bug, by performing the accessing outside spinlock.

Reported-by: Vaishali Thakkar &lt;vaishali.thakkar@oracle.com&gt;
Fixes: e5e0c3dd257b('ALSA: firewire-tascam: add hwdep interface')
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 04b2d9c9c319277ad4fbbb71855c256a9f4d5f98 upstream.

In hwdep interface of firewire-tascam 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 handle 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 doesn't handle usual interrupts
from hardware.

This commit fixes this bug, by performing the accessing outside spinlock.

Reported-by: Vaishali Thakkar &lt;vaishali.thakkar@oracle.com&gt;
Fixes: e5e0c3dd257b('ALSA: firewire-tascam: add hwdep interface')
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: usb-audio: Add sample rate inquiry quirk for B850V3 CP2114</title>
<updated>2016-09-15T06:27:53+00:00</updated>
<author>
<name>Ken Lin</name>
<email>ken.lin@advantech.com.tw</email>
</author>
<published>2016-08-12T18:08:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9947ec2c04d30412a06e45a4af03f28c2d76d1f6'/>
<id>9947ec2c04d30412a06e45a4af03f28c2d76d1f6</id>
<content type='text'>
commit 83d9956b7e6b310c1062df7894257251c625b22e upstream.

Avoid getting sample rate on B850V3 CP2114 as it is unsupported and
causes noisy "current rate is different from the runtime rate" messages
when playback starts.

Signed-off-by: Ken Lin &lt;ken.lin@advantech.com.tw&gt;
Signed-off-by: Akshay Bhat &lt;akshay.bhat@timesys.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 83d9956b7e6b310c1062df7894257251c625b22e upstream.

Avoid getting sample rate on B850V3 CP2114 as it is unsupported and
causes noisy "current rate is different from the runtime rate" messages
when playback starts.

Signed-off-by: Ken Lin &lt;ken.lin@advantech.com.tw&gt;
Signed-off-by: Akshay Bhat &lt;akshay.bhat@timesys.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ASoC: atmel_ssc_dai: Don't unconditionally reset SSC on stream startup</title>
<updated>2016-09-15T06:27:52+00:00</updated>
<author>
<name>Christoph Huber</name>
<email>c.huber@bct-electronic.com</email>
</author>
<published>2016-08-15T16:59:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4757f7ed8e9473d03074e3a315158492856a9f56'/>
<id>4757f7ed8e9473d03074e3a315158492856a9f56</id>
<content type='text'>
commit 3e103a65514c2947e53f3171b21255fbde8b60c6 upstream.

commit cbaadf0f90d6 ("ASoC: atmel_ssc_dai: refactor the startup and
shutdown") refactored code such that the SSC is reset on every
startup; this breaks duplex audio (e.g. first start audio playback,
then start record, causing the playback to stop/hang)

Fixes: cbaadf0f90d6 (ASoC: atmel_ssc_dai: refactor the startup and shutdown)
Signed-off-by: Christoph Huber &lt;c.huber@bct-electronic.com&gt;
Signed-off-by: Peter Meerwald-Stadler &lt;p.meerwald@bct-electronic.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 3e103a65514c2947e53f3171b21255fbde8b60c6 upstream.

commit cbaadf0f90d6 ("ASoC: atmel_ssc_dai: refactor the startup and
shutdown") refactored code such that the SSC is reset on every
startup; this breaks duplex audio (e.g. first start audio playback,
then start record, causing the playback to stop/hang)

Fixes: cbaadf0f90d6 (ASoC: atmel_ssc_dai: refactor the startup and shutdown)
Signed-off-by: Christoph Huber &lt;c.huber@bct-electronic.com&gt;
Signed-off-by: Peter Meerwald-Stadler &lt;p.meerwald@bct-electronic.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
