Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp85116pxa; Wed, 26 Aug 2020 05:34:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwawYrOs4KlAN84Aaw2oNO5EqH0prK7YZZSuGHL3XOnNDrRBagLY3JKHb5QaGnrWqczAGR X-Received: by 2002:a50:e611:: with SMTP id y17mr14205662edm.376.1598445242078; Wed, 26 Aug 2020 05:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598445242; cv=none; d=google.com; s=arc-20160816; b=S3QNnpOeT86VAzvXRuV9MPnPVZXIqQ+0a9mZjvVO8uizywG8tUvI0eRy4u+oPce6QK 3RuhZnjGI/1GBgYaA0TzMb+PLy5r3FgWivLWU+hI0LgNAl65pxO6OTriPUMaskjsGLu9 A0OXDX0e9R4X/epSbLwZVG36bxG55rUa3Z9OPfmPhsbKC+sorgWreH/+RnGFx1RyREgv 9xzhxxZtIZQIg7cZqLEMPCo/aFHhQh/sZZZDXpAc4R23ZzfPOvChrBRzXKdycpnX9uOk cg9C0qVLD1zDQy+rXsoTpNyB76wexYPXEVvtY1Rs8bWvYvJ1aHWXfr6KzvABiEoC9quv /MPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=lKGfppbU0E9vUo/Yy4y4n653KjJPK3r8SJn5wAvVr+w=; b=S5g56vVkS8yZ17K/aBqWT9ZAxAbODOjCkAJ2qHQC6vm0QCj396xmBh+R6BNSSTPcyU ek5rykl6XuuEjM0niArs7gmUHIlcJT6zrjVKsr+BH6Xq//QoBmh92GpVWAQQ8ycVcXu0 qTV6FoWbqMitaLybaWWzj86dSBGkMUT4fBW2jobG4ryX1zVC3hg3fbcHQ00+4LOmwmk/ ISWRBBjYlF7af/JeYnMbzUugRJUyC1JVVCF7OTsAqKnwTjebgVAbTl+EjyujKbwnTd/Y cRLW0LX2wklzFxpWWNbXKpH95hA4KhKz26pcJDBWPawAO+rl/61EvUZBsCwAOmskS+Yw uR5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QakGTVbn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w23si1117410edu.32.2020.08.26.05.33.37; Wed, 26 Aug 2020 05:34:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QakGTVbn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729604AbgHZMas (ORCPT + 99 others); Wed, 26 Aug 2020 08:30:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729308AbgHZMaq (ORCPT ); Wed, 26 Aug 2020 08:30:46 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A254C061574 for ; Wed, 26 Aug 2020 05:30:46 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id v16so818507plo.1 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=OcTMiam7PgB4wvG8sShFRPoW8do7exjufrE48h1q+azyy7ursgWVDIqcCCQJrKIqav nm2pSlZsCxLjt843xp8GtA+mWg+ee/cPpYcX//IGRVzYe3eViMr2I3VYZyclKetJbsrD THo4vzIpCstO+QNHqWeATVzRiaG3YJJsKr9YrufEdjox5cYY+wdXm8i3BQpQBa2zn/HL 8qYFjXpQnd7ZYEcPZlEY5xXwfVMvIR0N8VsUzf5B8Lh7n21aCdTQ6h5/o/lZ4pVBnau4 tCGPthTFsxIOuh3TgHW42wTIqM3Q/gqq0AwCgZqneriNZAjp6yicie6DrImr4jzUQnQ8 ZA9Q== X-Gm-Message-State: AOAM533a6pK8U1SL8lsGsbxbBDqa9IaKbsJW7pqQKhyenlys1r1qsBz1 GD1pdEb2nwm5P23Qfl1gnMcKGE3rnoB52KdATeoj2w== 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.