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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 048BFC4727C for ; Thu, 1 Oct 2020 15:27:42 +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 9CBAD20719 for ; Thu, 1 Oct 2020 15:27:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VoLYEVT6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mik3e1qJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9CBAD20719 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+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:MIME-Version:References:In-Reply-To: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:List-Owner; bh=U1GrZWiPC+6q0QMEDxyUlHYQgd4jtExNylQDeIi9JLU=; b=VoLYEVT6Km4l53D/oRWHSZ4qL FrT3C9X277BirB5y+pbOXS1Ip+NRR03BjzM+EuD2dVVDLRcXu5ix50nyaiUhNUD6OBqHVf6igFZmd YnhA3FN50712jnqDDCqwNPG+B+nxnMdl1C3YTVFcFOB779qD62ydFCU7ARjFIx7lrIv+0UhFDb3jb UlV8rJKjK4hh1g0SkFhj7KwLnEQICyGrJAe47pg7LVlGl8lZzFX8CVH+pok7SOxgw+lNNOk/A9piq 0jvm6T54NNG0T6WF0sUWzHu7AlB+1FLKE/FkURTBb7H9A5HqW0p+jqZKd/rD8WSGODvzGahW/WPoy h4X56rKxw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kO0Sv-0001yH-Lw; Thu, 01 Oct 2020 15:25:54 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kO0Q7-0000Ol-GV for linux-arm-kernel@lists.infradead.org; Thu, 01 Oct 2020 15:23:19 +0000 Received: by mail-lf1-x141.google.com with SMTP id z19so7085712lfr.4 for ; Thu, 01 Oct 2020 08:22:59 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=S+7lwer1MnIu2awMYj5Jn+sfVKRlLjP1q7T9qbp7QkM=; b=mik3e1qJiehUxdpHqO+/C4HtySAlA4ZG0FneuTc1VZUm6M5FKS0oSHK6w05Ui21nyv TY+88mq+zy+yGf0sewrSGcsXjfoV/nvTQ7dwlXh+9ktdJFZmLUwMosNV0+6+Hk/Tql6/ vDXmPifE3vvEtpirGBF/Apsb9nvWQimG4rQi82HVGAhqd+o+dG2L3s/NQaXfhRu/vCJD IzSuuNckt7OeX36oBT6V3ww6Z/VsYBnFhWLlujsxBgwVoMEidyLjsqY+FDs7KpDAgWt7 O3Ni/pZzDZC2/bELBFltMDxkTtX+dVidoxAsPnSqxgg3ocpYiqCylTVgvfLKSJdnwbH7 /asQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=S+7lwer1MnIu2awMYj5Jn+sfVKRlLjP1q7T9qbp7QkM=; b=IDFwDl8QNfjnR2DU1yR0zgOkm6L8kXksh4q5LBtuyE7NrbfEUQEyCrBatf6Y1q7/+C sed5Wkdo8OAI8iLG7bvIbFIhqM0LESEuOF0Qu88C6nyE2BPmkMrBok1IAghoCq0Y2Ml3 NmPWKhuHkdC369+IjXBYVsyn8M4RSWA5xbbhHe9Y7dyEhriJHU9YsomzYpN5BQTKOHGd q9FajS/LxZy+nvrtUH0UBRebpfQwdAvENFmeqO1obt6ktwc+qqeITuZsUt8o6lHE3cAe C9NSpQy3i44XAaL1/uqEd688TwhAzvX0+gXXrB+i+WjDACP5LhfsJYuZnq5KbkRrKmbp Io1g== X-Gm-Message-State: AOAM532H4Vxa5MmZQ9VT4EWUXh+dF/VZYKAs+xzT2CipQHdz6DPpxMbO veIOkAX2HkDySzDpv8c074U71w== X-Google-Smtp-Source: ABdhPJxjqhxmVIF9Ukyg/EBHqRVG0RcrV6pm/N6ThyyfmLM/Ag7rYxfHggJ4e8KWDWHIxwP6d/q2JQ== X-Received: by 2002:a19:f513:: with SMTP id j19mr2565422lfb.174.1601565777933; Thu, 01 Oct 2020 08:22:57 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id v18sm587578lfa.238.2020.10.01.08.22.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 08:22:56 -0700 (PDT) From: Linus Walleij To: Florian Fainelli , Abbott Liu , Russell King , Ard Biesheuvel , Andrey Ryabinin , Mike Rapoport Subject: [PATCH 6/6 v14] ARM: Enable KASan for ARM Date: Thu, 1 Oct 2020 17:22:32 +0200 Message-Id: <20201001152232.274367-7-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201001152232.274367-1-linus.walleij@linaro.org> References: <20201001152232.274367-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201001_112259_641428_B444CD1C X-CRM114-Status: GOOD ( 17.84 ) 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: Arnd Bergmann , Linus Walleij , kasan-dev@googlegroups.com, Alexander Potapenko , linux-arm-kernel@lists.infradead.org, Andrey Ryabinin , Dmitry Vyukov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Andrey Ryabinin This patch enables the kernel address sanitizer for ARM. XIP_KERNEL has not been tested and is therefore not allowed for now. Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: kasan-dev@googlegroups.com Acked-by: Dmitry Vyukov Reviewed-by: Ard Biesheuvel Tested-by: Ard Biesheuvel # QEMU/KVM/mach-virt/LPAE/8G Signed-off-by: Abbott Liu Signed-off-by: Florian Fainelli Signed-off-by: Linus Walleij --- ChangeLog v13->v14: - Resend with the other patches. ChangeLog v12->v13: - Rebase on kernel v5.9-rc1 ChangeLog v11->v12: - Resend with the other changes. ChangeLog v10->v11: - Resend with the other changes. ChangeLog v9->v10: - Rebase on v5.8-rc1 ChangeLog v8->v9: - Fix the arch feature matrix for Arm to include KASan. - Collect Ard's tags. ChangeLog v7->v8: - Moved the hacks to __ADDRESS_SANITIZE__ to the patch replacing the memory access functions. - Moved the definition of KASAN_OFFSET out of this patch and to the patch that defines the virtual memory used by KASan. --- Documentation/dev-tools/kasan.rst | 4 ++-- Documentation/features/debug/KASAN/arch-support.txt | 2 +- arch/arm/Kconfig | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst index 38fd5681fade..050dcd346144 100644 --- a/Documentation/dev-tools/kasan.rst +++ b/Documentation/dev-tools/kasan.rst @@ -18,8 +18,8 @@ out-of-bounds accesses for global variables is only supported since Clang 11. Tag-based KASAN is only supported in Clang and requires version 7.0.0 or later. -Currently generic KASAN is supported for the x86_64, arm64, xtensa, s390 and -riscv architectures, and tag-based KASAN is supported only for arm64. +Currently generic KASAN is supported for the x86_64, arm, arm64, xtensa, s390 +and riscv architectures, and tag-based KASAN is supported only for arm64. Usage ----- diff --git a/Documentation/features/debug/KASAN/arch-support.txt b/Documentation/features/debug/KASAN/arch-support.txt index c3fe9b266e7b..b2288dc14b72 100644 --- a/Documentation/features/debug/KASAN/arch-support.txt +++ b/Documentation/features/debug/KASAN/arch-support.txt @@ -8,7 +8,7 @@ ----------------------- | alpha: | TODO | | arc: | TODO | - | arm: | TODO | + | arm: | ok | | arm64: | ok | | c6x: | TODO | | csky: | TODO | diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 0489b8d07172..873bd26f5d43 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -66,6 +66,7 @@ config ARM select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6 select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU + select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL select HAVE_ARCH_MMAP_RND_BITS if MMU select HAVE_ARCH_SECCOMP_FILTER if AEABI && !OABI_COMPAT select HAVE_ARCH_THREAD_STRUCT_WHITELIST -- 2.26.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel