Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2490279pxj; Mon, 10 May 2021 04:21:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw10D6BbRiHHRechLVS8TI4Tg0FrhtCoDWSUdk5J3/QxXUcmtkLcaHkLt7TM1zJC1UR0YVD X-Received: by 2002:a17:907:7749:: with SMTP id kx9mr25515891ejc.90.1620645707085; Mon, 10 May 2021 04:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645707; cv=none; d=google.com; s=arc-20160816; b=JwMAJhkyGZmQkoZeNtUBcA4e4geuvnp+jFYJtC49qEXNGPBFGyd8vdtx/x9Tb6V0GE uxImxv4Tr4FWS/e03rtU6Ez9bJJJG3QqcCviqxZ+m+G7Awt1QMnlTofmmqeXpIGxmnkD meckTO9DppNXmmN7HLzjAvJ20bzujza82GgwBpdtujsJSyc8WwTDgce1mlxmQbYPZH2C QR03qdrmP9MSbPFXlnDXsSDj8F/+ovv8hNjSuZ/IMd7pzNNfJatJkaC9WH9TOd9MccNv Rp95zQyK4Ta/TKBdVdt2JoYOHREzvAFjDiJobQ9Gqf+cWZBdcAYHvCpODK5Achiiqbkg Pg0w== 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=XAkY957wiSlwlSdvqTH0dGhxPXion2Q08OSbQ46m5rhtmn67oSDDogmtimkinUhxOb NfzTeYU1mH9TQMUlVI00C7qcV2cdvjp6Tpon6lJ5PZ16Zfs7Y63O/CgjyiDr+HAANjTZ XP1c2afWgnLVq9J2WbtHC3nfuTyaQysacbSLexFk2WGVfImuHZ164gPVTYoSbDlBq0ZX 95FsdDxx2iA51WOBMmJKDaGbaf3Up0QZh20IjzENOjrm9FAZYVq4tZh6EtgAkmM/J9/k AmUVKmgXOBXz5r2qsg4/t7W45ohpCOTue0JDmMHvMYmrA68MQvddd/xGl9UUuZEgpvoT oKMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MDeyT0S5; 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 ku17si12627916ejc.97.2021.05.10.04.21.24; Mon, 10 May 2021 04:21:47 -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=MDeyT0S5; 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 S238122AbhEJLRG (ORCPT + 99 others); Mon, 10 May 2021 07:17:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:41486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233308AbhEJKwP (ORCPT ); Mon, 10 May 2021 06:52:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 10EF461A2B; Mon, 10 May 2021 10:40:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643256; bh=3JC4aHN1cOtrTokfsLFr+sf9fBKzUi9zB+P0fCatCdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MDeyT0S5dZAyTugmPfOH4qMBgr9oMEsuEmjWGvR0CpjnDW5nd+p9XRT5tfFK6znSq 3rCoFz2j3vA9b2me/h7N187O22Bqkrgc2oJNzSKg/fdAPK7vP4nVZeJxSj12c7vfAf Z+6Aa03yf9yJLfAnxJzZCIUqbmwJxKBt3eMXbDgM= 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.10 242/299] powerpc/32: Fix boot failure with CONFIG_STACKPROTECTOR Date: Mon, 10 May 2021 12:20:39 +0200 Message-Id: <20210510102012.954982422@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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)