From patchwork Fri Feb 12 15:38:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 61872 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp897654lbl; Fri, 12 Feb 2016 07:40:28 -0800 (PST) X-Received: by 10.67.7.1 with SMTP id cy1mr3005245pad.123.1455291628022; Fri, 12 Feb 2016 07:40:28 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id y70si20706054pfa.0.2016.02.12.07.40.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Feb 2016 07:40:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUFoP-00066h-Ew; Fri, 12 Feb 2016 15:39:13 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUFoM-00061S-Nu for linux-arm-kernel@lists.infradead.org; Fri, 12 Feb 2016 15:39:11 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2C14749; Fri, 12 Feb 2016 07:38:01 -0800 (PST) Received: from [10.1.207.150] (e103737-lin.cambridge.arm.com [10.1.207.150]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BFB3A3F25E; Fri, 12 Feb 2016 07:38:47 -0800 (PST) Subject: Re: [PATCH v5sub1 7/8] arm64: move kernel image to base of vmalloc area To: Catalin Marinas , Ard Biesheuvel References: <1454324093-15998-1-git-send-email-ard.biesheuvel@linaro.org> <1454324093-15998-8-git-send-email-ard.biesheuvel@linaro.org> <20160212145844.GI31665@e104818-lin.cambridge.arm.com> <20160212151006.GJ31665@e104818-lin.cambridge.arm.com> <20160212152641.GK31665@e104818-lin.cambridge.arm.com> From: Sudeep Holla Organization: ARM Message-ID: <56BDFC86.5010705@arm.com> Date: Fri, 12 Feb 2016 15:38:46 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160212152641.GK31665@e104818-lin.cambridge.arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160212_073910_806869_D76854B4 X-CRM114-Status: GOOD ( 15.04 ) X-Spam-Score: -7.0 (-------) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-7.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [217.140.101.70 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Marc Zyngier , Will Deacon , Sudeep Holla , Andrey Ryabinin , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org On 12/02/16 15:26, Catalin Marinas wrote: > On Fri, Feb 12, 2016 at 04:17:09PM +0100, Ard Biesheuvel wrote: >> On 12 February 2016 at 16:10, Catalin Marinas wrote: >>> On Fri, Feb 12, 2016 at 04:02:58PM +0100, Ard Biesheuvel wrote: >>>> On 12 February 2016 at 15:58, Catalin Marinas wrote: >>>>> On Mon, Feb 01, 2016 at 11:54:52AM +0100, Ard Biesheuvel wrote: >>>>>> This moves the module area to right before the vmalloc area, and >>>>>> moves the kernel image to the base of the vmalloc area. This is >>>>>> an intermediate step towards implementing KASLR, which allows the >>>>>> kernel image to be located anywhere in the vmalloc area. >>>>>> >>>>>> Signed-off-by: Ard Biesheuvel >>>>> >>>>> This patch is causing lots of KASAN warnings on Juno (interestingly, it >>>>> doesn't seem to trigger on Seattle, though we only tried for-next/core). >>>>> I pushed the branch that I'm currently using here: >>>>> >>>>> git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux for-next/kernmap >>>>> >>>>> >>>>> A typical error (though its place varies based on the config options, >>>>> kernel layout): >>>>> >>>>> BUG: KASAN: stack-out-of-bounds in clockevents_program_event+0x28/0x1b0 at addr ffffffc936257cc8 >>>> >>>> Can you confirm that these are stack accesses? I was having similar >>>> errors before, and I ended up creating the kasan zero page patch >>>> because it turned out the kasan shadow page in question was aliased >>>> and the stack writes were occurring elsewhere. >>> >>> It's possible, we are looking into this. Is there any other patch I miss on >>> the above branch? >> >> I don't think so but I will check > > Commit 7b1af9795773 ("arm64: kasan: ensure that the KASAN zero page is > mapped read-only") was merged in -rc2 while the branch above is based on > -rc1. Anyway, I merged it into -rc2 and the errors are similar. > Sorry to add more confusion, but I observed similar KASAN warning with latest mainline(v4.5-rc3+, commit c05235d50f68) with below diff. Regards, Sudeep --->8 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git i/arch/arm64/Kconfig w/arch/arm64/Kconfig index 8cc62289a63e..fdd1d75f5bad 100644 --- i/arch/arm64/Kconfig +++ w/arch/arm64/Kconfig @@ -9,6 +9,7 @@ config ARM64 select ARCH_HAS_GCOV_PROFILE_ALL select ARCH_HAS_SG_CHAIN select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST + select ARCH_HAS_UBSAN_SANITIZE_ALL select ARCH_USE_CMPXCHG_LOCKREF select ARCH_SUPPORTS_ATOMIC_RMW select ARCH_WANT_OPTIONAL_GPIOLIB diff --git i/arch/arm64/configs/defconfig w/arch/arm64/configs/defconfig index 86581f793e39..0006b0204b97 100644 --- i/arch/arm64/configs/defconfig +++ w/arch/arm64/configs/defconfig @@ -240,11 +240,14 @@ CONFIG_DEBUG_INFO=y CONFIG_DEBUG_FS=y CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_KERNEL=y +CONFIG_KASAN=y +CONFIG_TEST_KASAN=m CONFIG_LOCKUP_DETECTOR=y # CONFIG_SCHED_DEBUG is not set # CONFIG_DEBUG_PREEMPT is not set # CONFIG_FTRACE is not set CONFIG_MEMTEST=y +CONFIG_UBSAN=y CONFIG_SECURITY=y CONFIG_CRYPTO_ECHAINIV=y CONFIG_CRYPTO_ANSI_CPRNG=y