public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: alsa-devel@alsa-project.org,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jaroslav Kysela <perex@perex.cz>,
	LKML <linux-kernel@vger.kernel.org>,
	Alexander Potapenko <glider@google.com>,
	Kostya Serebryany <kcc@google.com>,
	syzkaller <syzkaller@googlegroups.com>,
	Sasha Levin <sasha.levin@oracle.com>
Subject: Re: sound: use-after-free in snd_timer_interrupt
Date: Thu, 21 Apr 2016 10:31:28 +0200	[thread overview]
Message-ID: <s5hshyfxt0f.wl-tiwai@suse.de> (raw)
In-Reply-To: <CACT4Y+YAK9OJA2C36LC9TnkMoW3k5GmZKk_N9_SgeDLiKzJzWw@mail.gmail.com>

On Thu, 21 Apr 2016 10:14:10 +0200,
Dmitry Vyukov wrote:
> 
> On Wed, Apr 20, 2016 at 12:31 PM, Takashi Iwai <tiwai@suse.de> wrote:
> > On Wed, 20 Apr 2016 10:08:55 +0200,
> > Takashi Iwai wrote:
> >>
> >> On Wed, 20 Apr 2016 09:56:04 +0200,
> >> Dmitry Vyukov wrote:
> >> >
> >> > On Sun, Apr 3, 2016 at 8:33 AM, Takashi Iwai <tiwai@suse.de> wrote:
> >> > >> >> It is not easily reproducible. I've hit several times while running
> >> > >> >> fuzzer for a week. Here is one of the logs for the record:
> >> > >> >> https://gist.githubusercontent.com/dvyukov/c84798ee55721563ecb537c4d51dc9f5/raw/f00b865a85877656f13b41917f7321730f140d35/gistfile1.txt
> >> > >> >
> >> > >> > There are a few more fixes in sound/core/timer.c since 4.5, and they
> >> > >> > possibly already cover this.
> >> > >> >
> >> > >> > Please let me know if this is still seen on the upcoming 4.6-rc2.
> >> > >>
> >> > >> Hi Takashi,
> >> > >>
> >> > >> I've updated fuzzer to 05cf8077e54b20dddb756eaa26f3aeb5c38dd3cf (Apr
> >> > >> 1) yesterday. Let's see if it still happens.
> >> > >>
> >> > >> Out of curiosity, how was the bug found?
> >> > >
> >> > > Well, I'm not entirely sure whether they really cover.  It's just a
> >> > > hope, as these are patches to close some possible races :)
> >> > >
> >> > > 9984d1b5835ca29fc7025186a891ee7398d21cc7
> >> > >     ALSA: timer: Protect the whole snd_timer_close() with open race
> >> > > f65e0d299807d8a11812845c972493c3f9a18e10
> >> > >     ALSA: timer: Call notifier in the same spinlock
> >> > > 4a07083ed613644c96c34a7dd2853dc5d7c70902
> >> > >     ALSA: timer: Use mod_timer() for rearming the system timer
> >> >
> >> >
> >> > Hi Takashi,
> >> >
> >> > I've hit it again on 806fdcce017dc98c4dbf8ed001750a0d7d2bb0af (Apr
> >> > 14), all 3 commits are already in my tree.
> >> >
> >> > [  343.222218] ------------[ cut here ]------------
> >> > [  343.222218] WARNING: CPU: 3 PID: 7040 at kernel/time/hrtimer.c:837
> >> > hrtimer_forward+0x26a/0x3e0
> >>
> >> This is a different warning.  The previous was use-after-free, and
> >> this is a warning about re-arming the queued hrtimer.
> >> Maybe there is a slightly remaining race about hrtimer_start() and the
> >> interrupt handler in snd-hrtimer.
> >
> > Could you check whether two patches below help anything?
> > This should harden against the race between hrtimer callback and
> > another start/stop calls.
> 
> I don't have a reliable way to reproduce it. I've tried to replay the
> logs for hours, but no success. And I've hit it only three times:
> 
> -rw-r----- 1 346004 Apr 19 02:36 crash-qemu-23-1461026201572599961
> -rw-r----- 1 393438 Mar 27 08:24 crash-qemu-8-1459059850150353721
> -rw-r----- 1 393439 Mar 10 19:44 crash-qemu-16-1457635446972474955
> 
> I will merge the patches and restart the fuzzer. It will be difficult
> to conclude whether it fixes the bug or not, but at least it will test
> the patches.

Thanks!  I'll test the patches for a while and merge for 4.7 if no
regression is found, too.


Takashi

  reply	other threads:[~2016-04-21  8:31 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-02  9:08 sound: use-after-free in snd_timer_interrupt Dmitry Vyukov
2016-04-02 16:30 ` Takashi Iwai
2016-04-03  6:06   ` Dmitry Vyukov
2016-04-03  6:33     ` Takashi Iwai
2016-04-20  7:56       ` Dmitry Vyukov
2016-04-20  8:08         ` Takashi Iwai
2016-04-20 10:31           ` Takashi Iwai
2016-04-21  8:14             ` Dmitry Vyukov
2016-04-21  8:31               ` Takashi Iwai [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-01-13 15:00 Dmitry Vyukov
2016-01-13 16:53 ` Takashi Iwai
2016-01-13 18:34   ` Dmitry Vyukov
2016-01-13 19:05     ` Takashi Iwai
2016-01-13 19:30       ` Dmitry Vyukov
2016-01-13 19:41         ` Dmitry Vyukov
2016-01-13 20:30           ` Takashi Iwai
2016-01-13 20:48             ` Dmitry Vyukov
2016-01-13 20:54               ` Takashi Iwai
2016-01-14 16:09                 ` Takashi Iwai
2016-01-15  8:06                   ` Dmitry Vyukov
2016-01-15 11:00                     ` Takashi Iwai
2016-01-15 11:03                       ` Dmitry Vyukov
2016-01-15 13:51                         ` Takashi Iwai
2016-01-15 14:38                           ` Dmitry Vyukov
2016-01-15 15:21                             ` Takashi Iwai
2016-01-15 15:28                               ` Dmitry Vyukov
2016-01-15 15:39                                 ` Takashi Iwai
2016-01-15 19:13                             ` Dmitry Vyukov
2016-01-15 19:18                               ` Takashi Iwai
2016-01-15 19:47                                 ` Dmitry Vyukov
2016-01-15 21:22                                   ` Takashi Iwai
2016-01-15 21:44                                     ` Takashi Iwai
2016-01-18 10:53                                       ` Dmitry Vyukov
2016-01-18 13:06                                         ` Takashi Iwai
2016-01-18 13:30                                           ` Dmitry Vyukov
2016-01-18 13:36                                             ` Takashi Iwai
2016-01-13 20:45         ` Takashi Iwai

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=s5hshyfxt0f.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kcc@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=peterz@infradead.org \
    --cc=sasha.levin@oracle.com \
    --cc=syzkaller@googlegroups.com \
    --cc=tglx@linutronix.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