From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 246FCC433E2 for ; Mon, 14 Sep 2020 12:25:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 63DFB2224B for ; Mon, 14 Sep 2020 12:25:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="H3keo0Rq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63DFB2224B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8FD4B6B0003; Mon, 14 Sep 2020 08:25:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 887BD6B0037; Mon, 14 Sep 2020 08:25:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74DF66B0055; Mon, 14 Sep 2020 08:25:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0008.hostedemail.com [216.40.44.8]) by kanga.kvack.org (Postfix) with ESMTP id 5AD016B0003 for ; Mon, 14 Sep 2020 08:25:21 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 08C9D1801EEB8 for ; Mon, 14 Sep 2020 12:25:21 +0000 (UTC) X-FDA: 77261587242.18.road36_0203cac27108 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id A5C6C10658307 for ; Mon, 14 Sep 2020 12:25:20 +0000 (UTC) X-HE-Tag: road36_0203cac27108 X-Filterd-Recvd-Size: 9633 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Mon, 14 Sep 2020 12:25:20 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id 7so11403622pgm.11 for ; Mon, 14 Sep 2020 05:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GFSPNOxQc9ciwHykJLsDnN5OLK2Zzkj9cGLxa9O7b54=; b=H3keo0Rq/Td7dk/XJaNwWWZxjr8aLoi1zQB8pbyExqWHbx0zl5c7r1xiPw4hewUf3d oJum49cwok2Xd0v1l3nwBtvwbWma7ocX+bf7Y3u1hlBMdcdv36y8vgakBANQdghKnOdW FILvsIs2AZhjrEls1cd8FvYCPZTqDYpIs0Xg8CrONMGNHHhZyj/nbvHULEJf8+z2MwUg gqYrY6jq0Qh08oK4yJFs1A2AL4PG4FZ6qEqXb4Bai/uxOLRPqTHksMgU9cYt4ymV3pu2 iuy5K/tKWia+rrucjbEIVM9Jgndp/+MxNm/WSZ7rKyIRf9+sh1mGFzq3JpDkefW0whgn hfVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GFSPNOxQc9ciwHykJLsDnN5OLK2Zzkj9cGLxa9O7b54=; b=CctSpjAWlBrbDz64N0iBw9VflQ3oPbdyC8XlxFNcv83QMqFX+mRgJY5DdGJmrZZM9g 7bIVjtyGQ0mbxl+L3EoU6blml4EhsDsddLJJphChgZ/+HT6XTPYw+9/Akgyf3bdcM49D 1TFxe9GLi8KwBuW7TAqpgSIDfIbYhvIrciONQlIEENKiooWr/othIrYwo4TV3/L1votB J2wJZI9JYUCV0fSNVvtXThnVlF6ipLVPQ3uz8bfPEDWSkE+hE/pusspqYHQqIZZPXVGP G94eRRoO6NiH4siyBZAVoVa7nfv64l6xgXBHtuJqK89SUBnojOlLpsv0JRD+yIgjOUww cqGA== X-Gm-Message-State: AOAM530ZTWBDx712Ss3A6jRH+nqs2nZJv13ZMZP3jWDUlHh8c0HNpQBU XriLWznZHzVv+qXRqXx3KKSlRvuAap/STD+5UMIXPg== X-Google-Smtp-Source: ABdhPJyNinrqBHxeS2xv0d3+HSuosEHIcUxtS+DqU1k82JI96LZZM2I3CDBBL5yp13he73I7yNUvgXGXQGyc3Mxqa1I= X-Received: by 2002:a62:c2:: with SMTP id 185mr12460883pfa.11.1600086318959; Mon, 14 Sep 2020 05:25:18 -0700 (PDT) MIME-Version: 1.0 References: <20200825015654.27781-1-walter-zh.wu@mediatek.com> In-Reply-To: From: Andrey Konovalov Date: Mon, 14 Sep 2020 14:25:07 +0200 Message-ID: Subject: Re: [PATCH v3 0/6] kasan: add workqueue and timer stack for generic KASAN To: Dmitry Vyukov Cc: Marco Elver , Walter Wu , Andrey Ryabinin , Alexander Potapenko , Matthias Brugger , John Stultz , Stephen Boyd , Andrew Morton , Tejun Heo , Lai Jiangshan , kasan-dev , Linux Memory Management List , LKML , Linux ARM , wsd_upstream , linux-mediatek@lists.infradead.org Content-Type: multipart/alternative; boundary="000000000000a73b3d05af45205b" X-Rspamd-Queue-Id: A5C6C10658307 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --000000000000a73b3d05af45205b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Sep 13, 2020 at 12:17 PM Dmitry Vyukov wrote: > On Wed, Aug 26, 2020 at 2:30 PM 'Andrey Konovalov' via kasan-dev > wrote: > > > > On Tue, Aug 25, 2020 at 10:26 AM 'Marco Elver' via kasan-dev > > wrote: > > > > > > On Tue, 25 Aug 2020 at 03:57, Walter Wu > wrote: > > > > > > > > Syzbot reports many UAF issues for workqueue or timer, see [1] and > [2]. > > > > In some of these access/allocation happened in process_one_work(), > > > > we see the free stack is useless in KASAN report, it doesn't help > > > > programmers to solve UAF on workqueue. The same may stand for times= . > > > > > > > > This patchset improves KASAN reports by making them to have workque= ue > > > > queueing stack and timer stack information. It is useful for > programmers > > > > to solve use-after-free or double-free memory issue. > > > > > > > > Generic KASAN also records the last two workqueue and timer stacks > and > > > > prints them in KASAN report. It is only suitable for generic KASAN. > > > > > > > > [1] > https://groups.google.com/g/syzkaller-bugs/search?q=3D%22use-after-free%2= 2+process_one_work > > > > [2] > https://groups.google.com/g/syzkaller-bugs/search?q=3D%22use-after-free%2= 2%20expire_timers > > > > [3]https://bugzilla.kernel.org/show_bug.cgi?id=3D198437 > > > > > > > > Walter Wu (6): > > > > timer: kasan: record timer stack > > > > workqueue: kasan: record workqueue stack > > > > kasan: print timer and workqueue stack > > > > lib/test_kasan.c: add timer test case > > > > lib/test_kasan.c: add workqueue test case > > > > kasan: update documentation for generic kasan > > > > > > Acked-by: Marco Elver > > > > Reviewed-by: Andrey Konovalov > > Reviewed-by: Dmitry Vyukov > > Thanks! The UAF reports with RCU stacks that I see now are just =F0=9F=94= =A5=F0=9F=94=A5=F0=9F=94=A5 > Hi Walter, This patchset needs to be rebased onto the KASAN-KUNIT patches, which just recently went into the mm tree. Thanks! --000000000000a73b3d05af45205b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Sep 13, 2020 at 12:17 PM Dmitry V= yukov <dvyukov@g= oogle.com> wrote:
On Wed, Aug 26, 2020 at 2:30 PM 'An= drey Konovalov' via kasan-dev
<kasan-d= ev@googlegroups.com> wrote:
>
> On Tue, Aug 25, 2020 at 10:26 AM 'Marco Elver' via kasan-dev > <ka= san-dev@googlegroups.com> wrote:
> >
> > On Tue, 25 Aug 2020 at 03:57, Walter Wu <walter-zh.wu@mediatek.com>= wrote:
> > >
> > > Syzbot reports many UAF issues for workqueue or timer, see [= 1] and [2].
> > > In some of these access/allocation happened in process_one_w= ork(),
> > > we see the free stack is useless in KASAN report, it doesn&#= 39;t help
> > > programmers to solve UAF on workqueue. The same may stand fo= r times.
> > >
> > > This patchset improves KASAN reports by making them to have = workqueue
> > > queueing stack and timer stack information. It is useful for= programmers
> > > to solve use-after-free or double-free memory issue.
> > >
> > > Generic KASAN also records the last two workqueue and timer = stacks and
> > > prints them in KASAN report. It is only suitable for generic= KASAN.
> > >
> > > [1]https://groups.google.com/g/syzkaller-bugs/search?q=3D%22use-after= -free%22+process_one_work
> > > [2]https://groups.google.com/g/syzkaller-bugs/search?q=3D%22use-after-= free%22%20expire_timers
> > > [3]https://bugzilla.kernel.org/sh= ow_bug.cgi?id=3D198437
> > >
> > > Walter Wu (6):
> > > timer: kasan: record timer stack
> > > workqueue: kasan: record workqueue stack
> > > kasan: print timer and workqueue stack
> > > lib/test_kasan.c: add timer test case
> > > lib/test_kasan.c: add workqueue test case
> > > kasan: update documentation for generic kasan
> >
> > Acked-by: Marco Elver <elver@google.com>
>
> Reviewed-by: Andrey Konovalov <andreyknvl@google.com>

Reviewed-by: Dmitry Vyukov <dvyukov@google.com>

Thanks! The UAF reports with RCU stacks that I see now are just =F0=9F=94= =A5=F0=9F=94=A5=F0=9F=94=A5

Hi Walter,<= /div>

This patchset needs to be rebased onto the KASAN-K= UNIT patches, which just recently went into the mm tree.

Thanks!
--000000000000a73b3d05af45205b--