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=-11.2 required=3.0 tests=BAYES_00,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_SANE_1 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 5FDF5C2D0A3 for ; Thu, 12 Nov 2020 09:52:56 +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 C1E6322210 for ; Thu, 12 Nov 2020 09:52:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HWMRn4U+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1E6322210 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wZqfJa4DtIHm9eU18LUflShHCrfxMjrJKMPsnQaP5/M=; b=HWMRn4U+5gxnbr5Wa9qSXe5zq fHr7u4FzcP3CbsGIirE4bAQu/8oANO95NaOVzElXNG0qiQiYsRR5yOe3k39b342YVOw7MSgQx0ku+ F7hUJ00lPp6gxfCipLIi/gLB0unNHJP/vF4FUkFNci6k9kjUPe+ADwjVXavo4yj4a+t9nUo6rEsUz XXw1DNlJLtcMlZD6kJB+T6Q/jrtLDKvcKghpSXRI4d0q/Z8RBoRtxxWpKNxbCnmBdLpcY0qdZrhTx vhVY0lp/J2r/+9H5bFYXK0ROt0hFAVNtC6BKrFtGQ5Cs5dM9mlI26FV7AvitbPwGKOZx3CubjuGDg SlkqyNwQw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kd9Ga-00078h-EK; Thu, 12 Nov 2020 09:51:44 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kd9GX-00077l-6e for linux-arm-kernel@lists.infradead.org; Thu, 12 Nov 2020 09:51:42 +0000 Received: from gaia (unknown [2.26.170.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 95C632053B; Thu, 12 Nov 2020 09:51:37 +0000 (UTC) Date: Thu, 12 Nov 2020 09:51:35 +0000 From: Catalin Marinas To: Andrey Konovalov Subject: Re: [PATCH v2 04/20] kasan, arm64: unpoison stack only with CONFIG_KASAN_STACK Message-ID: <20201112095134.GI29613@gaia> References: <7e95d4739f5617b2c1acf52f37e01f1ca83750b5.1605046662.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7e95d4739f5617b2c1acf52f37e01f1ca83750b5.1605046662.git.andreyknvl@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201112_045141_356009_2AF7D8D1 X-CRM114-Status: GOOD ( 20.72 ) 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: linux-arm-kernel@lists.infradead.org, Marco Elver , Kevin Brodsky , Will Deacon , Branislav Rankov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , Andrew Morton , Vincenzo Frascino , Evgenii Stepanov 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 On Tue, Nov 10, 2020 at 11:20:08PM +0100, Andrey Konovalov wrote: > There's a config option CONFIG_KASAN_STACK that has to be enabled for > KASAN to use stack instrumentation and perform validity checks for > stack variables. > > There's no need to unpoison stack when CONFIG_KASAN_STACK is not enabled. > Only call kasan_unpoison_task_stack[_below]() when CONFIG_KASAN_STACK is > enabled. > > Note, that CONFIG_KASAN_STACK is an option that is currently always > defined when CONFIG_KASAN is enabled, and therefore has to be tested > with #if instead of #ifdef. > > Signed-off-by: Andrey Konovalov > Link: https://linux-review.googlesource.com/id/If8a891e9fe01ea543e00b576852685afec0887e3 > --- > arch/arm64/kernel/sleep.S | 2 +- > arch/x86/kernel/acpi/wakeup_64.S | 2 +- > include/linux/kasan.h | 10 ++++++---- > mm/kasan/common.c | 2 ++ > 4 files changed, 10 insertions(+), 6 deletions(-) > > diff --git a/arch/arm64/kernel/sleep.S b/arch/arm64/kernel/sleep.S > index ba40d57757d6..bdadfa56b40e 100644 > --- a/arch/arm64/kernel/sleep.S > +++ b/arch/arm64/kernel/sleep.S > @@ -133,7 +133,7 @@ SYM_FUNC_START(_cpu_resume) > */ > bl cpu_do_resume > > -#ifdef CONFIG_KASAN > +#if defined(CONFIG_KASAN) && CONFIG_KASAN_STACK > mov x0, sp > bl kasan_unpoison_task_stack_below > #endif I don't understand why CONFIG_KASAN_STACK is not a bool (do you plan to add more values to it?) but for arm64: Acked-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel