From patchwork Mon Apr 2 12:04:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abbott Liu X-Patchwork-Id: 10319653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1F1B6602C8 for ; Mon, 2 Apr 2018 12:25:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BF3528AF5 for ; Mon, 2 Apr 2018 12:25:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3ECF28AF8; Mon, 2 Apr 2018 12:25:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5596928AF5 for ; Mon, 2 Apr 2018 12:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type: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:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qcAV678/gkoDg4BZ3L146se0qha8JnH8yr6s+TPlfr0=; b=FVmJvkaAiZh1Ed F4Vnrgr26oF/zBlhbK278mfeJex52i924j8Bm3vZV3YwYhb2TGtlwbFgzfjGJHy5tFD5e4s6osTS8 fBR0PjZpjps6Og1RPdVk696cNuPOoxp8zh5gENAXx48K3Lpf+MF86XkjznFq7g0BZnbKCHeD/2T3S tl8gVPnEoVzUoAObBGwMW/fXPmYM2JtOZIb604xYpqMvr3r+ZZDVzVXULkOXcK31fmbC+sUzlyUIg 3R5hKnXKlguNfGxtxH3SWRDkmjRFnTu+dV1eGYFdUAxzo7yrBNCGFIkgjMNN32sGmqu9m0NvCi+ed 2aIcxLEeaXfCd0uuCmCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f2yWZ-0005Hm-CT; Mon, 02 Apr 2018 12:25:23 +0000 Received: from [45.249.212.35] (helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f2yWU-00046u-Bq for linux-arm-kernel@lists.infradead.org; Mon, 02 Apr 2018 12:25:21 +0000 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 33F342E70BD80; Mon, 2 Apr 2018 20:24:59 +0800 (CST) Received: from linux.site (10.67.187.223) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.361.1; Mon, 2 Apr 2018 20:24:53 +0800 From: Abbott Liu To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v3 6/6] Enable KASan for arm Date: Mon, 2 Apr 2018 20:04:40 +0800 Message-ID: <20180402120440.31900-7-liuwenliang@huawei.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180402120440.31900-1-liuwenliang@huawei.com> References: <20180402120440.31900-1-liuwenliang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.187.223] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180402_052518_568889_184D9B5D X-CRM114-Status: GOOD ( 12.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andrey Ryabinin This patch enable kernel address sanitizer for arm. Cc: Andrey Ryabinin Acked-by: Dmitry Vyukov Tested-by: Joel Stanley Tested-by: Florian Fainelli Tested-by: Abbott Liu Signed-off-by: Abbott Liu --- Documentation/dev-tools/kasan.rst | 2 +- arch/arm/Kconfig | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst index f7a18f2..d92120d 100644 --- a/Documentation/dev-tools/kasan.rst +++ b/Documentation/dev-tools/kasan.rst @@ -12,7 +12,7 @@ KASAN uses compile-time instrumentation for checking every memory access, therefore you will need a GCC version 4.9.2 or later. GCC 5.0 or later is required for detection of out-of-bounds accesses to stack or global variables. -Currently KASAN is supported only for the x86_64 and arm64 architectures. +Currently KASAN is supported only for the x86_64, arm64 and arm architectures. Usage ----- diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 7e3d535..ac2287b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -49,6 +49,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 select HAVE_ARCH_MMAP_RND_BITS if MMU select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT) select HAVE_ARCH_THREAD_STRUCT_WHITELIST