From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C849BC54FD0 for ; Mon, 20 Apr 2020 20:45:27 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 74DEB20575 for ; Mon, 20 Apr 2020 20:45:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="vX206r13" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74DEB20575 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 495dxc3l8mzDqqJ for ; Tue, 21 Apr 2020 06:45:24 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=will@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=vX206r13; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 495dtd0ntjzDqgn for ; Tue, 21 Apr 2020 06:42:48 +1000 (AEST) Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 50BB9207FC; Mon, 20 Apr 2020 20:42:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587415366; bh=/Lm2cTmavSfvPwo3EnY/skppJ5i7CHKipIJNiAMzESE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vX206r139s9j+s4JKnaMI4JpxtutoxgTKEzqEw3LnEF+8MAWjTABg/8ixx8KpUvhJ aBeW060QZCReO+UrYVjtFosA573ZmpGd4EEAhYESWJJ38YU2e8uDaSguoFjd9eEoa2 GF7apirwkq/9qg8hWCNZ5P1q630+XpFbjnKHsvw4= Date: Mon, 20 Apr 2020 21:42:39 +0100 From: Will Deacon To: George Spelvin Subject: Re: [RFC PATCH v1 40/50] arch/*/include/asm/stackprotector.h: Use get_random_canary() consistently Message-ID: <20200420204238.GB29998@willie-the-truck> References: <202003281643.02SGhM0T009250@sdf.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202003281643.02SGhM0T009250@sdf.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , linux-sh@vger.kernel.org, linux-mips@vger.kernel.org, Max Filippov , Paul Mackerras , "H. Peter Anvin" , Yoshinori Sato , x86@kernel.org, Russell King , Ingo Molnar , Catalin Marinas , James Hogan , linux-xtensa@linux-xtensa.org, Borislav Petkov , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Chris Zankel , Paul Burton , linux-kernel@vger.kernel.org, Ralf Baechle , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 > Cc: Russell King > Cc: linux-arm-kernel@lists.infradead.org > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Ralf Baechle > Cc: Paul Burton > Cc: James Hogan > Cc: linux-mips@vger.kernel.org > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc: linuxppc-dev@lists.ozlabs.org > Cc: Yoshinori Sato > Cc: Rich Felker > Cc: linux-sh@vger.kernel.org > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: "H. Peter Anvin" > Cc: x86@kernel.org > Cc: Chris Zankel > Cc: Max Filippov > Cc: linux-xtensa@linux-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