Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200311204531.GU25745@shell.armlinux.org.uk>
Date: Wed, 11 Mar 2020 20:45:31 +0000
From: Russell King - ARM Linux admin <linux@...linux.org.uk>
To: Kees Cook <keescook@...omium.org>
Cc: Guenter Roeck <linux@...ck-us.net>,
	Ard Biesheuvel <ard.biesheuvel@...aro.org>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	Emese Revfy <re.emese@...il.com>, Arnd Bergmann <arnd@...db.de>,
	Laura Abbott <labbott@...hat.com>,
	kernel-hardening@...ts.openwall.com
Subject: Re: [PATCH v3] ARM: smp: add support for per-task stack canaries

On Wed, Mar 11, 2020 at 11:47:20AM -0700, Kees Cook wrote:
> On Wed, Mar 11, 2020 at 11:31:13AM -0700, Guenter Roeck wrote:
> > On 3/11/20 10:21 AM, Kees Cook wrote:
> > > On Mon, Mar 09, 2020 at 09:49:31AM -0700, Guenter Roeck wrote:
> > >> On Thu, Dec 06, 2018 at 09:32:57AM +0100, Ard Biesheuvel wrote:
> > >>> On ARM, we currently only change the value of the stack canary when
> > >>> switching tasks if the kernel was built for UP. On SMP kernels, this
> > >>> is impossible since the stack canary value is obtained via a global
> > >>> symbol reference, which means
> > >>> a) all running tasks on all CPUs must use the same value
> > >>> b) we can only modify the value when no kernel stack frames are live
> > >>>    on any CPU, which is effectively never.
> > >>>
> > >>> So instead, use a GCC plugin to add a RTL pass that replaces each
> > >>> reference to the address of the __stack_chk_guard symbol with an
> > >>> expression that produces the address of the 'stack_canary' field
> > >>> that is added to struct thread_info. This way, each task will use
> > >>> its own randomized value.
> > >>>
> > >>> Cc: Russell King <linux@...linux.org.uk>
> > >>> Cc: Kees Cook <keescook@...omium.org>
> > >>> Cc: Emese Revfy <re.emese@...il.com>
> > >>> Cc: Arnd Bergmann <arnd@...db.de>
> > >>> Cc: Laura Abbott <labbott@...hat.com>
> > >>> Cc: kernel-hardening@...ts.openwall.com
> > >>> Acked-by: Nicolas Pitre <nico@...aro.org>
> > >>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@...aro.org>
> > >>
> > >> Since this patch is in the tree, cc-option no longer works on
> > >> the arm architecture if CONFIG_STACKPROTECTOR_PER_TASK is enabled.
> > >>
> > >> Any idea how to fix that ? 
> > > 
> > > I thought Arnd sent a patch to fix it and it got picked up?
> > > 
> > 
> > Yes, but the fix is not upstream (it is only in -next), and I missed it.
> 
> Ah, yes, I found it again now too; it went through rmk's tree.
> 
> For thread posterity:
> 
> ARM: 8961/2: Fix Kbuild issue caused by per-task stack protector GCC plugin
> https://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=8961/2

It's in my fixes branch, waiting for me to do my (now usual) push
of fixes to Linus.

I'm not sure whether the above discussion is suggesting that there's
a problem with this patch, or whether it's trying to encourage me
to send it up to Linus.  I _think_ there's the suggestion that it
causes a regression, hmm?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.