[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200420204238.GB29998@willie-the-truck>
Date: Mon, 20 Apr 2020 21:42:39 +0100
From: Will Deacon <will@...nel.org>
To: George Spelvin <lkml@....org>
Cc: linux-kernel@...r.kernel.org, Russell King <linux@...linux.org.uk>,
linux-arm-kernel@...ts.infradead.org,
Catalin Marinas <catalin.marinas@....com>,
Ralf Baechle <ralf@...ux-mips.org>,
Paul Burton <paulburton@...nel.org>,
James Hogan <jhogan@...nel.org>, linux-mips@...r.kernel.org,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
linuxppc-dev@...ts.ozlabs.org,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Rich Felker <dalias@...c.org>, linux-sh@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Chris Zankel <chris@...kel.net>,
Max Filippov <jcmvbkbc@...il.com>,
linux-xtensa@...ux-xtensa.org
Subject: Re: [RFC PATCH v1 40/50] arch/*/include/asm/stackprotector.h: Use
get_random_canary() consistently
On Tue, Dec 10, 2019 at 12:35:14AM -0500, George Spelvin wrote:
> ... in boot_init_stack_canary().
>
> This is the archetypical example of where the extra security of
> get_random_bytes() is wasted. The canary is only important as
> long as it's stored in __stack_chk_guard.
>
> It's also a great example of code that has been copied around
> a lot and not updated.
>
> Remove the XOR with LINUX_VERSION_CODE as it's pointless; the inclusion
> of utsname() in init_std_data in the random seeding obviates it.
>
> The XOR with the TSC on x86 and mtfb() on powerPC were left in,
> as I haven't proved them redundant yet. For those, we call
> get_random_long(), xor, and mask manually.
>
> FUNCTIONAL CHANGE: mips and xtensa were changed from 64-bit
> get_random_long() to 56-bit get_random_canary() to match the
> others, in accordance with the logic in CANARY_MASK.
>
> (We could do 1 bit better and zero *one* of the two high bytes.)
>
> Signed-off-by: George Spelvin <lkml@....org>
> Cc: Russell King <linux@...linux.org.uk>
> Cc: linux-arm-kernel@...ts.infradead.org
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: Will Deacon <will@...nel.org>
> Cc: Ralf Baechle <ralf@...ux-mips.org>
> Cc: Paul Burton <paulburton@...nel.org>
> Cc: James Hogan <jhogan@...nel.org>
> Cc: linux-mips@...r.kernel.org
> Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
> Cc: Paul Mackerras <paulus@...ba.org>
> Cc: Michael Ellerman <mpe@...erman.id.au>
> Cc: linuxppc-dev@...ts.ozlabs.org
> Cc: Yoshinori Sato <ysato@...rs.sourceforge.jp>
> Cc: Rich Felker <dalias@...c.org>
> Cc: linux-sh@...r.kernel.org
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Borislav Petkov <bp@...en8.de>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Cc: x86@...nel.org
> Cc: Chris Zankel <chris@...kel.net>
> Cc: Max Filippov <jcmvbkbc@...il.com>
> Cc: linux-xtensa@...ux-xtensa.org
> ---
> arch/arm/include/asm/stackprotector.h | 9 +++------
> arch/arm64/include/asm/stackprotector.h | 8 ++------
> arch/mips/include/asm/stackprotector.h | 7 ++-----
> arch/powerpc/include/asm/stackprotector.h | 6 ++----
> arch/sh/include/asm/stackprotector.h | 8 ++------
> arch/x86/include/asm/stackprotector.h | 4 ++--
> arch/xtensa/include/asm/stackprotector.h | 7 ++-----
> 7 files changed, 15 insertions(+), 34 deletions(-)
Just found this kicking around in the depths of my inbox. Is the series
dead?
Will
Powered by blists - more mailing lists