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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 E5B6CC433E2 for ; Sun, 13 Sep 2020 10:17:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 723AB20663 for ; Sun, 13 Sep 2020 10:17:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="nyykmS9A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 723AB20663 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 B2E836B0002; Sun, 13 Sep 2020 06:17:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ADEC06B0037; Sun, 13 Sep 2020 06:17:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9CDFF6B0055; Sun, 13 Sep 2020 06:17:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id 8308A6B0002 for ; Sun, 13 Sep 2020 06:17:46 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 413CC5C885 for ; Sun, 13 Sep 2020 10:17:46 +0000 (UTC) X-FDA: 77257636932.10.name24_0610b04270ff Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 0D13616A4A9 for ; Sun, 13 Sep 2020 10:17:46 +0000 (UTC) X-HE-Tag: name24_0610b04270ff X-Filterd-Recvd-Size: 7324 Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Sun, 13 Sep 2020 10:17:45 +0000 (UTC) Received: by mail-qk1-f195.google.com with SMTP id q63so13419328qkf.3 for ; Sun, 13 Sep 2020 03:17:45 -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:content-transfer-encoding; bh=2/rTINPcp/OFtffjcOu1onBIlOhuthR1U8PEEQixv6o=; b=nyykmS9AkG4i9TMnFMtKZHTav1DMaE8SUFI+3OiVcdw3B0DLu+pwVWzwQ6kGDjXf+l K7px0dO6gMMsvi3FkubJfozBEGHG+rP93NI06PRHsQgki8OoPHqY4TXz13GUqzh7kCbd eNxIqk344Vpp0aL3iLW26m4v2V5FRN8BDQVamB8DMWFVrdn5Qah6vQTLKhO0Wcbgi3Lw nasjdseAWfh5Qv3irs0+8a5dzF3edJvciMdqoCgZAggoLv6zwMFraDCMREsb8aernu5v dqog9E6ULf0mB0oCupoPtZXG7qAqgf8qf6NbYBR8vFecPrkM+QmWOQrwLg7/iw0aaUS+ w0Nw== 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:content-transfer-encoding; bh=2/rTINPcp/OFtffjcOu1onBIlOhuthR1U8PEEQixv6o=; b=QPALPHQIk1IFlCIqzwqcPcikpWXPW/W4ncI649nSs11o5YoXUGziKs9u3XV/xJ3ePy Maqxg8HNtlo04zEi40e35AfUA6vL4i1X1a0Zs1ChuvTb5r2yXZAHkqCy08wRV0XdoQi1 f3rvGON4iveFWxE5PU9S/p7f/rxou8F1bKYZ3jr6+l3241U2yuC4limAk7qF6qnxyZ/Z 0MV4+wwUW/FAm7mXvx/bM/oAsXaaiZV+BfiW5Kap3sS8pmJR8Zm+QpAE6hT+feJ08qp3 WBBlvl+Tu8laSW15YQ6e+mfCOXXQjCrYhBBK47qQds4Bbm5ynL1/UaNEc/UMXZpWCvza oAfA== X-Gm-Message-State: AOAM5335qP+yuygn9mlc9g1ojQYKNIWDy4Qd6sH2FGRYfY/wzzcasAKe oWYIe7NllySuiPtdQv2cWhVB/m8XeXu77RlRg6Jpmw== X-Google-Smtp-Source: ABdhPJwU0iwVFH+xDwbhrGpX0QTr2ldrPpq71OiTnxbsBdPs9HzLJVfQX1DW0ujxC9OEcCab5tZQ/lNJtojI2hTfw9A= X-Received: by 2002:a37:5684:: with SMTP id k126mr8015895qkb.43.1599992264608; Sun, 13 Sep 2020 03:17:44 -0700 (PDT) MIME-Version: 1.0 References: <20200825015654.27781-1-walter-zh.wu@mediatek.com> In-Reply-To: From: Dmitry Vyukov Date: Sun, 13 Sep 2020 12:17:33 +0200 Message-ID: Subject: Re: [PATCH v3 0/6] kasan: add workqueue and timer stack for generic KASAN To: Andrey Konovalov 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: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 0D13616A4A9 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: 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 wro= te: > > > > > > 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 workqueue > > > queueing stack and timer stack information. It is useful for programm= ers > > > to solve use-after-free or double-free memory issue. > > > > > > Generic KASAN also records the last two workqueue and timer stacks an= d > > > 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/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 > > > --- > > > > > > Changes since v2: > > > - modify kasan document to be more readable. > > > Thanks for Marco suggestion. > > > > > > Changes since v1: > > > - Thanks for Marco and Thomas suggestion. > > > - Remove unnecessary code and fix commit log > > > - reuse kasan_record_aux_stack() and aux_stack > > > to record timer and workqueue stack. > > > - change the aux stack title for common name. > > > > > > --- > > > > > > Documentation/dev-tools/kasan.rst | 4 ++-- > > > kernel/time/timer.c | 3 +++ > > > kernel/workqueue.c | 3 +++ > > > lib/test_kasan.c | 54 ++++++++++++++++++++++++++++++= ++++++++++++++++++++++++ > > > mm/kasan/report.c | 4 ++-- > > > 5 files changed, 64 insertions(+), 4 deletions(-) > > > > > > -- > > > You received this message because you are subscribed to the Google Gr= oups "kasan-dev" group. > > > To unsubscribe from this group and stop receiving emails from it, sen= d an email to kasan-dev+unsubscribe@googlegroups.com. > > > To view this discussion on the web visit https://groups.google.com/d/= msgid/kasan-dev/20200825015654.27781-1-walter-zh.wu%40mediatek.com. > > > > -- > > You received this message because you are subscribed to the Google Grou= ps "kasan-dev" group. > > To unsubscribe from this group and stop receiving emails from it, send = an email to kasan-dev+unsubscribe@googlegroups.com. > > To view this discussion on the web visit https://groups.google.com/d/ms= gid/kasan-dev/CANpmjNOvj%2B%3Dv7VDVDXpsUNZ9o0%2BKoJVJs0MjLhwr0XpYcYQZ5g%40m= ail.gmail.com. > > -- > You received this message because you are subscribed to the Google Groups= "kasan-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an= email to kasan-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgi= d/kasan-dev/CAAeHK%2ByVShDPCxVKDsO_5SwoM2ZG7x7byUJ74PtB7ekY61L2YQ%40mail.gm= ail.com.