Received: by 10.213.65.68 with SMTP id h4csp12938imn; Thu, 22 Mar 2018 20:52:39 -0700 (PDT) X-Google-Smtp-Source: AG47ELtoUfnm5V2478TPdpulqiivzRDqh8vZ6nGG2yukJDOtthdXRzfD7lXcj70jqGC9nL/LVNpp X-Received: by 2002:a17:902:8c84:: with SMTP id t4-v6mr18381793plo.357.1521777159717; Thu, 22 Mar 2018 20:52:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521777159; cv=none; d=google.com; s=arc-20160816; b=oLBNZxodYJyALArP2kwy8dDpeFmd5g9RyrnJJKKCXw+DHTr1YiaOEafqCEiLZyzyyl joajpQCw83G9tEQDTyJJWph0dzZZHJ05fLrxwLZKupcDjSLxfhxh7BoRN1wIbADytJ9t RPDb/ingcMXLvN72MJbjWLHoqBR1hZNklq0EudM9Cz5dYYJ/LDQgXPI8dCgQY+rGyE+G ykoDC96eBMFvCJhI6PFKvDgBkIoiqbZCayyTYBJJpBQwJJS6vFFpNaC+O/cbA17JxzKN CiEvMlvw4qcehItRkkiz2gbpinVItkIYLvGblzR60FRpmXN/kfMXkE+OZymNMtJ76W+2 j5nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:dkim-signature:arc-authentication-results; bh=5SvjjoAUaysI2wrTTFD9UUpWnSloq+ThLng+isqMh9o=; b=nCsu+c+TjJhG3xHJ4IB3pOHyx1zt5EHKnc/16ZbVpHLxx+MGj248byZTyygbwG0tMi xM+usTPFhv6b6GWWGI6TgrFXzmo3vlBlijUjBCrc7kPXEar6Ue8xCSfq6VX/06G1VG8I egRLoMlRFz8LXUADMd1MbApDx2L8HSeo8IG/EfKfto5BIuI3tgtZtF3xegCO/C12BCl+ kh15QMtjXP4AfxHcNr/6/bgCkYVSyrRgxAdjgI9+jsc9A47MPqXl6LGl2Vr0w+UAoEdN fIQ2hyAmcLxECV5l4vvFenoJno+ftzQxpkM8QtejODBf7kFD3RTZIDWJfznK22xUHYu/ ndaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=lHkXx2N2; dkim=pass header.i=@flygoat.com header.s=mail header.b=bOqWGPya; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z18si5911493pfe.41.2018.03.22.20.52.21; Thu, 22 Mar 2018 20:52: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; dkim=pass header.i=@flygoat.com header.s=mail header.b=lHkXx2N2; dkim=pass header.i=@flygoat.com header.s=mail header.b=bOqWGPya; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752027AbeCWDvN (ORCPT + 99 others); Thu, 22 Mar 2018 23:51:13 -0400 Received: from forward106p.mail.yandex.net ([77.88.28.109]:38096 "EHLO forward106p.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751863AbeCWDvM (ORCPT ); Thu, 22 Mar 2018 23:51:12 -0400 Received: from mxback14g.mail.yandex.net (mxback14g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:93]) by forward106p.mail.yandex.net (Yandex) with ESMTP id DCCB72D83563; Fri, 23 Mar 2018 06:51:09 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback14g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4lPL1HOGOQ-p6oCJx1v; Fri, 23 Mar 2018 06:51:09 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1521777069; bh=5SvjjoAUaysI2wrTTFD9UUpWnSloq+ThLng+isqMh9o=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References; b=lHkXx2N2g3r+ukjyvevXiufSaniAYxmCxusabFowL961JCH+vsbjNq6COsKmXQwcP +vw0dfVnf5HZapO3qwht6uPC8o4iEslzgh0y1RcNdrA+TIKYdvYZPNy2tE7+/SWkUi GaIS/vVJrT2ipM7ygvnvYS3AiyqhoMpwOZk2nSVI= Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id D7pNAh9uwJ-owcCxaRF; Fri, 23 Mar 2018 06:51:03 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1521777064; bh=5SvjjoAUaysI2wrTTFD9UUpWnSloq+ThLng+isqMh9o=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References; b=bOqWGPya+FtO031ZYUsV8ILP2vNq1uPJ1u9rl4js2Dz4Ugp9WUj2+uXucsXlvXWSc 14Jb8zkvYPnKvdw5eN78/m8foQMWrGI3MxyBFOnU4YMQ2whRX5GjRgWKk3r3G/9+p6 vcKPa9jha79SDG/LYqf7hwZv7m4HbBlw0J0LYQjQ= Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@flygoat.com Message-ID: <1521777055.1510.9.camel@flygoat.com> Subject: Re: [PATCH V3] ZBOOT: fix stack protector in compressed boot phase From: Jiaxun Yang To: James Hogan , 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 Date: Fri, 23 Mar 2018 11:50:55 +0800 In-Reply-To: <20180322222107.GJ13126@saruman> References: <1521186916-13745-1-git-send-email-chenhc@lemote.com> <20180322222107.GJ13126@saruman> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.5 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2018-03-22四的 22:21 +0000,James Hogan写道: > 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/compressed/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) > > > > unsigned long __stack_chk_guard; > > ... > > > 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 > > > > + PTR_LA a0, __stack_chk_guard > > + PTR_LI a1, 0x000a0dff > > + sw a1, 0(a0) > Hi James Huacai Can't reply this mail. His chenhc@lemote.com is blcoked by Linux-MIPS mailing list while his Gmail didn't receive this email, so I'm replying for him. > Should that not be LONG_S? Otherwise big endian MIPS64 would get a > word-swapped canary (which is probably mostly harmless, but still). Yes, he said it's considerable. > > 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. Have you tested with CONFIG_CC_STACKPROTECTOR_STRONG=y ? Huacai reproduced the issue by this[1] config with GCC 4.9. [1] https://github.com/loongson-community/linux-stable/blob/rebase-4.14 /arch/mips/configs/loongson3_defconfig > > Cheers > James