From patchwork Thu Apr 12 12:54:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abbott Liu X-Patchwork-Id: 10338549 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 9EAF860134 for ; Thu, 12 Apr 2018 13:20:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87A2823B23 for ; Thu, 12 Apr 2018 13:20:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78101288B8; Thu, 12 Apr 2018 13:20:38 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI 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 D03CD23B23 for ; Thu, 12 Apr 2018 13:20:29 +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=a2wOkBUDYHDhB9l4fOllhNLu1wRLkH2BwydHxXX6/4o=; b=ro9eXddDtoHoqb x9/HAOXT7+kICJWu7Clr0UhmMdqOvAy53+BdTKQe1Bu1CjlNZUMQFnObVbrgtF3Z86Rmm9cG0gSXj hJVFJj1w7e/6Bpm5oUTlHGwN3K4DtcBJdUjppJo3W6QFGQfTaR2lvvAUblfCPy9ZUQPOW5tLwlDGC DY+mPAnwp3ZzlEClTInKc+2EEH5YkK3ElVeRnfXR8Ise2d0P4AVVR9VM2UUoI0UBktgE59HlM6gyQ LTY9OP5hNXu/7hY2MSx4ZIAB8Rmzbn4l++6sw03btGGU6pduvWp6txMWLdZ5qpI26owl8DXSd+APe t9iqP2Jjk7o4/TyM99FA==; 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 1f6c98-0006k6-LT; Thu, 12 Apr 2018 13:20:14 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f6c4J-0001z0-6X for linux-arm-kernel@lists.infradead.org; Thu, 12 Apr 2018 13:15:22 +0000 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id E19F85ED509A8; Thu, 12 Apr 2018 21:14:43 +0800 (CST) Received: from linux.site (10.67.187.223) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.361.1; Thu, 12 Apr 2018 21:14:36 +0800 From: Abbott Liu To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH 6/6] Enable KASan for arm Date: Thu, 12 Apr 2018 20:54:11 +0800 Message-ID: <20180412125411.326-7-liuwenliang@huawei.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180412125411.326-1-liuwenliang@huawei.com> References: <20180412125411.326-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-20180412_061515_469265_045455BD X-CRM114-Status: GOOD ( 12.53 ) 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 1878083..cd71bea 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