Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2555397pxj; Mon, 10 May 2021 05:50:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysC7Q5UnUzF6wbJhhltZNR4jsnuLpf/w/xa99kKIE0Gc2miB+rsiMTegmyggivarz5qm/m X-Received: by 2002:aa7:d843:: with SMTP id f3mr29222433eds.270.1620651056512; Mon, 10 May 2021 05:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620651056; cv=none; d=google.com; s=arc-20160816; b=f9UPesvLVfxE08pC3NTnzoYKpXbdclzgL5MWEmM0pGZrTenW3G9H+JAjrFKdQNZCyi QsoDEQt/pqyaQGAXsVoP2yrCv03qovHO6BJlNjNK38oFLAYZgKJwk3C/PNU29mUWdLdY jLi9xGZECssG+Cf5/Ka1D2Oo9a2ExjS461ufzM+tM1LcW8MNMErtBZxBBl+LkE4vAYE6 QrKYbBjtW14+0VXNlwuP7Uw2YyvRlNyp2nuSYmFFStZ6/bWqLGnw4WCyJlUs3WhBF71g 8VOJyOTgAvqDtW+seaIABlH/oWHHvBTzcpMlpgpyREyfPRgr2LnTIYzMqJqckFwq/Aei 6e0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5s8Om6S4h40ko6mbSvCTw1c+fzjfDAkP0DswYEAbmRE=; b=FtR9SA46+Mky18GBpxyWnyM4QtozARUY1ZsfZUuBu3Y2Fub2Kj1yk4ADupsI9TbPte 4WTFNdJoVKkzLPkz+kdPeGOc18ehcXLDuggALzlCSTBrTX10sUe0TdhJUE1AEkX2Bxvp mJ2h6GYzeBbGZwLs+xZab1wHYm7owscdIqjC/JwVOdyeCJHz0rbypvizpFrsM4cblcab TVqYk/6q+w4kLWq6vz3jIUQHgir5oKS6tuBwMiD7T+Op+pPrdn2+CLuY9VXONV5LUWkK ZR6RodcqopokpMQ3TZ3GGa10H21a1w6aEnMwrt4Av1cjJSwEvtqhSQKku2k+oLTV3CkE EIaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g7KICew1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si14001797edc.493.2021.05.10.05.50.32; Mon, 10 May 2021 05:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g7KICew1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347851AbhEJMho (ORCPT + 99 others); Mon, 10 May 2021 08:37:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:54898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237718AbhEJLQB (ORCPT ); Mon, 10 May 2021 07:16:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7D7096143C; Mon, 10 May 2021 11:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620645082; bh=3JC4aHN1cOtrTokfsLFr+sf9fBKzUi9zB+P0fCatCdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g7KICew1qTRnuYf4K76AmfK7+5NUo8kx+Z8c90i5N+8tkscEDlyZDz2onIscoMmeA NCs5i/pLHajW3njs61WDvVC/DY0RI0XiMQMj8jZGLNhC5m4O4zLVSOtVU7C627PPal 9ne6s04wmZNIUcHJnjZzsE6WAtZdbbHy//A+R2nM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Neuschaefer , Christophe Leroy , Michael Ellerman Subject: [PATCH 5.12 309/384] powerpc/32: Fix boot failure with CONFIG_STACKPROTECTOR Date: Mon, 10 May 2021 12:21:38 +0200 Message-Id: <20210510102024.988470336@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102014.849075526@linuxfoundation.org> References: <20210510102014.849075526@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe Leroy commit f5668260b872e89b8d3942a8b7d4278aa9c2c981 upstream. Commit 7c95d8893fb5 ("powerpc: Change calling convention for create_branch() et. al.") complexified the frame of function do_feature_fixups(), leading to GCC setting up a stack guard when CONFIG_STACKPROTECTOR is selected. The problem is that do_feature_fixups() is called very early while 'current' in r2 is not set up yet and the code is still not at the final address used at link time. So, like other instrumentation, stack protection needs to be deactivated for feature-fixups.c and code-patching.c Fixes: 7c95d8893fb5 ("powerpc: Change calling convention for create_branch() et. al.") Cc: stable@vger.kernel.org # v5.8+ Reported-by: Jonathan Neuschaefer Signed-off-by: Christophe Leroy Tested-by: Jonathan Neuschaefer Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b688fe82927b330349d9e44553363fa451ea4d95.1619715114.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/lib/Makefile | 3 +++ 1 file changed, 3 insertions(+) --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile @@ -5,6 +5,9 @@ ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC) +CFLAGS_code-patching.o += -fno-stack-protector +CFLAGS_feature-fixups.o += -fno-stack-protector + CFLAGS_REMOVE_code-patching.o = $(CC_FLAGS_FTRACE) CFLAGS_REMOVE_feature-fixups.o = $(CC_FLAGS_FTRACE)