linux-sg2042/sound/core
Takashi Iwai 66efdc71d9 ALSA: seq: Fix missing error handling in snd_seq_timer_open()
snd_seq_timer_open() didn't catch the whole error path but let through
if the timer id is a slave.  This may lead to Oops by accessing the
uninitialized pointer.

 BUG: unable to handle kernel NULL pointer dereference at 00000000000002ae
 IP: [<ffffffff819b3477>] snd_seq_timer_open+0xe7/0x130
 PGD 785cd067 PUD 76964067 PMD 0
 Oops: 0002 [#4] SMP
 CPU 0
 Pid: 4288, comm: trinity-child7 Tainted: G      D W 3.9.0-rc1+ #100 Bochs Bochs
 RIP: 0010:[<ffffffff819b3477>]  [<ffffffff819b3477>] snd_seq_timer_open+0xe7/0x130
 RSP: 0018:ffff88006ece7d38  EFLAGS: 00010246
 RAX: 0000000000000286 RBX: ffff88007851b400 RCX: 0000000000000000
 RDX: 000000000000ffff RSI: ffff88006ece7d58 RDI: ffff88006ece7d38
 RBP: ffff88006ece7d98 R08: 000000000000000a R09: 000000000000fffe
 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
 R13: ffff8800792c5400 R14: 0000000000e8f000 R15: 0000000000000007
 FS:  00007f7aaa650700(0000) GS:ffff88007f800000(0000) GS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 00000000000002ae CR3: 000000006efec000 CR4: 00000000000006f0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process trinity-child7 (pid: 4288, threadinfo ffff88006ece6000, task ffff880076a8a290)
 Stack:
  0000000000000286 ffffffff828f2be0 ffff88006ece7d58 ffffffff810f354d
  65636e6575716573 2065756575712072 ffff8800792c0030 0000000000000000
  ffff88006ece7d98 ffff8800792c5400 ffff88007851b400 ffff8800792c5520
 Call Trace:
  [<ffffffff810f354d>] ? trace_hardirqs_on+0xd/0x10
  [<ffffffff819b17e9>] snd_seq_queue_timer_open+0x29/0x70
  [<ffffffff819ae01a>] snd_seq_ioctl_set_queue_timer+0xda/0x120
  [<ffffffff819acb9b>] snd_seq_do_ioctl+0x9b/0xd0
  [<ffffffff819acbe0>] snd_seq_ioctl+0x10/0x20
  [<ffffffff811b9542>] do_vfs_ioctl+0x522/0x570
  [<ffffffff8130a4b3>] ? file_has_perm+0x83/0xa0
  [<ffffffff810f354d>] ? trace_hardirqs_on+0xd/0x10
  [<ffffffff811b95ed>] sys_ioctl+0x5d/0xa0
  [<ffffffff813663fe>] ? trace_hardirqs_on_thunk+0x3a/0x3f
  [<ffffffff81faed69>] system_call_fastpath+0x16/0x1b

Reported-and-tested-by: Tommi Rantala <tt.rantala@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-11 09:40:36 +01:00
..
oss ALSA: core: fix NULL checking in snd_pcm_plug_slave_size() 2012-11-14 08:03:31 +01:00
seq ALSA: seq: Fix missing error handling in snd_seq_timer_open() 2013-03-11 09:40:36 +01:00
Kconfig Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound 2012-01-17 10:48:13 -08:00
Makefile Merge branch 'topic/hda' into for-linus 2012-01-12 09:59:18 +01:00
compress_offload.c ALSA: compress: add support for gapless playback 2013-02-14 12:30:22 +01:00
control.c ALSA: Avoid endless sleep after disconnect 2012-10-30 11:07:15 +01:00
control_compat.c ALSA: control: add support for ENUMERATED user space controls 2011-10-09 09:09:11 +02:00
ctljack.c ALSA: hda - Add missing inclusion of linux/export.h 2011-11-16 14:28:33 +01:00
device.c sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where needed 2011-10-31 19:31:22 -04:00
hrtimer.c ALSA: hrtimer: remove superfluous tasklet invocation 2011-02-10 18:53:32 +01:00
hwdep.c ALSA: Avoid endless sleep after disconnect 2012-10-30 11:07:15 +01:00
hwdep_compat.c
info.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
info_oss.c ALSA: remove the main version information 2012-09-04 11:38:32 +02:00
init.c ALSA: Add a reference counter to card instance 2012-10-30 11:07:10 +01:00
isadma.c sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where needed 2011-10-31 19:31:22 -04:00
jack.c ALSA: jack: Update documention to reflect other userspace interfaces 2012-05-07 18:11:37 +02:00
memalloc.c treewide: Correct spelling of successfully in comments 2011-09-27 18:08:04 +02:00
memory.c sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where needed 2011-10-31 19:31:22 -04:00
misc.c sound: use printk_get_level and printk_skip_level 2012-07-30 17:25:14 -07:00
pcm.c ALSA: PCM: Remove redundant null check before kfree 2012-11-21 10:43:26 +01:00
pcm_compat.c ALSA: core: fix 64-bit SNDRV_PCM_IOCTL_STATUS ABI breakage 2012-10-28 09:52:37 +01:00
pcm_lib.c ALSA: core: add hooks for audio timestamps 2012-10-23 16:13:48 +02:00
pcm_memory.c ALSA: Make snd_sgbuf_get_{ptr|addr}() available for non-SG cases 2012-09-23 11:24:42 +02:00
pcm_misc.c ALSA: pcm: Add snd_pcm_rate_bit_to_rate() 2012-06-18 09:38:58 +02:00
pcm_native.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
pcm_timer.c ALSA: sound/core/pcm_timer.c: use lib/gcd.c 2009-12-22 08:24:35 +01:00
rawmidi.c ALSA: Avoid endless sleep after disconnect 2012-10-30 11:07:15 +01:00
rawmidi_compat.c
rtctimer.c ALSA: rtctimer.c needs module.h 2011-07-30 08:03:35 +02:00
sgbuf.c ALSA: Make snd_sgbuf_get_{ptr|addr}() available for non-SG cases 2012-09-23 11:24:42 +02:00
sound.c ALSA: Fix card refcount unbalance 2012-11-08 14:36:18 +01:00
sound_oss.c ALSA: Fix card refcount unbalance 2012-11-08 14:36:18 +01:00
timer.c device.h: cleanup users outside of linux/include (C files) 2012-03-11 14:27:37 -04:00
timer_compat.c ALSA: Kill snd_assert() in sound/core/* 2008-08-13 11:46:35 +02:00
vmaster.c ALSA: vmaster: Fix slave change notification 2013-03-05 15:43:39 +01:00