From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Poimboeuf Subject: Re: [PATCH v3] x86/suspend: fix false positive KASAN warning on suspend/resume Date: Fri, 2 Dec 2016 09:08:19 -0600 Message-ID: <20161202150819.2h25oyoj7qsvrw77@treble> References: <20161201171306.swnvi4f2ezavloxd@treble> <20161201173438.bfe5eq23i6ezfxsq@treble> <20161201175611.gf63mwzomt4wrlxy@treble> <20161201203154.mwt5x736g7z6jh3o@treble> <5144d695-7ac4-f992-5239-91c772b0c121@virtuozzo.com> <20161202140147.gvj452hmlbxnstrg@treble> <20161202144240.3tect4hx4cks44iu@treble> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51978 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751427AbcLBPJG (ORCPT ); Fri, 2 Dec 2016 10:09:06 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Andrey Ryabinin Cc: Dmitry Vyukov , "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-pm@vger.kernel.org, LKML , Peter Zijlstra , Ingo Molnar , Andy Lutomirski , Scott Bauer , "x86@kernel.org" , Alexander Potapenko , kasan-dev On Fri, Dec 02, 2016 at 05:45:18PM +0300, Andrey Ryabinin wrote: > > > On 12/02/2016 05:42 PM, Josh Poimboeuf wrote: > > > > diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c > > index 0e9505f..e9d8ba0 100644 > > --- a/mm/kasan/kasan.c > > +++ b/mm/kasan/kasan.c > > @@ -80,7 +80,14 @@ void kasan_unpoison_task_stack(struct task_struct *task) > > /* Unpoison the stack for the current task beyond a watermark sp value. */ > > asmlinkage void kasan_unpoison_task_stack_below(const void *watermark) > > { > > - __kasan_unpoison_stack(current, watermark); > > + /* > > + * Calculate the task stack base address. Avoid using 'current' > > + * because this function is called by early resume code which hasn't > > + * yet set up the percpu register (%gs). > > + */ > > + void *base = (void *)((unsigned long)watermark & CURRENT_MASK); > > CURRENT_MASK is defined only on x86... Oops. I guess I should have taken your suggested patch verbatim... Will do a proper multi-arch compile before submitting v4. -- Josh