From patchwork Sun Mar 18 12:53:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abbott Liu X-Patchwork-Id: 10291149 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 4605560291 for ; Sun, 18 Mar 2018 13:30:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3452F28A05 for ; Sun, 18 Mar 2018 13:30:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27CDD28FDB; Sun, 18 Mar 2018 13:30:34 +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 9E3C028A05 for ; Sun, 18 Mar 2018 13:30:33 +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: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=GuW9I8NQvkyIX0zGs7SK2eFngvHXJ6e4Yyn+QKXIIWY=; b=B1UeOzPr53DBeW y58WvPjLpXCLwA1WgeQ+Fc8pU2AtImfK4zGCWC0eaMREdv91SoBiVxFpPuSO0QmX6yakp3+OataEO n2HIIYcw5yQwo8jG1JQMwLZEeK3RMFkgztTnsOZxJcxIKw9egNHFKF9pQc5TrWQmy6C4cvNv+m32q t8qrFn2n8KUpfOauLq47Dxw8iH2bmVUmp7g865UZWjo8vq/dHTx45IEntg/k0aHkZKC/v0NA5Z9sn YR6+E57yftUwAobmA8+Itki7A/Ho6GcBKWI8lvAwkqy7S0GBxbv2tbZezn/W1+xTm685QM2vYM4ex 2AfkJM5MQtVeWCPhvlkg==; 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 1exYOJ-0005it-H9; Sun, 18 Mar 2018 13:30:27 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1exYNh-0004mi-Rt for linux-arm-kernel@bombadil.infradead.org; Sun, 18 Mar 2018 13:29:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GzflMZTODJ2UvrdMTJR1/wOm8H+vDOEFmKTDBbKWTvw=; b=FVc9EAGpUSDFe6hUX56UbD0ny /OAtHvyvFHTm0L2ZvawG48DDwuWvxgYCuNoL7iUUAhJsLBsMq7KsLcZUD40h34Ugc19U2awwe1ez8 2UMr2MYXkbIMojLFhOYOvzD07x5vX4YLo8nZnxpk96HI6WpflxTvuuEJ9TDT3Ro8EmdAl5VxoibAO tZEDJSaZ5VlRh116fzZt9M9JamCIcmof0MVE7byut9ex070Gz2jf8/N+YM9q8WEYOH2IBypwOoi/t HzfiymFWd8vVgUnNcS0c3qvpiazQvwK332E+JIcZSBadCmCq8PbOAtlDxLokMCeFqGtnFFZGl0dkO 1jtoKfr+w==; Received: from szxga05-in.huawei.com ([45.249.212.191] helo=huawei.com) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1exY8i-0005E3-RH for linux-arm-kernel@lists.infradead.org; Sun, 18 Mar 2018 13:14:23 +0000 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6AD48D68C1175; Sun, 18 Mar 2018 21:13:50 +0800 (CST) Received: from linux.site (10.67.187.223) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.361.1; Sun, 18 Mar 2018 21:13:41 +0800 From: Abbott Liu To: , , , , , , , , , Subject: [PATCH 3/7] Disable instrumentation for some code Date: Sun, 18 Mar 2018 20:53:38 +0800 Message-ID: <20180318125342.4278-4-liuwenliang@huawei.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180318125342.4278-1-liuwenliang@huawei.com> References: <20180318125342.4278-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-20180318_131421_430476_17463F26 X-CRM114-Status: GOOD ( 12.28 ) 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: , Cc: nicolas.pitre@linaro.org, tixy@linaro.org, grygorii.strashko@linaro.org, catalin.marinas@arm.com, linux@rasmusvillemoes.dk, dhowells@redhat.com, linux-mm@kvack.org, glider@google.com, mark.rutland@arm.com, kvmarm@lists.cs.columbia.edu, opendmb@gmail.com, mawilcox@microsoft.com, kasan-dev@googlegroups.com, geert@linux-m68k.org, linux-arm-kernel@lists.infradead.org, zhichao.huang@linaro.org, labbott@redhat.com, vladimir.murzin@arm.com, keescook@chromium.org, arnd@arndb.de, philip@cog.systems, jinb.park7@gmail.com, tglx@linutronix.de, dvyukov@google.com, ard.biesheuvel@linaro.org, linux-kernel@vger.kernel.org, james.morse@arm.com, kirill.shutemov@linux.intel.com, pombredanne@nexb.com, thgarnie@google.com, christoffer.dall@linaro.org 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/* 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 Tested-by: Florian Fainelli Signed-off-by: Abbott Liu --- arch/arm/boot/compressed/Makefile | 1 + arch/arm/kernel/unwind.c | 3 ++- arch/arm/vdso/Makefile | 2 ++ 3 files changed, 5 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/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