From patchwork Sat Jun 26 10:09:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?S3Vhbi1ZaW5nIExlZSAo5p2O5Yag56mOKQ==?= X-Patchwork-Id: 12346363 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=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 1ECA6C49EA5 for ; Sat, 26 Jun 2021 10:11:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D612261926 for ; Sat, 26 Jun 2021 10:11:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D612261926 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=As951tGMRsgGa2TOewbjtkD/JDwlbSWGhFlWXonavGc=; b=MKNhemskF/kUya Z2RtRmp8d/nKawiUEoHsevpXdVMFA1NptqYTrbz+GD3AYqnHvX9pqiDhtSEKUxS8IBwORts6F4/pj cKLFLYxFCLEOdATPysrgvzFYyzO3bnSeQ8iwqPUz74GC46y/krD4R6DmKDbzrsD5zbeyVgT8p3tu5 hbA2loCwq8iPqFfr8zZkB6XWpGMFpEG1X9cWlar8uk/g1cOWxHtcN0ME/FL6v91X1wklc6FN2te0U 6tXsrzALponD65QEY8YWDYleU4rLPiSamwcsAGGzNatKfK1Q9oJpifU5GQFP/gubxkSvScwt3sEYv 6D75jbN55y0BLj9sImgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lx5GD-003pNX-8Z; Sat, 26 Jun 2021 10:10:01 +0000 Received: from [216.200.240.185] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lx5Fx-003pIh-I9; Sat, 26 Jun 2021 10:09:48 +0000 X-UUID: b1fde24c1fd64ae682fbe79aa52718ba-20210626 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=x8BTyACVehC4YC0R7Ee40AY/tvOvCQKq8/1wf23Ro8w=; b=OvpMYwkaW/mbusjKscIyq1jjvKTSLOHMxwybf196Favdhx5Lb3IWJpMKiVTvxmAhy6IixcD/FeWcPZj0bzV3+5tDVMwdji/pEYl/8wNBzGKeKpc1eTf/0Rd/CMGri5gYtZLi7REe+O6YzGr+VYiOUyaSZJxwZspbGGlyU/Qm6Yc=; X-UUID: b1fde24c1fd64ae682fbe79aa52718ba-20210626 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 793065210; Sat, 26 Jun 2021 03:09:37 -0700 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 26 Jun 2021 03:09:35 -0700 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 26 Jun 2021 18:09:33 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 26 Jun 2021 18:09:33 +0800 From: Kuan-Ying Lee To: Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Marco Elver , Dmitry Vyukov , Andrew Morton , Matthias Brugger CC: , , , , , , , , Kuan-Ying Lee Subject: [PATCH v4 0/3] kasan: add memory corruption identification support for hw tag-based kasan Date: Sat, 26 Jun 2021 18:09:28 +0800 Message-ID: <20210626100931.22794-1-Kuan-Ying.Lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210626_030947_071130_869D4340 X-CRM114-Status: GOOD ( 10.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add memory corruption identification for hardware tag-based KASAN mode. Changes since v4: - Change report_tags.h to report_tags.c - Refine the commit message - Test lib/test_kasan module with SW_TAGS mode - Test lib/test_kasan module with HW_TAGS mode - Rebase to latest linux-next Changes since v3: - Preserve Copyright from hw_tags.c/sw_tags.c and report_sw_tags.c/report_hw_tags.c - Make non-trivial change in kasan sw tag-based mode Changes since v2: - Thanks for Marco's Suggestion - Rename the CONFIG_KASAN_SW_TAGS_IDENTIFY - Integrate tag-based kasan common part - Rebase to latest linux-next Kuan-Ying Lee (3): kasan: rename CONFIG_KASAN_SW_TAGS_IDENTIFY to CONFIG_KASAN_TAGS_IDENTIFY kasan: integrate the common part of two KASAN tag-based modes kasan: add memory corruption identification support for hardware tag-based mode lib/Kconfig.kasan | 4 +-- mm/kasan/Makefile | 4 +-- mm/kasan/hw_tags.c | 22 --------------- mm/kasan/kasan.h | 4 +-- mm/kasan/report_hw_tags.c | 5 ---- mm/kasan/report_sw_tags.c | 43 ---------------------------- mm/kasan/report_tags.c | 51 +++++++++++++++++++++++++++++++++ mm/kasan/sw_tags.c | 41 --------------------------- mm/kasan/tags.c | 59 +++++++++++++++++++++++++++++++++++++++ 9 files changed, 116 insertions(+), 117 deletions(-) create mode 100644 mm/kasan/report_tags.c create mode 100644 mm/kasan/tags.c