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=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 8D514C433E1 for ; Mon, 24 Aug 2020 13:46:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 40A47206B5 for ; Mon, 24 Aug 2020 13:46:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="L4Ekwisf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40A47206B5 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 BD3DF8D0006; Mon, 24 Aug 2020 09:46:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B84D48D0002; Mon, 24 Aug 2020 09:46:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A73178D0006; Mon, 24 Aug 2020 09:46:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0082.hostedemail.com [216.40.44.82]) by kanga.kvack.org (Postfix) with ESMTP id 920228D0002 for ; Mon, 24 Aug 2020 09:46:10 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 32850180AD801 for ; Mon, 24 Aug 2020 13:46:10 +0000 (UTC) X-FDA: 77185586100.26.basin97_1c128c527053 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id E71BB1804B667 for ; Mon, 24 Aug 2020 13:46:09 +0000 (UTC) X-HE-Tag: basin97_1c128c527053 X-Filterd-Recvd-Size: 5034 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Mon, 24 Aug 2020 13:46:09 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id q3so2935465pls.11 for ; Mon, 24 Aug 2020 06:46:09 -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=kCkJ5WyjWp/vo15sfOy04O9dC6dPdDe+nxNNjru5ZGQ=; b=L4Ekwisfob8lARUVm4IHX3FSJQrLhsxH1pNhXY+IU4Jl5JmiwnHFq4kC+ZkoUgOmTF oRxm0wToaEKJKO4tLNn6/l/IbT/fPOEy8H5nh0aJGhI8AJPtc3yAZkw3Pklb8nDKpVTZ sb+l2wno0t2WM3QWkGJPS2hXaU5ciwx7kBOSduO8r9OP/phqdKZ70GrZuTjvtp43wuvd zi2orafnwRsVj9eU9Gzv2Z9QJenI/AXGEIZGjWwxssOBvL6wdxgf1Wd5MugS4Gu4Dq+u gNOJJ+kFq8iLGHNcGlIQvv6gEbWiOXgCP/msm39irv9GzYAwCC22QJe/X5ND0WU7nSvx +kPw== 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=kCkJ5WyjWp/vo15sfOy04O9dC6dPdDe+nxNNjru5ZGQ=; b=iahwTJ4Vra3JYyI1W+yruiM5H3YLezDo7ceIVq80Zzk6eS4YJI+Tvoz0wQcccLQbAm 16UTysSz+t3Lz878sDLl5tKeegTQ8iDA5SqUL0OLvyl57ElzyS/2bxU2TKtw45IQdXAs 3xJv+tTgi1frPG3N3yAC/On20otN6lyWlvgMUx+IJPYmpFZFhnCkLESvHN0F+1sR++oC X9ebW1oLidY8G4D4cnLj+3GiA5I7cF3RhEiMMnPvKXCVRF7FHZUTXUBsjhgth9FaHZlV Kd9QsH38jn61E+vE4LUvLpTMAqefckB0TKOlkRyAFbf+j4/gp2syohBIQ64RpSxKzZXX lQHg== X-Gm-Message-State: AOAM531F7JCKb7joz1m+FVRFCvVxlxB5HUEeYV4JBGpdseCVm0FOm9QI 6jQvl/eWFnEOYqIpH4aBI4+AnVux4fuj8EOG/q+g0Q== X-Google-Smtp-Source: ABdhPJx+5AvTxkSnNbppFehjvnHPzRzC3+yOqtfyATDKvQu5nlD7W4qLlvriyKbSeuNAKL00SFlARsrh8YiIyNzkaco= X-Received: by 2002:a17:902:6944:: with SMTP id k4mr3098268plt.147.1598276768239; Mon, 24 Aug 2020 06:46:08 -0700 (PDT) MIME-Version: 1.0 References: <20200824081353.25148-1-walter-zh.wu@mediatek.com> In-Reply-To: From: Andrey Konovalov Date: Mon, 24 Aug 2020 15:45:56 +0200 Message-ID: Subject: Re: [PATCH v2 5/6] kasan: add tests for workqueue stack recording To: Marco Elver Cc: Walter Wu , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Matthias Brugger , 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: E71BB1804B667 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 Mon, Aug 24, 2020 at 1:49 PM Marco Elver wrote: > > On Mon, 24 Aug 2020 at 10:14, Walter Wu wrote: > > > > Adds a test to verify workqueue stack recording and print it in > > KASAN report. > > > > The KASAN report was as follows(cleaned up slightly): > > > > BUG: KASAN: use-after-free in kasan_workqueue_uaf > > > > Freed by task 54: > > kasan_save_stack+0x24/0x50 > > kasan_set_track+0x24/0x38 > > kasan_set_free_info+0x20/0x40 > > __kasan_slab_free+0x10c/0x170 > > kasan_slab_free+0x10/0x18 > > kfree+0x98/0x270 > > kasan_workqueue_work+0xc/0x18 > > > > Last potentially related work creation: > > kasan_save_stack+0x24/0x50 > > kasan_record_wq_stack+0xa8/0xb8 > > insert_work+0x48/0x288 > > __queue_work+0x3e8/0xc40 > > queue_work_on+0xf4/0x118 > > kasan_workqueue_uaf+0xfc/0x190 > > > > Signed-off-by: Walter Wu > > Cc: Andrey Ryabinin > > Cc: Dmitry Vyukov > > Cc: Alexander Potapenko > > Cc: Matthias Brugger > > Cc: Andrey Konovalov > > --- > > lib/test_kasan.c | 29 +++++++++++++++++++++++++++++ > > 1 file changed, 29 insertions(+) > > These will majorly conflict with the KASAN-test KUnit rework, which I > don't know what the status is. AFAIK, these are not yet in -mm tree. I've asked Andrew to take those in 5.9, but that didn't happen. Perhaps we should ping him again after Plumbers. > I think the KASAN-test KUnit rework has priority, as rebasing that > work on top of this patch is going to be difficult. So maybe these > test additions can be declared optional if there are conflicts coming, > and if that'll be the case you'll have to rebase and resend the test. Yeah, either waiting for KASAN+Kunit or separating the tests sounds like plausible approaches.