Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933172Ab3CHRbW (ORCPT ); Fri, 8 Mar 2013 12:31:22 -0500 Received: from cantor2.suse.de ([195.135.220.15]:35100 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933140Ab3CHRbV (ORCPT ); Fri, 8 Mar 2013 12:31:21 -0500 Date: Fri, 08 Mar 2013 18:31:20 +0100 Message-ID: From: Takashi Iwai To: Tommi Rantala Cc: Jaroslav Kysela , alsa-devel@alsa-project.org, LKML , Dave Jones Subject: Re: snd_seq_timer_open() NULL pointer dereference In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1548 Lines: 55 At Thu, 7 Mar 2013 21:59:32 +0200, Tommi Rantala wrote: > > Hello, > > I'm hitting this while fuzzing the kernel with Trinity: The patch below fixes a clear bug in the code path. Could you check whether it'll fit? thanks, Takashi --- From: Takashi Iwai Subject: [PATCH] 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. Signed-off-by: Takashi Iwai --- sound/core/seq/seq_timer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c index 160b1bd..24d44b2 100644 --- 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_queue *q) 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; -- 1.8.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/