From patchwork Tue Jan 5 18:27:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 12000065 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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 416B8C433E0 for ; Tue, 5 Jan 2021 18:30:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 F03CB22D5A for ; Tue, 5 Jan 2021 18:30:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F03CB22D5A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:From:Subject:Mime-Version:Message-Id:Date: 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=IMz/lYtKhD9k4xfu9pZYJrgz5iMlrHxpf48kAc/OnQk=; b=c6XH37SOpBGoUtwfVel8NSSHBw bQbMZzzQr+t9zygBgcOcsvHD+/HSZH5oYzVLC3fc2Do5YDkjsmxg6ESROZcJhMe9YbZKQVobuz41O VMaT5Ubi36/kik1RRXfI8gBnkfiIHqtirUDCb/77ikyGaUvDdjHy3b7bh1LsIjS71PSuuA6JduKYO ChLrx+OS5AclL+s/eQqjxOvyDvcK9GcaRYO38JlNdOYMs2tDyPWSIWobnx+tHA0mRoODuUAo6PBUg ZMJGM/uALFutszP+To0WmvzTqMjvihqhPD3egG72Z8RhXtkOsgI+mw/0u6k4QGpXF0esJx7CeTMoC Kpe10fPA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwr3x-0006xp-Hw; Tue, 05 Jan 2021 18:28:09 +0000 Received: from mail-qt1-x84a.google.com ([2607:f8b0:4864:20::84a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwr3u-0006wX-1E for linux-arm-kernel@lists.infradead.org; Tue, 05 Jan 2021 18:28:07 +0000 Received: by mail-qt1-x84a.google.com with SMTP id h18so432585qtr.2 for ; Tue, 05 Jan 2021 10:28:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=nYphEf0EMXtBFuH3fG+hMPTfNDw2lJ9R5ysG4cvqPlg=; b=v5sqPJZxpjuB11/GEAiHAptCrghLv65ERy0Hv+7MaL3WzshKqkIqkDTuMHHKEqFeyx XDt5JgUo0H/C7DysFO2iq2kmIDze675lBtfrkfziV1h8BEZyu0m44I5beQiJ+WDQyRyg ZDSKJuZk7wJdBeNO5ixEApi9E9/hdaiL/1R3MW3dAg5gAqRNy/bB1hrpZvraUmypt/z2 Uzcnpo29W0CUS3gGZjF1ojkSLtZDVfu23OjNkkFjbFEV8xOvoou6KzNcw3Y78HqvfGTi u4s9T1AgT214fvDwE9dHZk+K42j+mK0vsHsf3buKuAmyF+9udTHK4lzEjFVrp0DwRD/3 Zvng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=nYphEf0EMXtBFuH3fG+hMPTfNDw2lJ9R5ysG4cvqPlg=; b=dGY8REyr87f4RyTt58pmQxYPdH0cNOzHJvhSHlf7iWMPsGVYRDRpYJfA0Iyc9MIP7L bTxu5wl0pM+dGvhUMn2/ZL0SRzS1qJt9qriDbd5Ngy409wuc7CACZ+wK/PtLUPQRyEJs KrpgnRsfsRyR8Nkhvv4wO6f9cxcUlwpkmYLUtTaJiMv7cfvCWMjIJEf6V9KUaRzw0id7 sboSTEPWRcMcS1ObKSy5DboMZA/SrJIqutRUFsBGM8pXfvUlmAIWkt5iLQq68tvwNsWG 9Vp7WXIGfgWpdqkrQuBZTrM1WG4Xd+ivsuZ2Xnjio5c3TNAs4qRLm7gvCcEgZfHHjH7S dzcQ== X-Gm-Message-State: AOAM532Nt/AYuOLi9j09rUgovN8lDxJtEBShvV+VVLma+J3Q16JvBpmQ f/cO1kONHkSG8u01RHEd/CFKk3FDTbbTxJj6 X-Google-Smtp-Source: ABdhPJyBmBn1OeHUqMcEB2ORvkkHdSVt9GdeufbfO1j9yYUuMJPmCZohnhhyOFPghR5tnMIPs4OyFl1ol+2Rc1u7 X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:ad4:46e7:: with SMTP id h7mr858980qvw.44.1609871281623; Tue, 05 Jan 2021 10:28:01 -0800 (PST) Date: Tue, 5 Jan 2021 19:27:44 +0100 Message-Id: Mime-Version: 1.0 X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog Subject: [PATCH 00/11] kasan: HW_TAGS tests support and fixes From: Andrey Konovalov To: Catalin Marinas , Vincenzo Frascino , Dmitry Vyukov , Alexander Potapenko , Marco Elver X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210105_132806_091627_F0CF6DD8 X-CRM114-Status: GOOD ( 12.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Branislav Rankov , Andrey Konovalov , Kevin Brodsky , Will Deacon , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, Andrey Ryabinin , Andrew Morton , Evgenii Stepanov Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patchset adds support for running KASAN-KUnit tests with the hardware tag-based mode and also contains a few fixes. Andrey Konovalov (11): kasan: prefix exported functions with kasan_ kasan: clarify HW_TAGS impact on TBI kasan: clean up comments in tests kasan: add match-all tag tests kasan, arm64: allow using KUnit tests with HW_TAGS mode kasan: rename CONFIG_TEST_KASAN_MODULE kasan: add compiler barriers to KUNIT_EXPECT_KASAN_FAIL kasan: adopt kmalloc_uaf2 test to HW_TAGS mode kasan: fix memory corruption in kasan_bitops_tags test kasan: fix bug detection via ksize for HW_TAGS mode kasan: add proper page allocator tests Documentation/dev-tools/kasan.rst | 22 +- arch/arm64/include/asm/memory.h | 1 + arch/arm64/include/asm/mte-kasan.h | 12 ++ arch/arm64/kernel/mte.c | 12 ++ arch/arm64/mm/fault.c | 16 +- include/linux/kasan-checks.h | 6 + include/linux/kasan.h | 13 ++ lib/Kconfig.kasan | 6 +- lib/Makefile | 2 +- lib/test_kasan.c | 312 +++++++++++++++++++++++------ lib/test_kasan_module.c | 5 +- mm/kasan/common.c | 56 +++--- mm/kasan/generic.c | 38 ++-- mm/kasan/kasan.h | 69 ++++--- mm/kasan/quarantine.c | 22 +- mm/kasan/report.c | 13 +- mm/kasan/report_generic.c | 8 +- mm/kasan/report_hw_tags.c | 8 +- mm/kasan/report_sw_tags.c | 8 +- mm/kasan/shadow.c | 26 +-- mm/kasan/sw_tags.c | 20 +- mm/slab_common.c | 15 +- tools/objtool/check.c | 2 +- 23 files changed, 484 insertions(+), 208 deletions(-)