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 5959DC433E1 for ; Wed, 26 Aug 2020 12:30:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 19A8520707 for ; Wed, 26 Aug 2020 12:30:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="QakGTVbn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19A8520707 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 B8AB18D0001; Wed, 26 Aug 2020 08:30:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B15276B0005; Wed, 26 Aug 2020 08:30:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9DD768D0001; Wed, 26 Aug 2020 08:30:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0249.hostedemail.com [216.40.44.249]) by kanga.kvack.org (Postfix) with ESMTP id 83CBD6B0003 for ; Wed, 26 Aug 2020 08:30:47 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 443B2181AEF1A for ; Wed, 26 Aug 2020 12:30:47 +0000 (UTC) X-FDA: 77192653734.13.chalk78_3f0418b27064 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 18AA618140B60 for ; Wed, 26 Aug 2020 12:30:47 +0000 (UTC) X-HE-Tag: chalk78_3f0418b27064 X-Filterd-Recvd-Size: 6323 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Wed, 26 Aug 2020 12:30:46 +0000 (UTC) Received: by mail-pj1-f68.google.com with SMTP id kx11so796210pjb.5 for ; Wed, 26 Aug 2020 05:30:46 -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=lKGfppbU0E9vUo/Yy4y4n653KjJPK3r8SJn5wAvVr+w=; b=QakGTVbnXji0yIrLxFbJeBQ4Wf27OXuadMyAl+bRhLmub3MVtzX2wowojkT9zFhudo 4ecf/bj36eiq5t7/Xlbi1OBjE9CSJ7lTTQASsQMdjzAM31kZSMAdmbDPkmsDq62jIWLm 4EPiv8fBPc0g7CfEV5HS/ESM5rtS1YmNgyo2FrY7BWcOfbcCTHN6Ub1BNh5nv7MvTo2f NgNHpBVzB+w4EAVGzWptlpbZqkUVaejmuPBIF8xTNSRptmsxR3s7Pbv+rkmxNVC4irOT TNt184ss1jrFY2Ino4qBMzI6FBff3MO38MvnQxyQ/EKBCU/t3uQH9iZ3kPgbQ/KIzYzM HEVg== 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=lKGfppbU0E9vUo/Yy4y4n653KjJPK3r8SJn5wAvVr+w=; b=N7dMEO0HXhLnsE/pDYwZUOgYFdlgVoTxhlNEoDPWpNEnC0rt5I8sEcrarHuldDOEy9 PvZvNNnkguZmTAZD2Fj1Tvb3hlS+QNDebCAhR43oBeeOH3agpOTEsv8zJR/k0sCg9MtN u8SxD18CDNcgQYJpGq2sDyOQ9oEegF1ZVVbvt84Dlk1xs+zthgFKYuD5zjnjNJ4s9q8M D+GlzBA01tEdqC/tWPfNJWG+QSuo3Duvz5bpd8Hx2VwTrmCCSvhblEPGdArv+d/iA8FK lZfc32EaFBWBBI3tUCLBshye8XgAlDf7Pre2zrKT4glGrzKmTS0UnEpm4C4CsUqopzsE xrBw== X-Gm-Message-State: AOAM530DJoK0UV0TaHQOk3Msx6tWLl8NI1pyom+WPpV3+O3ZajDcGGRE iunRqkjy4S28B119J7BikwBJvQgrtiBg4jNnM+F2bA== X-Google-Smtp-Source: ABdhPJzfN5W9BaSlDLOyQZ1bH05/BwCHKG7L/Q3MInfwi5CE5Y8xF3ppMa98+Luw2xoB+7F0FyfkJUjO7daLVC4QNBI= X-Received: by 2002:a17:90a:2d82:: with SMTP id p2mr5048424pjd.166.1598445045375; Wed, 26 Aug 2020 05:30:45 -0700 (PDT) MIME-Version: 1.0 References: <20200825015654.27781-1-walter-zh.wu@mediatek.com> In-Reply-To: From: Andrey Konovalov Date: Wed, 26 Aug 2020 14:30:34 +0200 Message-ID: Subject: Re: [PATCH v3 0/6] kasan: add workqueue and timer stack for generic KASAN To: Marco Elver Cc: Walter Wu , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , 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" X-Rspamd-Queue-Id: 18AA618140B60 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 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 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=%22use-after-free%22+process_one_work > > [2]https://groups.google.com/g/syzkaller-bugs/search?q=%22use-after-free%22%20expire_timers > > [3]https://bugzilla.kernel.org/show_bug.cgi?id=198437 > > > > 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 > > > > > --- > > > > 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 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/msgid/kasan-dev/20200825015654.27781-1-walter-zh.wu%40mediatek.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/msgid/kasan-dev/CANpmjNOvj%2B%3Dv7VDVDXpsUNZ9o0%2BKoJVJs0MjLhwr0XpYcYQZ5g%40mail.gmail.com.