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 B889DC433DF for ; Mon, 24 Aug 2020 11:49:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7CF06206BE for ; Mon, 24 Aug 2020 11:49:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ifu4mAhc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CF06206BE 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 0B67C6B0005; Mon, 24 Aug 2020 07:49:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 067FD6B0006; Mon, 24 Aug 2020 07:49:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E98836B0007; Mon, 24 Aug 2020 07:49:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0235.hostedemail.com [216.40.44.235]) by kanga.kvack.org (Postfix) with ESMTP id D071F6B0005 for ; Mon, 24 Aug 2020 07:49:39 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 632318248047 for ; Mon, 24 Aug 2020 11:49:39 +0000 (UTC) X-FDA: 77185292478.19.move47_210ce3d27052 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 24A871ACC2A for ; Mon, 24 Aug 2020 11:49:27 +0000 (UTC) X-HE-Tag: move47_210ce3d27052 X-Filterd-Recvd-Size: 4596 Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Mon, 24 Aug 2020 11:49:26 +0000 (UTC) Received: by mail-ot1-f66.google.com with SMTP id x24so7012788otp.3 for ; Mon, 24 Aug 2020 04:49:26 -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=IfIxkLsRxova3XYkDm6i/K8H2HRLaB3EQ7huQjW3f6w=; b=ifu4mAhcTRgtT25z97rVnVLSZIehYoWZP8njiAuMAclckn9QF6jbVP9Hz7Htj0eApu mAtaaK9Vv7vTMujUpSkvkdv59rffw4S+b4wo7FklQ4IG/DkO+lejrQgJuaRUVn5yPkkf Ugo6AK2ksLHd7xu8urFifQ5nbrZf01NR6zdW3IrCwjZ2bEo68yYEKe+C3635MLiW5BSV Mmy+tihlpl7pk1aBdkegmzmwQtmMwLz+rebJoqtGTgAG8H+Fr6z5tMjoYOB8Diw+cuRa 7z2JPsLcyQRrjG2k9P3H0xHTrBpndrxWp3GysVNseNU2L1WSHLLP7FLCS1SQXOXp1UY8 EWWg== 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=IfIxkLsRxova3XYkDm6i/K8H2HRLaB3EQ7huQjW3f6w=; b=KijGVveBBi2lfdByk3iRvd0F1SwQk1ffMQPpcawkb1ej0vvKDEtbwhm6Onw1DyU+AJ WmqarKrd7eHUrRwW0t1tqCWbqh64St6a2lMkpDE12x9v3VBVCB/2uS+UUZ0xbvlpkr+V vAUkkRTAuYZMNIYaRnnsuXhlchCjo9y0NEP0KowskY8g5WAJ6D19h+0kZ0Av2UjIRlvO Aq1vqT8J+N0yOvYai6xto1ynyhyL7N8H/iZNMERTJPFDOORs+9o4pDOWmeGXqWmzVHaO 51laI/WuA7LNMEE2HXgp/dLEa3auMqmWIag3BCTlZJhKGcc61SLsLiBOY3TwRAwYIL0u U7zw== X-Gm-Message-State: AOAM532xz7rSB8R2lEUMlzpbxWssH+FKcupoqoi1csa92luislawUxCE Bek3aBoey6piBi3ngRg5ZiILJ8f4wHegEtzqc4y9tw== X-Google-Smtp-Source: ABdhPJx8/ShV3Gs8ffER3S7rZnw0ZFPWF5N02fGQqTCvCQFx6YSWKYgZLvFexBYVMpA5tpKhoxssOwaUlfs41PMlPVI= X-Received: by 2002:a05:6830:1612:: with SMTP id g18mr3040756otr.251.1598269765865; Mon, 24 Aug 2020 04:49:25 -0700 (PDT) MIME-Version: 1.0 References: <20200824081353.25148-1-walter-zh.wu@mediatek.com> In-Reply-To: <20200824081353.25148-1-walter-zh.wu@mediatek.com> From: Marco Elver Date: Mon, 24 Aug 2020 13:49:14 +0200 Message-ID: Subject: Re: [PATCH v2 5/6] kasan: add tests for workqueue stack recording To: Walter Wu Cc: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Matthias Brugger , kasan-dev , Linux Memory Management List , LKML , Linux ARM , wsd_upstream , linux-mediatek@lists.infradead.org, Andrey Konovalov Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 24A871ACC2A X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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, 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 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. Thanks, -- Marco