Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1428016

Re: sound: use-after-free in hrtimer_cancel

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Dmitry Vyukov <dvyukov@google.com>
Newsgroups linux.kernel
Subject Re: sound: use-after-free in hrtimer_cancel
Date Tue, 21 Jun 2016 19:50:01 +0200
Message-ID <rMxYd-sG-3@gated-at.bofh.it> (permalink)
References <rGobf-4qy-13@gated-at.bofh.it> <rGouC-4wA-7@gated-at.bofh.it> <rH3xM-62c-37@gated-at.bofh.it> <rH5zA-7kC-11@gated-at.bofh.it> <rH5Jg-7nV-27@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tXnJLScF5t0hUMUtONjqteQ9aWFlLWMcT4bmsKBnAaE=; b=pIso3CCUAiQKwFYvq8Dl6bpnEpua+dJp3AezEPnsSYFhiSmxfPSOGxdjxTumOX9L6e AL2GhPa6+W9LDPOXY3Tzm1tl4uE1yKwgWFYQnety3jWVrd4/b2plzMDXfVl4ZuP6xXFG Wk5ol21HVaF3ALGCGZW6bRQX3+bxVBurGGG29Wzfja56Fm6ZvmeQr+TFGULS5s4DFBIb Qq6oxxgmmfVh7OvzBWwTQKKPC0hcyUh6wxSUiKjm6npz9tQ8Ms2pNU1+6WZ/NPvNT6Zb fAg0TbMT05L/AGrI5VVpT42A9CPLfShXgAKmAWLtiINjHqG7Lvgc+K2EIZZ6q5UQAtSu A9jg==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tXnJLScF5t0hUMUtONjqteQ9aWFlLWMcT4bmsKBnAaE=; b=FLUg8noXGGwqllLeRQjCgXIuQoav456UEzoTAg65Fk4pL4+uqj7wacpFGIh/gq6zbP BRyuU2NDZsrtBFbLjNl8FhPKwW888ExFiIhqw13Mq4rSHY34JbTJGHLDIg8NPf95UqcG GEBLcwxLh63Sw98eGf8E3lNgq1VczAkUvlu47s5jI7Npd3St8aiwh+hejstpviag3/2I 90WgENY39vXSETTSCDA1sD3tHsVOJbikBH8BozwlefFi3rjC+7WliWO17/TymXtAoJgc aSC/+TVtvyldjBcZS8840iV5qr3b73BdL6x0rhQTZs7o+y0AW2TLyb/RtkXyvlbJQXQO UKMg==
X-Gm-Message-State ALyK8tJvjP0wGMwXBTsgDz4QQyNVFC72WHlga6vlV9V00IKqRk4K4WqkgHHo1oOupJvpET8nYEgrkPUVOodjt6Ei
X-Received by 10.25.15.213 with SMTP id 82mr5446411lfp.126.1466530907525; Tue, 21 Jun 2016 10:41:47 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 42
Organization linux.* mail to news gateway
X-Original-Cc Jaroslav Kysela <perex@perex.cz>, alsa-devel@alsa-project.org, LKML <linux-kernel@vger.kernel.org>, Sasha Levin <sasha.levin@oracle.com>, Alexander Potapenko <glider@google.com>, Kostya Serebryany <kcc@google.com>, syzkaller <syzkaller@googlegroups.com>
X-Original-Date Tue, 21 Jun 2016 19:41:28 +0200
X-Original-Message-ID <CACT4Y+baYcM256_rdnqa0pow_-VgMxavMJtcdLU2HgjiKwFuyA@mail.gmail.com>
X-Original-References <CACT4Y+Z-iJ6QyzyaJZk_oWmBKCjYecSynfsW3OdH5_bfarH=DQ@mail.gmail.com> <CACT4Y+b1YEr5suLfUQVd_U+AU1fJ38DmGWbrLxaNay42-nAxYQ@mail.gmail.com> <s5hoa7emmpy.wl-tiwai@suse.de> <CACT4Y+ZQn21O6YMphSQs9kM9KREST_MWXOyAbxNiLP7BREJqfg@mail.gmail.com> <s5h1t4ae0gq.wl-tiwai@suse.de>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1428016

Show key headers only | View raw


On Mon, Jun 6, 2016 at 6:39 PM, Takashi Iwai <tiwai@suse.de> wrote:
> On Mon, 06 Jun 2016 18:29:25 +0200,
> Dmitry Vyukov wrote:
>>
>> On Mon, Jun 6, 2016 at 4:11 PM, Takashi Iwai <tiwai@suse.de> wrote:
>> > On Sat, 04 Jun 2016 20:27:50 +0200,
>> > Dmitry Vyukov wrote:
>> >>
>> >> On Sat, Jun 4, 2016 at 8:00 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
>> >> > Hello,
>> >> >
>> >> > The following program triggers use-after-free:
>> >>
>> >> Forget to mention that you need to run it in a tight parallel loop. It
>> >> takes around 5 minutes to reproduce for me.
>> >
>> > Hmm, this again is a bug that is difficult to trigger...  At least, I
>> > couldn't reproduce locally.  How many processes are you running with
>> > stress program?
>>
>> I use a VM with 4 cores and use 20 parallel test processes.
>>
>> > It seems that there is nothing more than opening /dev/audio and does
>> > some mmap in the job.  Is there any other relevant thing there?
>>
>>
>> I think poll with timeout is related. It is poll who sets hrtimer, right?
>
> If it's about snd-dummy driver, hrtimer is created at open, and
> started/stopped at PCM trigger, and removed at close.
>
> Is there any good way to decode which syscalls are executed in the
> test code?

What do you mean?
Here are the syscalls in the program:

    r[2] = syscall(SYS_open, "/dev/audio", 0xa40ul, 0, 0, 0);
    // r[2] is in the descriptor passed to SYS_poll
    r[15] = syscall(SYS_poll, 0x2001dde8ul, 0x4ul, 0x8ul, 0, 0, 0);
    r[18] = syscall(SYS_readv, r[2], 0x20dc13c0ul, 0x1ul, 0, 0, 0);
    r[19] = syscall(SYS_read, r[2], 0x20dbefe0ul, 0x20ul, 0, 0, 0);

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: sound: use-after-free in hrtimer_cancel Dmitry Vyukov <dvyukov@google.com> - 2016-06-21 19:50 +0200

csiph-web