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=-10.0 required=3.0 tests=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 2848EC433E0 for ; Tue, 30 Jun 2020 13:42:18 +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 E9BD120675 for ; Tue, 30 Jun 2020 13:42:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NmL3Lxgm"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GNazyTG+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E9BD120675 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=oTWnA9MdQq5a7f8mHUbrGKZam6eFpMRP6MgGokNsXvc=; b=NmL3LxgmFPBWHpQZOKOF5qPij EjfifLfZvzRKtB/1lMXnYUSLvUbM1RRnzhUE+VD6PWnYTXTgi507zX64zacJu0lJEd9EmSdJqoJhJ kOGd0It4nZsny5COdM5YpNRZ8JOID6fpB0BgcPA/GvdKIweA5oi826Jy2us+jrPg/pu+BK9HH7f/B V7v3kPwJpbi/mBBz0pi6B+Vf3hIMD5JDFe8C7MJBibIAm/HQ6gz4t/80X1BttnrdmoaL2znS0wrJn u5EiD1uiQ25pUa8P2e2QfOpHMmohwlXpxQ20pXi4ISXFimPuEuaqlC2d+HhkfXgfgY2aiiw2kP5hp XowGll/CA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqGVE-0006vr-3A; Tue, 30 Jun 2020 13:40:48 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqGUT-0006eZ-1q for linux-arm-kernel@lists.infradead.org; Tue, 30 Jun 2020 13:40:10 +0000 Received: by mail-lj1-x241.google.com with SMTP id d17so7896441ljl.3 for ; Tue, 30 Jun 2020 06:40: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=LVOKV6YAweIQtdd0AenNdnzUPaOgbv3y0Z2q3n4aE9s=; b=GNazyTG+PzntJjQ02AJftbsnwJjzGOgFpOCszvO5d5azGq4aetesLoWV6q1tq3r985 QYJFcflCvMtv3t3p0rUPMvTxi61PweNZ7sFCiyIdGDPQjBFzb3wZGvYa6T8aBMCIEdhv 98DjYH5m74zkv/0DRZAwV6JzxbMtauIlJGT60OxFOlv71ySj6s9nRanckL28keZZruXC pv0CD70Zwfx8hmY0exLQmiP9bCDsbYPDA2M5SrN4SdcPzfkeRSYDjyWsphwFfei6e4bp GrHdEgBnyHof8d5EWKeG7fufvivlsqXoAsrCeBkRM+I3g7t9vhrZBYzicl12PRX3Tzm8 DF3w== 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=LVOKV6YAweIQtdd0AenNdnzUPaOgbv3y0Z2q3n4aE9s=; b=Gw7QiG+9z9KGZbiX2bCH56TgTFBVln2XiRFkGowaOK7IazU3Ee40yXUWIycQc06klA RAF4wagPWYOmePN9TWQvQjlLGrBwzSJC2l3G3epgXqgdDPNzXSomoTaHunBeyzLvsf2I XaMuOU+mWIX5O5BAECB/wKyteESLrg1etBdpo55djKsRu/zeequCS/o78alTohijqiwe YHtAyLY4Gp/IY9obDyXleQsVJJRbu1PPYWPYYd4N40EIF2VeRPnUqEjnmA71+IyH07g0 bcGG+GzqEbTGxKGuhy3JaMQEly83nWMeMchxdFKG7742JYOm0RyXCiVeT5/SEVyel9kj FXAA== X-Gm-Message-State: AOAM531z8llZ+03XSQ/Cr9o8+Mpbl53SNp5SSB8du0jDZxW+XrXu1PcI q9Q0N/+0JvnjFpWhclKhqSVukQ== X-Google-Smtp-Source: ABdhPJxubrBJX4vOCU5v1Mpw6DIHuTKL6InLeCMd2kIGRybCIA+x2O/mgH0AyEa1izMHMzCoM2UBUQ== X-Received: by 2002:a05:651c:54e:: with SMTP id q14mr9501732ljp.279.1593524399694; Tue, 30 Jun 2020 06:39:59 -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 a15sm737819ljn.105.2020.06.30.06.39.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2020 06:39:58 -0700 (PDT) From: Linus Walleij To: Florian Fainelli , Abbott Liu , Russell King , Ard Biesheuvel , Andrey Ryabinin , Mike Rapoport Subject: [PATCH 5/5 v11] ARM: Enable KASan for ARM Date: Tue, 30 Jun 2020 15:37:36 +0200 Message-Id: <20200630133736.231220-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200630133736.231220-1-linus.walleij@linaro.org> References: <20200630133736.231220-1-linus.walleij@linaro.org> MIME-Version: 1.0 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 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 c652d740735d..0962365e1405 100644 --- a/Documentation/dev-tools/kasan.rst +++ b/Documentation/dev-tools/kasan.rst @@ -21,8 +21,8 @@ global variables yet. 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 6ff38548923e..a73c55fb76e6 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 d291cdb84c9d..6a6059f8bab9 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -65,6 +65,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.25.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel