From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD3FEC433DF for ; Tue, 23 Jun 2020 20:53:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 80D8B20702 for ; Tue, 23 Jun 2020 20:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592945595; bh=n//SLMJu7Up4JR3PkWv7N4jc0/XL3Id7mT0hrDjIJSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Ex+Dq8TcGE8u14oIPRHsPYdzJkWP/Lsi3FfHTbuYO8ci4p0QzILdrZpYrZ9yLjfAH roTbgP07gIBgdhWCKVf2KYt3YiIUMfQpGHt3il76bcQYaRdTXCEenlgAGdDC7TI7Pb TlQx+eOstnDXfsSI3zCIv+tZxGd6u9k3E+b4q9SM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403983AbgFWUxN (ORCPT ); Tue, 23 Jun 2020 16:53:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:45204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392901AbgFWUq6 (ORCPT ); Tue, 23 Jun 2020 16:46:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 AC78C214DB; Tue, 23 Jun 2020 20:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592945219; bh=n//SLMJu7Up4JR3PkWv7N4jc0/XL3Id7mT0hrDjIJSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DL54jfaqsUcXgdCW/xd1nm+FtYdelZ4RMAYxZNb2v31RMV1KZvM5HvY6VKqMyG7og +mSmHG0YYt9tyRmAyKC5WoasIt/HkeIGlL1Ut3T0EUv0U6kgYCw2Y5ocmFyVWwQ8Vs jbu2eeTM/Y5k05Upo+kpK/lQw8wonbuui5JhFEfU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stafford Horne , Sasha Levin Subject: [PATCH 4.14 085/136] openrisc: Fix issue with argument clobbering for clone/fork Date: Tue, 23 Jun 2020 21:59:01 +0200 Message-Id: <20200623195307.968710030@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195303.601828702@linuxfoundation.org> References: <20200623195303.601828702@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stafford Horne [ Upstream commit 6bd140e14d9aaa734ec37985b8b20a96c0ece948 ] Working on the OpenRISC glibc port I found that sometimes clone was working strange. That the tls data argument sent in r7 was always wrong. Further investigation revealed that the arguments were getting clobbered in the entry code. This patch removes the code that writes to the argument registers. This was likely due to some old code hanging around. This patch fixes this up for clone and fork. This fork clobber is harmless but also useless so remove. Signed-off-by: Stafford Horne Signed-off-by: Sasha Levin --- arch/openrisc/kernel/entry.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S index 1107d34e45bf1..0fdfa7142f4b3 100644 --- a/arch/openrisc/kernel/entry.S +++ b/arch/openrisc/kernel/entry.S @@ -1102,13 +1102,13 @@ ENTRY(__sys_clone) l.movhi r29,hi(sys_clone) l.ori r29,r29,lo(sys_clone) l.j _fork_save_extra_regs_and_call - l.addi r7,r1,0 + l.nop ENTRY(__sys_fork) l.movhi r29,hi(sys_fork) l.ori r29,r29,lo(sys_fork) l.j _fork_save_extra_regs_and_call - l.addi r3,r1,0 + l.nop ENTRY(sys_rt_sigreturn) l.jal _sys_rt_sigreturn -- 2.25.1