Received: by 10.213.65.68 with SMTP id h4csp1097472imn; Thu, 22 Mar 2018 15:22:24 -0700 (PDT) X-Google-Smtp-Source: AG47ELtl5IeX1Sa49a7pfJkl1OHcVy64BCa91jZ7kZe1p/WzjnbfL/C67aLK6vz6g60k51R5mKx6 X-Received: by 2002:a17:902:5609:: with SMTP id h9-v6mr26667768pli.121.1521757344522; Thu, 22 Mar 2018 15:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521757344; cv=none; d=google.com; s=arc-20160816; b=E7u5K1OaJU9Gc0IG5buzrbl9XodbD1D2GS2L0ng0XMo6DqTGIkBQ8Wo1Tt8u9efrSh 9+WhlS24PphKCoKDHJFfW1JfjUp/wuFMLBlA+nSV/7EQegHhM1kKN4hMYudn1TuuB6ob HRMR7Ua5sBwb+E+IY6FQwYMRbpy1fySA5HzS+JVWDpRWjMN/XD5Clvg+QOLYlCoiroxc AMfZGbyX/cXwHCZR40f+LSVaawP90+OLihf2yvOlmi1rm9RQVLLdrRf4k6L2Zzh4YEku 1KK4AEGPcra3NOOdYUZdau+5C9p7Bhqb1DTiCM1Q2kYSKJvLJcStyYx3I6Q+sue06LAu 6xSQ== 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:dmarc-filter:arc-authentication-results; bh=oilQoWjz2zoSNG71uKFtBPp+If2CgjgKwfS3OeDeY5E=; b=pDFDr2/qiASMS127XA3dd26aDBrghwxMK8fKoHdhPGnGGWHHEC9ttU/MQiD03k6kAN R11wtnOR3GBvram1PXNX4uVTBp2EjkXdxSX4Ja/8Uj7+PuzhMq7jFaQ8VGoWt62bmK1A FVaaweTRBdlYv50GZIuWcKbsosejY4T8ROCKChMtMVoFPUjdSCSqWzShNvNTxVRNguLm JousVaTlSNHe09VYl52Ap6WEt1+9UKwQl/Q1h4x2gXs8HJciUQqHzCXkAJfSlJuJ4HgD 2tg1gcWvqrT26y/XYGP39HsqghM7Qx9SftKLta5tyJ07R0XjiacX92DGDuT8h8CT8U3T 3RBA== 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 v4si5520289pfb.284.2018.03.22.15.22.09; Thu, 22 Mar 2018 15:22:24 -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 S1751937AbeCVWVR (ORCPT + 99 others); Thu, 22 Mar 2018 18:21:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:32982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751872AbeCVWVO (ORCPT ); Thu, 22 Mar 2018 18:21:14 -0400 Received: from saruman (jahogan.plus.com [212.159.75.221]) (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 C2E3F21837; Thu, 22 Mar 2018 22:21:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2E3F21837 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jhogan@kernel.org Date: Thu, 22 Mar 2018 22:21:08 +0000 From: James Hogan To: Huacai Chen Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ralf Baechle , linux-mips@linux-mips.org, Russell King , linux-arm-kernel@lists.infradead.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH V3] ZBOOT: fix stack protector in compressed boot phase Message-ID: <20180322222107.GJ13126@saruman> References: <1521186916-13745-1-git-send-email-chenhc@lemote.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="I/5syFLg1Ed7r+1G" Content-Disposition: inline In-Reply-To: <1521186916-13745-1-git-send-email-chenhc@lemote.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --I/5syFLg1Ed7r+1G Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 16, 2018 at 03:55:16PM +0800, Huacai Chen wrote: > diff --git a/arch/mips/boot/compressed/decompress.c b/arch/mips/boot/comp= ressed/decompress.c > index fdf99e9..5ba431c 100644 > --- a/arch/mips/boot/compressed/decompress.c > +++ b/arch/mips/boot/compressed/decompress.c > @@ -78,11 +78,6 @@ void error(char *x) > =20 > unsigned long __stack_chk_guard; =2E.. > diff --git a/arch/mips/boot/compressed/head.S b/arch/mips/boot/compressed= /head.S > index 409cb48..00d0ee0 100644 > --- a/arch/mips/boot/compressed/head.S > +++ b/arch/mips/boot/compressed/head.S > @@ -32,6 +32,10 @@ start: > bne a2, a0, 1b > addiu a0, a0, 4 > =20 > + PTR_LA a0, __stack_chk_guard > + PTR_LI a1, 0x000a0dff > + sw a1, 0(a0) Should that not be LONG_S? Otherwise big endian MIPS64 would get a word-swapped canary (which is probably mostly harmless, but still). Also I think it worth mentioning in the commit message the MIPS configuration you hit this with, presumably a Loongson one? For me decompress_kernel() gets a stack guard on loongson3_defconfig, but not malta_defconfig or malta_defconfig + 64-bit. I presume its sensitive to the compiler inlining stuff into decompress_kernel() or something such that it suddenly qualifies for a stack guard. Cheers James --I/5syFLg1Ed7r+1G Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEd80NauSabkiESfLYbAtpk944dnoFAlq0LFMACgkQbAtpk944 dnrmTQ/+JqSPbejJsFyxpccmWIyLBtYPujNEeohQv5ZthOfaooKRy7NvUQqirXxG HKpHT1EqQtZsXxir/BZxdpo0rN+M/7kMWU9XKLtFqkiz88k1i+k4o7dlrdQcZOqy HFBPtJnkchJrgBxxzPNxmHnWCxOFoYbK2HBxsn0cBGDm9sgLgXPkMwkAk29fG3uT ViYFSUhnlmNAo4GBgUkxSFK3rDZZQWq7DFHaMrTEKeJo0SdLtmCt7YD25grSOp0K klBR1sdHe+oIXQAcowD3xdsLNSNeRoRgtan2Y6ByBLs00+dE7A6D8buruvohh/m4 B37/oeHOEg65kmOVVSnhseaW92YfUyBEkGosJHgV0a9/BoNeN8r1deLgKGb/VYCC bzOiN0pTzDzPZXvIsWEKibOMrrcm/2Et6Gkh4VawwFEKXZ2ZQAkvwUXFvBjXFwuq 3/V3+bLsrS6mdkvDGe3HcqNEdRhGcjt9uISxGhQtPe30aK9EgtTYH/Ol9GNe/R2l b/1eEo5RGf0FAko1+xeE81q+xAUPoR4IECl5wj9LQy/KEP7rBSSJj2Ixxl2YMZGg osFHqfdRh1ihHViu8OMMsT0/qTCH/H953rgGZySpK4twyChK92FMfF2uO7z18NHC uAylLlojOuGKA0t6HsAEuB64oWg3HV2bYGu1p1yQK5XolLuLrWk= =1hrp -----END PGP SIGNATURE----- --I/5syFLg1Ed7r+1G--