From patchwork Mon Apr 2 12:04:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abbott Liu X-Patchwork-Id: 10319673 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 DEFD7602C8 for ; Mon, 2 Apr 2018 12:29:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC7EE28A7A for ; Mon, 2 Apr 2018 12:29:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C068F28AF7; Mon, 2 Apr 2018 12:29:12 +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=unavailable 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 4CEE128A7A for ; Mon, 2 Apr 2018 12:29:12 +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=GEWXZpGFbxItXr48QYV0e63g3ygFNlFNRmw0bzNoy7I=; b=NFgSHbJEpeX8jZ 6/Nwet//Iz7F0sXoWijSFegAFKHCf0HZpzwYaV8Ob3XRZh7aK8ofiHpJBsbb2NUtwPxkZho6rATcV 8suv+YuAzT6Fc13rqogNn9iGpICa1vm9niZ/i+TtBxIKUkgxvgvUFTSYSsC7NJNB8BiOvBGh9XOs3 WFN7a5jgwkztB7v9+hNmOkN3z4I8RVDtzv4ufFULrxP+SEQYfYU0xgfKy6pqP/Lsd0wqlucCNMste 59qSQhNHVocbt7OafyCbTeTVzvzpLRwU92Evgc454R49mawOhx5y3iKK4IcDFBxdM6OEuOyFQdPnJ eJRTXM9GjWigBJ5ErZAg==; 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 1f2ya4-0007ER-Gd; Mon, 02 Apr 2018 12:29:00 +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 1f2yWj-0005HW-0V for linux-arm-kernel@lists.infradead.org; Mon, 02 Apr 2018 12:25:35 +0000 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 8BA34169DDB84; 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:52 +0800 From: Abbott Liu To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v3 2/6] Disable instrumentation for some code Date: Mon, 2 Apr 2018 20:04:36 +0800 Message-ID: <20180402120440.31900-3-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_052533_272363_BF404D5A X-CRM114-Status: GOOD ( 14.59 ) 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 Disable instrumentation for arch/arm/boot/compressed/* ,arch/arm/kvm/hyp/* and arch/arm/vdso/* because those code won't linkd with kernel image. Disable kasan check in the function unwind_pop_register because it doesn't matter that kasan checks failed when unwind_pop_register read stack memory of task. Reviewed-by: Russell King - ARM Linux Reviewed-by: Florian Fainelli Reviewed-by: Marc Zyngier Tested-by: Joel Stanley Tested-by: Florian Fainelli Tested-by: Abbott Liu Signed-off-by: Abbott Liu --- arch/arm/boot/compressed/Makefile | 1 + arch/arm/kernel/unwind.c | 3 ++- arch/arm/kvm/hyp/Makefile | 4 ++++ arch/arm/vdso/Makefile | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 45a6b9b..966103e 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -24,6 +24,7 @@ OBJS += hyp-stub.o endif GCOV_PROFILE := n +KASAN_SANITIZE := n # # Architecture dependencies diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c index 0bee233..2e55c7d 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c @@ -249,7 +249,8 @@ static int unwind_pop_register(struct unwind_ctrl_block *ctrl, if (*vsp >= (unsigned long *)ctrl->sp_high) return -URC_FAILURE; - ctrl->vrs[reg] = *(*vsp)++; + ctrl->vrs[reg] = READ_ONCE_NOCHECK(*(*vsp)); + (*vsp)++; return URC_OK; } diff --git a/arch/arm/kvm/hyp/Makefile b/arch/arm/kvm/hyp/Makefile index 63d6b40..0a8b500 100644 --- a/arch/arm/kvm/hyp/Makefile +++ b/arch/arm/kvm/hyp/Makefile @@ -24,3 +24,7 @@ obj-$(CONFIG_KVM_ARM_HOST) += hyp-entry.o obj-$(CONFIG_KVM_ARM_HOST) += switch.o CFLAGS_switch.o += $(CFLAGS_ARMV7VE) obj-$(CONFIG_KVM_ARM_HOST) += s2-setup.o + +GCOV_PROFILE := n +KASAN_SANITIZE := n +UBSAN_SANITIZE := n diff --git a/arch/arm/vdso/Makefile b/arch/arm/vdso/Makefile index bb411821..87abbb7 100644 --- a/arch/arm/vdso/Makefile +++ b/arch/arm/vdso/Makefile @@ -30,6 +30,8 @@ CFLAGS_vgettimeofday.o = -O2 # Disable gcov profiling for VDSO code GCOV_PROFILE := n +KASAN_SANITIZE := n + # Force dependency $(obj)/vdso.o : $(obj)/vdso.so