From patchwork Mon Jul 6 12:24:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11645579 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CFF8560D for ; Mon, 6 Jul 2020 12:28:39 +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 A601E206E6 for ; Mon, 6 Jul 2020 12:28:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fuSPbBVp"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="HDukuOgn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A601E206E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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:MIME-Version:Message-Id:Date:Subject: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=F1oB2kwB8OQ8bHNdHttewg/QfOErxQKaV94jBuc0VIs=; b=fuSPbBVpkxYam1i/a0AzF7sAU8 QnpN73ZYDyrQ8vEkINu3AybFVzUZD1keRmBwhRQHj1jm+MvU9K4Xl+4lJwhcfrsUkdOubiBNtRSlp HQNnomuE1lzefAh/CDXxhKd3A+AzH+oUFTiyrP9ZLPuM9O79iC9ybLfxmqVg6yYK369A7CNIWUUY7 AJvNt4LlBWaj9mu2wZYnuLxvyF6f0m6NuUF7ZyivbSu8UjeA1giknn7Q5qcbxP+kOuvIcFxA/Ya1L cG+QlqgW1JZ1/pVoFx1lLetVF8q17KUBk2aEBMkbwifZLCxocCBmwvSVCERKYXS72kHdavE/WZwct AAvpClDA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jsQD5-0006st-Iz; Mon, 06 Jul 2020 12:26:59 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jsQD2-0006sQ-8b for linux-arm-kernel@lists.infradead.org; Mon, 06 Jul 2020 12:26:57 +0000 Received: by mail-lf1-x144.google.com with SMTP id c11so22434521lfh.8 for ; Mon, 06 Jul 2020 05:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MCVb/ykA7RuIoF65H78i8zlMnFYpXyE3fTeInZRW8J8=; b=HDukuOgnkYYIHCr5POOx5ThDJxa7GlLgpEGjCsYIioUy4qWAWhip5QHxwW0gNYCQQP mjKB6S8hOe0bkUmtEQ7RFAazQgtFPn8ilTA3AG7b7uZciZJC6GwZJANqV0ODt38RRl4z Gy0pTGF85DOOv5m83uvMI5tI2CmN3ZDtFTiT8lD8q4jKwRmTkMzap69ieWv8u6u+RIlQ UJ59wuLIIhZT+8F2SmreaaJEQlnwZbRGY6TwM5YiXTPxnrGLLQLDE9XX09ryvmSGaZzc pfrZos1w1yjK7rbn2LAtfKOaleHz/F93SIaCfli3TtNesnF/wa58OVf7Ln0XF+O6+KNJ ezZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MCVb/ykA7RuIoF65H78i8zlMnFYpXyE3fTeInZRW8J8=; b=VchPf6735VGZNydMTOtPePL2xMM01pvBBMfRZdjfEjTHdwWSqgKiVWpHWBUjeEJuRR O+FU8JCUmUppt8QFlGqKOkZdLb4LcBLbXUilbpt4Iy8dsxi/0ZIYwYezboIZsUw0PN15 MS4Jf3QGn9ggIewCTKA45H3EQzzEh1gLta1RcFkzJDCcgRBQwa+0cSdW/EEbeuK9zJ84 HjBj6SifQ4NLSu7JJgrxb/i+C8vFQU0F8Tzec/USNtkpemZyyJu21Af4fgJOUYWqhKoJ ytflyGzS8W2bpW2uOE54VkejeOpSTgKznB82QKWCHa/VVXHg4vRaqUlbhHUcVRT9k7mb xghQ== X-Gm-Message-State: AOAM531KmZIz7LL5EUAMIR3SiR+LbIiUf/eMipt2BJZAZiVs6VU9oLw9 hr/EQtkBlc1q+j7jgxtzRCE+pw== X-Google-Smtp-Source: ABdhPJwkZXT7wPwLwMzyrbJ22qWDLadsiyC9TK9xJsoJ+ZjV9O0DTVN5btb15cQtJynWoHPEynb5yg== X-Received: by 2002:a19:3f42:: with SMTP id m63mr29943476lfa.104.1594038410946; Mon, 06 Jul 2020 05:26:50 -0700 (PDT) Received: from localhost.localdomain (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id v20sm8534223lfr.74.2020.07.06.05.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2020 05:26:49 -0700 (PDT) From: Linus Walleij To: Florian Fainelli , Abbott Liu , Russell King , Ard Biesheuvel , Andrey Ryabinin , Mike Rapoport Subject: [PATCH 0/5 v12] KASan for Arm Date: Mon, 6 Jul 2020 14:24:42 +0200 Message-Id: <20200706122447.696786-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200706_082656_425566_C0507C47 X-CRM114-Status: GOOD ( 12.86 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:144 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: Linus Walleij , Arnd Bergmann , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This is the v12 version of the KASan patches for ARM. The main changes from the v11 version is: - Folded in a host of cleanups and fixes to the shadow memory initalization code from Ard and made a change myself on top of that. Abbott Liu (1): ARM: Define the virtual space of KASan's shadow region Andrey Ryabinin (3): ARM: Disable KASan instrumentation for some code ARM: Replace string mem* functions for KASan ARM: Enable KASan for ARM Linus Walleij (1): ARM: Initialize the mapping of KASan shadow memory Documentation/arm/memory.rst | 5 + Documentation/dev-tools/kasan.rst | 4 +- .../features/debug/KASAN/arch-support.txt | 2 +- arch/arm/Kconfig | 10 + arch/arm/boot/compressed/Makefile | 1 + arch/arm/boot/compressed/string.c | 19 ++ arch/arm/include/asm/kasan.h | 32 +++ arch/arm/include/asm/kasan_def.h | 81 ++++++ arch/arm/include/asm/memory.h | 5 + arch/arm/include/asm/pgalloc.h | 8 +- arch/arm/include/asm/string.h | 21 ++ arch/arm/include/asm/thread_info.h | 8 + arch/arm/include/asm/uaccess-asm.h | 2 +- arch/arm/kernel/entry-armv.S | 3 +- arch/arm/kernel/entry-common.S | 9 +- arch/arm/kernel/head-common.S | 7 +- arch/arm/kernel/setup.c | 2 + arch/arm/kernel/unwind.c | 6 +- arch/arm/lib/memcpy.S | 3 + arch/arm/lib/memmove.S | 5 +- arch/arm/lib/memset.S | 3 + arch/arm/mm/Makefile | 5 + arch/arm/mm/kasan_init.c | 264 ++++++++++++++++++ arch/arm/mm/mmu.c | 18 ++ arch/arm/mm/pgd.c | 16 +- arch/arm/vdso/Makefile | 2 + 26 files changed, 527 insertions(+), 14 deletions(-) create mode 100644 arch/arm/include/asm/kasan.h create mode 100644 arch/arm/include/asm/kasan_def.h create mode 100644 arch/arm/mm/kasan_init.c