lkml.org 
[lkml]   [2016]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] ALSA: timer: fix NULL pointer dereference in read()/ioctl() race
On Fri, 02 Sep 2016 14:34:47 +0200,
Vegard Nossum wrote:
>
> On 08/29/2016 09:14 AM, Vegard Nossum wrote:
> > On 08/29/2016 09:02 AM, Takashi Iwai wrote:
> >> On Mon, 29 Aug 2016 00:33:49 +0200,
> >> Vegard Nossum wrote:
> >>> @@ -1602,15 +1602,25 @@ static int snd_timer_user_tselect(struct file
> >>> *file,
> >>> kfree(tu->tqueue);
> >>> tu->tqueue = NULL;
> >>> if (tu->tread) {
> >>> - tu->tqueue = kmalloc(tu->queue_size * sizeof(struct
> >>> snd_timer_tread),
> >>> + struct snd_timer_tread *ttr;
> >>> + ttr = kmalloc(tu->queue_size * sizeof(struct snd_timer_tread),
> >>> GFP_KERNEL);
> >>> - if (tu->tqueue == NULL)
> >>> + if (ttr) {
> >>> + kfree(tu->tqueue);
> >>> + tu->tqueue = ttr;
> >>
> >> This looks like the double-tree, as you didn't remove the kfree() call
> >> in the above. But, I guess this change is superfluous when you
> >> introduce the mutex at...
> >
> > You're right, this hunk is garbage.
> >
> > Please see the new patch (attached), I also changed the patch
> > description slightly to match the changes.
> >
> > I'll start running some tests on the new patch.
>
> I tested the new patch (from the email I'm replying to). It seems to
> work for me.

OK, queued now. Thanks!


Takashi

\
 
 \ /
  Last update: 2016-09-17 09:58    [W:0.067 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site