From mboxrd@z Thu Jan 1 00:00:00 1970 From: will.deacon@arm.com (Will Deacon) Date: Thu, 18 Feb 2016 18:03:54 +0000 Subject: [PATCH] arm64: kasan: clear stale stack poison In-Reply-To: <20160218175447.GD2538@e104818-lin.cambridge.arm.com> References: <1455816458-19485-1-git-send-email-mark.rutland@arm.com> <20160218175447.GD2538@e104818-lin.cambridge.arm.com> Message-ID: <20160218180353.GG16883@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Feb 18, 2016 at 05:54:47PM +0000, Catalin Marinas wrote: > On Thu, Feb 18, 2016 at 05:27:38PM +0000, Mark Rutland wrote: > > @@ -145,6 +146,7 @@ ENTRY(cpu_resume_mmu) > > ENDPROC(cpu_resume_mmu) > > .popsection > > cpu_resume_after_mmu: > > + kasan_unpoison_stack 96 > > I don't think the 96 here is needed since we populate the stack in > assembly (__cpu_suspend_enter) and unwind it again still in assembly > (cpu_resume_after_mmu), so no KASAN shadow writes/reads. > > Otherwise the patch looks fine. I'd much rather it was written in C -- is there a reason we can't do that if we use a separate compilation unit where the compiler will honour the fno-sanitize flag? Will From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161919AbcBRSDv (ORCPT ); Thu, 18 Feb 2016 13:03:51 -0500 Received: from foss.arm.com ([217.140.101.70]:41464 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161752AbcBRSDs (ORCPT ); Thu, 18 Feb 2016 13:03:48 -0500 Date: Thu, 18 Feb 2016 18:03:54 +0000 From: Will Deacon To: Catalin Marinas Cc: Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lorenzo Pieralisi , Ard Biesheuvel , mingo@kernel.org, Andrey Ryabinin , akpm@linux-foundation.org, hpa@linux.intel.com, tglx@linutronix.de Subject: Re: [PATCH] arm64: kasan: clear stale stack poison Message-ID: <20160218180353.GG16883@arm.com> References: <1455816458-19485-1-git-send-email-mark.rutland@arm.com> <20160218175447.GD2538@e104818-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160218175447.GD2538@e104818-lin.cambridge.arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 18, 2016 at 05:54:47PM +0000, Catalin Marinas wrote: > On Thu, Feb 18, 2016 at 05:27:38PM +0000, Mark Rutland wrote: > > @@ -145,6 +146,7 @@ ENTRY(cpu_resume_mmu) > > ENDPROC(cpu_resume_mmu) > > .popsection > > cpu_resume_after_mmu: > > + kasan_unpoison_stack 96 > > I don't think the 96 here is needed since we populate the stack in > assembly (__cpu_suspend_enter) and unwind it again still in assembly > (cpu_resume_after_mmu), so no KASAN shadow writes/reads. > > Otherwise the patch looks fine. I'd much rather it was written in C -- is there a reason we can't do that if we use a separate compilation unit where the compiler will honour the fno-sanitize flag? Will