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 7928FC43457 for ; Mon, 19 Oct 2020 08:44:46 +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 F2FB32225A for ; Mon, 19 Oct 2020 08:44:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mHct/3QO"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NwlA3RLQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2FB32225A 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=3y3gSCFxvd1+IrzEkQYRZc/hJRQVr5FMg8epHYC6cU0=; b=mHct/3QOTy7VBonFUcRwn97cU iJnXyIgdjQuHLFw1Ou2JP0nl1yLAA5jIcjo+sl8iqfCJvTgw+LYVeqQMaUbCDm0SjIc0SkAD3bFQ0 yCPkYaNLvy0H3Dd7iXTOCH0Hxi6H5vW2sPrCyKWNpXmpYEO58vPRWjLlIQjC5ZwEdMd/dv5FZNQRe kA/tABF69XGJK+y1PUlb+TIRameqoY6O9IE+K9btVhLzG2ObFGsFnafw0HeaXqDsUaMMHTcGczcql pk8NsaHvZcy4OJcgLgG9PXxbDA8j+05wzHvH59XqXo+auG8qtS1EDWA6De6XO4cF11PzMWf3WVT9L TEhnG2gQQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUQl2-0007Yu-VG; Mon, 19 Oct 2020 08:43:09 +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 1kUQjw-0007A8-KP for linux-arm-kernel@lists.infradead.org; Mon, 19 Oct 2020 08:42:14 +0000 Received: by mail-lf1-x141.google.com with SMTP id h6so13168136lfj.3 for ; Mon, 19 Oct 2020 01:42:00 -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=hvW5D1tB1h62vzTkANn+LuUgiNyjCx5HCXo2cpf/5sw=; b=NwlA3RLQbpvxBMVEzYgk7Szdb2ZdxrXxrnOaO2seQN7IbUHlYyaeIO4mzh1bAgmkvd lapRdmMyt9grs+I+jvSqkMecEDiZO9BHk2aiwkFLkBdJRn6bRoqwFqBw7YjA4BgCOar4 pmc+kfPSabw74ZTYuQsjuGEPf9fJbRmGpt6zxcaRcy2Bxu+vtTi4Hrch97GVrwO2xKoA b7boHhlCIFeAkjs3zj4v7GMhY/qJIQnIShvbMMkxBQWgyNhHcnaX9+xDKfoyd3JKmzSS iKLatjNs4UoXTYZg+jTbzKtrOO493+GRLih2sxChe2zZpgkKNy+AlhNMLE6wSID5dVN8 9zAg== 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=hvW5D1tB1h62vzTkANn+LuUgiNyjCx5HCXo2cpf/5sw=; b=FQJTRC6nf8OHEGCSz6xxlHH7MUimv25q2PGRGqksF5HCVTUSxW21oXY00Q4bb3SM2C KZ3Fy4+iXMO8w09LdKMF+b7AfgMWUyPEFZ2MtniP2AHZixAu4NoFj878FGjAGJCxzb41 EISR4blux49i0P3LvL78c8osKIZ1LeQqrjUyQ3rrE61vbmY/rKowcPd8TwfE2bWdC5P7 0xVUC8ZeTK3gatBvQsuBgTFjfkT+xucjrvRtyqvQzLldjkNmo43QfgKv6GB7ihC9p03s oNs6U/sS8OuM6j2SuLxQRRmWwg7Rbu7XoAh48nWSjxPTQyll+GRZxpo4DapBT7ekpXQX AlPA== X-Gm-Message-State: AOAM532bTYJTyPAmuQHrryw++FWi9KbLcw1EUIeyef2kKbbGlQhEJDKM 4zi9IGRxkxNbWJMqsSFp415Oqw== X-Google-Smtp-Source: ABdhPJwF57t9/Cu0Q2rtC0FUyK1XjFRUqNkHa4ZXT580jlG/DTGu0a49O1IQb6Oka9ls9rC5pGeawg== X-Received: by 2002:a19:7719:: with SMTP id s25mr5025636lfc.521.1603096919130; Mon, 19 Oct 2020 01:41:59 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id b18sm3174795lfp.89.2020.10.19.01.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 01:41:58 -0700 (PDT) From: Linus Walleij To: Florian Fainelli , Abbott Liu , Russell King , Ard Biesheuvel , Andrey Ryabinin , Mike Rapoport Subject: [PATCH 5/5 v16] ARM: Enable KASan for ARM Date: Mon, 19 Oct 2020 10:41:40 +0200 Message-Id: <20201019084140.4532-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201019084140.4532-1-linus.walleij@linaro.org> References: <20201019084140.4532-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-20201019_044200_897183_5657B4E7 X-CRM114-Status: GOOD ( 17.74 ) 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: Ahmad Fatoum , 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 Tested-by: Florian Fainelli # Brahma SoCs Tested-by: Ahmad Fatoum # i.MX6Q Signed-off-by: Abbott Liu Signed-off-by: Florian Fainelli Signed-off-by: Linus Walleij --- ChangeLog v15->v16: - Collect Florian's Tested-by - Resend with the other patches ChangeLog v14->v15: - Resend with the other patches 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