stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Takashi Iwai <tiwai@suse.de>
Subject: [ 17/40] ALSA: seq: Fix missing error handling in snd_seq_timer_open()
Date: Mon, 18 Mar 2013 14:10:55 -0700	[thread overview]
Message-ID: <20130318211017.488030405@linuxfoundation.org> (raw)
In-Reply-To: <20130318211016.254453918@linuxfoundation.org>

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <tiwai@suse.de>

commit 66efdc71d95887b652a742a5dae51fa834d71465 upstream.

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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/core/seq/seq_timer.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/sound/core/seq/seq_timer.c
+++ b/sound/core/seq/seq_timer.c
@@ -290,10 +290,10 @@ int snd_seq_timer_open(struct snd_seq_qu
 			tid.device = SNDRV_TIMER_GLOBAL_SYSTEM;
 			err = snd_timer_open(&t, str, &tid, q->queue);
 		}
-		if (err < 0) {
-			snd_printk(KERN_ERR "seq fatal error: cannot create timer (%i)\n", err);
-			return err;
-		}
+	}
+	if (err < 0) {
+		snd_printk(KERN_ERR "seq fatal error: cannot create timer (%i)\n", err);
+		return err;
 	}
 	t->callback = snd_seq_timer_interrupt;
 	t->callback_data = q;



  parent reply	other threads:[~2013-03-18 21:10 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-18 21:10 [ 00/40] 3.0.70-stable review Greg Kroah-Hartman
2013-03-18 21:10 ` [ 01/40] qcaux: add Franklin U600 Greg Kroah-Hartman
2013-03-18 21:10 ` [ 02/40] virtio: rng: disallow multiple device registrations, fixes crashes Greg Kroah-Hartman
2013-03-18 21:10 ` [ 03/40] USB: option: add Huawei E5331 Greg Kroah-Hartman
2013-03-18 21:10 ` [ 04/40] USB: cdc-wdm: fix buffer overflow Greg Kroah-Hartman
2013-03-18 21:10 ` [ 05/40] usb: cp210x new Vendor/Device IDs Greg Kroah-Hartman
2013-03-18 21:10 ` [ 06/40] USB: added support for Cinterions products AH6 and PLS8 Greg Kroah-Hartman
2013-03-18 21:10 ` [ 07/40] usb: serial: Add Rigblaster Advantage to device table Greg Kroah-Hartman
2013-03-18 21:10 ` [ 08/40] USB: storage: fix Huawei mode switching regression Greg Kroah-Hartman
2013-03-18 21:10 ` [ 09/40] USB: EHCI: dont check DMA values in QH overlays Greg Kroah-Hartman
2013-03-18 21:10 ` [ 10/40] staging: vt6656: Fix oops on resume from suspend Greg Kroah-Hartman
2013-03-18 21:10 ` [ 11/40] signal: always clear sa_restorer on execve Greg Kroah-Hartman
2013-03-18 21:10 ` [ 12/40] ext3: Fix format string issues Greg Kroah-Hartman
2013-03-18 21:10 ` [ 13/40] tty: serial: fix typo "ARCH_S5P6450" Greg Kroah-Hartman
2013-03-18 21:10 ` [ 14/40] TTY: do not reset masters packet mode Greg Kroah-Hartman
2013-03-18 21:10 ` [ 15/40] md: protect against crash upon fsync on ro array Greg Kroah-Hartman
2013-03-18 21:10 ` [ 16/40] Revert duplicated perf commit Greg Kroah-Hartman
2013-03-21  3:31   ` Ben Hutchings
2013-03-18 21:10 ` Greg Kroah-Hartman [this message]
2013-03-18 21:10 ` [ 18/40] hwmon: (lineage-pem) Add missing terminating entry for pem_[input|fan]_attributes Greg Kroah-Hartman
2013-03-18 21:10 ` [ 19/40] w1: fix oops when w1_search is called from netlink connector Greg Kroah-Hartman
2013-03-18 21:10 ` [ 20/40] powerpc: Fix cputable entry for 970MP rev 1.0 Greg Kroah-Hartman
2013-03-18 21:10 ` [ 21/40] selinux: use GFP_ATOMIC under spin_lock Greg Kroah-Hartman
2013-03-18 21:11 ` [ 22/40] perf,x86: fix kernel crash with PEBS/BTS after suspend/resume Greg Kroah-Hartman
2013-03-18 21:11 ` [ 23/40] perf,x86: fix wrmsr_on_cpu() warning on suspend/resume Greg Kroah-Hartman
2013-03-18 21:11 ` [ 24/40] perf,x86: fix link failure for non-Intel configs Greg Kroah-Hartman
2013-03-18 21:11 ` [ 25/40] s390/mm: fix flush_tlb_kernel_range() Greg Kroah-Hartman
2013-03-18 21:11 ` [ 26/40] btrfs: use rcu_barrier() to wait for bdev puts at unmount Greg Kroah-Hartman
2013-03-18 21:11 ` [ 27/40] drm/i915: EBUSY status handling added to i915_gem_fault() Greg Kroah-Hartman
2013-03-18 21:11 ` [ 28/40] hwmon: (sht15) Fix memory leak if regulator_enable() fails Greg Kroah-Hartman
2013-03-18 21:11 ` [ 29/40] block: use i_size_write() in bd_set_size() Greg Kroah-Hartman
2013-03-18 21:11 ` [ 30/40] loopdev: fix a deadlock Greg Kroah-Hartman
2013-03-18 21:11 ` [ 31/40] l2tp: Restore socket refcount when sendmsg succeeds Greg Kroah-Hartman
2013-03-18 21:11 ` [ 32/40] rds: limit the size allocated by rds_message_alloc() Greg Kroah-Hartman
2013-03-18 21:11 ` [ 33/40] net: ipv6: Dont purge default router if accept_ra=2 Greg Kroah-Hartman
2013-03-18 21:11 ` [ 34/40] tcp: fix double-counted receiver RTT when leaving receiver fast path Greg Kroah-Hartman
2013-03-18 21:11 ` [ 35/40] tun: add a missing nf_reset() in tun_net_xmit() Greg Kroah-Hartman
2013-03-18 21:11 ` [ 36/40] netlabel: correctly list all the static label mappings Greg Kroah-Hartman
2013-03-18 21:11 ` [ 37/40] bridging: fix rx_handlers return code Greg Kroah-Hartman
2013-03-18 21:11 ` [ 38/40] ipv6: stop multicast forwarding to process interface scoped addresses Greg Kroah-Hartman
2013-03-18 21:11 ` [ 39/40] rtnl: fix info leak on RTM_GETLINK request for VF devices Greg Kroah-Hartman
2013-03-18 21:11 ` [ 40/40] dcbnl: fix various netlink info leaks Greg Kroah-Hartman
2013-03-19  0:47 ` [ 00/40] 3.0.70-stable review Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130318211017.488030405@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).