From patchwork Mon Jul 20 09:40:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1332154 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=o+nN//TR; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=PJ7as5lT; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B9Gv93VlWz9sRW for ; Mon, 20 Jul 2020 19:41:09 +1000 (AEST) 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:Subject:Message-ID:Date:From:MIME-Version: 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=0y83M2ELQoO8Ti73iKKfRPWAahPzXAzoiLkSKle2JJ4=; b=o+nN//TRr4UKu2NQJpyleYXCzA h+NVvrBCBsRCwPAzWXBPZr3D+9NnJq1JcyhkXcAL3HW7Hq6lNOAS+XoPZYqWiK9iHAskLefhGPMIU Od6i8XBJYTqOxIMc7PHVkHCx0qkRk5L0t9QhN/SrVo4g4GTqrDao7EuSnpiVLkuxBykmy2O04J1ur MfOKn50PpL+d60ai2H26FRQmTn8Ia/Gj50MPIqPtJcBHxnUH+h4Qx2zj5DdsZXxNo6Jd4v16OTuYi IwvPWi2bJLGW8quLFU6e1CxiW1uofYKEMlOyuSgO1CQgKnCD6RvyhDmBLQqBzlDmq+r9JZzgrd61b ou2Exw4w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxSHx-0002o2-PG; Mon, 20 Jul 2020 09:40:49 +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 1jxSHu-0002mb-NM for linux-arm-kernel@lists.infradead.org; Mon, 20 Jul 2020 09:40:47 +0000 Received: by mail-lf1-x144.google.com with SMTP id k17so9340769lfg.3 for ; Mon, 20 Jul 2020 02:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=J5+cpk78RQDatxKOYprm8R+FizAj2MbQYctVJ1smedA=; b=PJ7as5lTf4QQnQAIeANwYmw8SVDOoM3OR5YJv5187+z1wSv40n1fKvilTstUkrFG/9 KmmJelxNQoNG9OLvoFsDIvla0VAcULm6CqoOLwDD8lcB5BtoyQ3dCtkyaFDWNepO6vCW MmUv+qxax3EjM64jGHMPSZPqrHJrqpEC+QR/LpacrFqap61DEJDxzdpmzX0tLesB+pL8 Y/A9hXc9cwieJh+RyeiK2XE/5XluU2v7AA4bZ+NpuWMPZbkFAdMuhLsUL4pFIeX3TshB hKs62qNgpQvcYdYRN7Rl1slUAR9jep5gC9EJty/BrreL/ON7/0KZcaiujtjZE83iH/qr FVYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=J5+cpk78RQDatxKOYprm8R+FizAj2MbQYctVJ1smedA=; b=Y4MxQKIZriWi0WeC627JUtDxETEujqrTFOoIAM/xXRZTHo02o89fq77Mvp4qVEVNvZ D4UanVWQhyXE7+2Gg+yqbHQOTYoImWi3Hpcv88wRs3M6t+xiIL5YcmNCnLXrwineUsqZ 4sYafM8JRY+LdsteD6St5QnLjbRl7A2CY90WQhQnxRkBozRuhg+5NcSroxP/V//JQz6l nfM2sFZFxOhjBnRC0AIEfP9/R4chzGJoJ5uAX/T9TEFt8+i6gNoRfFD4hvt/95QKpotx AX2j8KeGGtR/qHjdClCAzh2dK7crpb2zkikrxTLU0t0jF/dCilKOa8ZufvmJ2kxrHSjM 9SBw== X-Gm-Message-State: AOAM531Snpb+mYGLOWneYTRLCQhmuUqyz5Uj3hK5SrfclX243rRIz2wx x+XBjWUBl8jFkrxSTyOhauugvlZi/MHufGYUmri6AQ== X-Google-Smtp-Source: ABdhPJz1UQijdNjKr0lLY3I0LFidM1H/J3Yt7xZJXsQwJOkx5KcwZ5tuUtatNp5b75kX/fctNRty2dorDJdDtdmUGE4= X-Received: by 2002:ac2:5dc1:: with SMTP id x1mr543538lfq.217.1595238043423; Mon, 20 Jul 2020 02:40:43 -0700 (PDT) MIME-Version: 1.0 From: Linus Walleij Date: Mon, 20 Jul 2020 11:40:32 +0200 Message-ID: Subject: [GIT PULL] KASan for Arm, v12 To: Russell King X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200720_054046_821030_CE3A7E61 X-CRM114-Status: GOOD ( 13.03 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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: kasan-dev , Linux ARM Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org Hi Russell, please consider pulling in these changes to bring KASan support to Arm. Certainly there will be bugs like with all new code, but I think we are in such good shape that in-tree development is the best way to go from now so that interested people can test this out. I have tested it extensively on classic MMUs from ARMv4 to ARMv7 and also on LPAE. But now I need the help of linux-next and the broader community to iron out any remaining corner cases. I will of course respect a "no" but then some direction would be sweet. I could for example ask linux-next to include this branch separately from v5.9-rc1 or so to get some coverage. Thanks! Linus Walleij The following changes since commit b3a9e3b9622ae10064826dccb4f7a52bd88c7407: Linux 5.8-rc1 (2020-06-14 12:45:04 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git tags/kasan-for-rmk for you to fetch changes up to 5ebcc6d74e3b7791e3b1c3411a62d216fc5c5230: ARM: Enable KASan for ARM (2020-07-20 11:29:31 +0200) ---------------------------------------------------------------- KASan support for ARM, the v12 patch series. ---------------------------------------------------------------- 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