Received: by 10.213.65.68 with SMTP id h4csp30670imn; Fri, 16 Mar 2018 16:26:39 -0700 (PDT) X-Google-Smtp-Source: AG47ELvWyTFce7WXlZyto5rNVjeIsVZS/zgbSNRHvmfQzK2tA4teXsxnH0PLj4zHg1sRNTYBB8je X-Received: by 10.99.64.197 with SMTP id n188mr2847799pga.21.1521242799094; Fri, 16 Mar 2018 16:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521242799; cv=none; d=google.com; s=arc-20160816; b=Ud1D/SZ8NS4n75sezY+si+7RVVVQFsA6HAXncbb2oJSArKdNV6lGeFch4F0L9U2sIQ 3xMLsR35IRuPJebIV8nih/6CiMbWZE7iyaOjJOOwAknxlxvpdY10Va8GGLVpfV/J7imB tgrlW49dKivjsPeB7kwMe4TPo3zBO+XFxY1RAXo8mqjd1+fySbUsETQS8DjdH3jqmsQE 63s/NpF2zzx3W3O0vNmCaFYobpKySnYAdXP/u4jtCKamZjL87vQGhvEioLTZIQdq4z7j WZwDentoeg48F9J3Zv5oltk585wxVkq8XwpFm3sXVDs1YAbM2gUp9kFOJFmst7YLiUQQ QQng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=V8JLcHq3hVwEKRV5u3bTqBUCyZjg5kiOqjqUPF5NcDI=; b=D5cDQgXEIdIvmJazcbA/6hwgaHiT4Pqfu01E+9sIiXTbTYmO9jAQqnkNkk/RRyQdya upAnYp4DetENqo+6aMFgONfVwMJskwrE8FNkZrWiz2eVG9guz0IqGNrbvwollXRGbdrx ZevQeHc+d2BswoIirePL/cmX6x90O6+K+s190AWiKXUlbk/kyxHZymLNOaLdcxNBbjtW A9j2/Zg+CoT4B5FhqVezAjVYJ3X3R7BlQLaQvIK2nIsRm/9B84VElZ0GVYk0iuj3DwMC 95+PbkO3G1cs4BGUfHrNSOQwStgBfKWplWfOzDb4U8pbIwegx2D9ad6zVVjsg4atLH7x RBsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si5473266pfm.366.2018.03.16.16.26.24; Fri, 16 Mar 2018 16:26:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752678AbeCPXY6 (ORCPT + 99 others); Fri, 16 Mar 2018 19:24:58 -0400 Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:60786 "EHLO brightrain.aerifal.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751475AbeCPXY4 (ORCPT ); Fri, 16 Mar 2018 19:24:56 -0400 X-Greylist: delayed 642 seconds by postgrey-1.27 at vger.kernel.org; Fri, 16 Mar 2018 19:24:56 EDT Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2) id 1ewyXv-0001Zn-00; Fri, 16 Mar 2018 23:13:59 +0000 Date: Fri, 16 Mar 2018 19:13:59 -0400 From: Rich Felker To: Andrew Morton Cc: Huacai Chen , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ralf Baechle , James Hogan , linux-mips@linux-mips.org, Russell King , linux-arm-kernel@lists.infradead.org, Yoshinori Sato , linux-sh@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH V3] ZBOOT: fix stack protector in compressed boot phase Message-ID: <20180316231359.GU1436@brightrain.aerifal.cx> References: <1521186916-13745-1-git-send-email-chenhc@lemote.com> <20180316151337.f277e3a734326672d41cec61@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180316151337.f277e3a734326672d41cec61@linux-foundation.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 16, 2018 at 03:13:37PM -0700, Andrew Morton wrote: > On Fri, 16 Mar 2018 15:55:16 +0800 Huacai Chen wrote: > > > Call __stack_chk_guard_setup() in decompress_kernel() is too late that > > stack checking always fails for decompress_kernel() itself. So remove > > __stack_chk_guard_setup() and initialize __stack_chk_guard before we > > call decompress_kernel(). > > > > Original code comes from ARM but also used for MIPS and SH, so fix them > > together. If without this fix, compressed booting of these archs will > > fail because stack checking is enabled by default (>=4.16). > > > > ... > > > > arch/arm/boot/compressed/head.S | 4 ++++ > > arch/arm/boot/compressed/misc.c | 7 ------- > > arch/mips/boot/compressed/decompress.c | 7 ------- > > arch/mips/boot/compressed/head.S | 4 ++++ > > arch/sh/boot/compressed/head_32.S | 8 ++++++++ > > arch/sh/boot/compressed/head_64.S | 4 ++++ > > arch/sh/boot/compressed/misc.c | 7 ------- > > 7 files changed, 20 insertions(+), 21 deletions(-) > > Perhaps this should be split into three patches and each one routed via > the appropriate arch tree maintainer (for sh, that might be me). Apologies for that. I'm trying to pick back up on things now, now that I've got both some downtime from other things and funding for core sh maintenance stuff. If you know any issues you'd especially like me to put my attention on now, please let me know. I have a few patches queued up from myself and others, but I believe there's a lot more I haven't been able to get to for quite a while. I should have new SH hardware to test on soon and in the meantime I've improved my qemu setup. One question I have about this specific patch is why any code is needed at all. Why can't __stack_chk_guard just be moved to initialized data, or left uninitialized, for the compressed kernel image loader? Assuming it is needed, the code looks ok, but I question the premise. Rich