Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3339331rwa; Tue, 23 Aug 2022 03:08:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR6nXVUiN943G2j7yveEBUlPhDjxQALRJIZWlaB+FCDcUlEu4AyDTUDrJAURwOBqk+fJVroD X-Received: by 2002:a17:907:6d8a:b0:73b:d9e4:e628 with SMTP id sb10-20020a1709076d8a00b0073bd9e4e628mr15343734ejc.75.1661249336531; Tue, 23 Aug 2022 03:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661249336; cv=none; d=google.com; s=arc-20160816; b=VMuhLSIPNpMZ64vp52E1LlE7ihvByFoYNcyCGgvUEnVuHCSx9wHeTNY8ehY/7P1rx2 XU0VfL20niZJUEY3euy7xhT/kD9nIVXwYPa4TLDdMHeMLNR2ZGqiXQrZA/OUyHEn5pY3 LY7c9lEt4bt7F5k9aXbhiIndqeEpmmK9M9XxI+R1ND1ktWiaOZBuJXWOhKtcnhKB8JG3 w1sRo6L/5TBRmLuE+6W440DAqtGOycjKaxZ/dhY2qtW5GA2pcvSVzLw1dA84TuXvNWmM XAm/HvHfDD7KvJjeiz/YlZEpLMeaH6YJJh3y4iiPNwFWi/7MU2An1z9EosOCe8+jVRjw izcw== 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=yqJ1JviVmqTSg7TGyamzTvXesAcwJNxn5h9dnTA4d40=; b=hyngT1pwd53o/oDxM1R+EEK/bng6HiLIDv1dK95nGnjsh5w+0gHptVzr+gBc9dK4ZL w8s0bFLL1MVMbXUkIndWnGOaaUgzMRsn8i+bcqZ4bHH6F7IKCOLvFmSxyC2Z9oEuwoEb PaqIRdKnsOLBYH3XZp/8KHFcB9aas4FyOViIts9P5CJDLag38vSRo5G1TBkJUMdKlEo0 YH4KBvZXTafbqommq7cF6pSD7fG2bUeFsVFCriVnNUSGHdpLtZI+LMgC9PVYVfGm4tpp OW2tXDKDphjbeTTjwtJb5baEGae84jxdKoND209DP1WV9SQGVXa6aQGNFQ3lJOHOGsZ5 lJZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LxC+JAkY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht18-20020a170907609200b0073094ce02casi11475388ejc.791.2022.08.23.03.08.30; Tue, 23 Aug 2022 03:08:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LxC+JAkY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S242953AbiHWKGt (ORCPT + 99 others); Tue, 23 Aug 2022 06:06:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352334AbiHWKBm (ORCPT ); Tue, 23 Aug 2022 06:01:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8926177EA5; Tue, 23 Aug 2022 01:49:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1856F61377; Tue, 23 Aug 2022 08:49:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F909C433C1; Tue, 23 Aug 2022 08:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244562; bh=c6C804I79hfM6elqVFd462FubGbxEZh/S4AomCrJqhU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LxC+JAkYPIhFul3bhv/tESQasaknuQKPHm8IKqHQg8iW5FeU0q4m2NMl9uyVlVc44 +80GiY7hx1ilw8s8DIRKDqln/dxoXpwPfsg6+wU2yLx7eEk442LBaHf6jxAHPqtXNq CenU+sr5Te8SBgZ+Z7Ku86/c4aIjSeUKme4sazd4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Al Viro , Dinh Nguyen Subject: [PATCH 5.15 112/244] nios2: fix syscall restart checks Date: Tue, 23 Aug 2022 10:24:31 +0200 Message-Id: <20220823080102.759563448@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro commit 2d631bd58fe0ea3e3350212e23c9aba1fb606514 upstream. sys_foo() returns -512 (aka -ERESTARTSYS) => do_signal() sees 512 in r2 and 1 in r1. sys_foo() returns 512 => do_signal() sees 512 in r2 and 0 in r1. The former is restart-worthy; the latter obviously isn't. Fixes: b53e906d255d ("nios2: Signal handling support") Signed-off-by: Al Viro Signed-off-by: Dinh Nguyen Signed-off-by: Greg Kroah-Hartman --- arch/nios2/kernel/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/nios2/kernel/signal.c +++ b/arch/nios2/kernel/signal.c @@ -242,7 +242,7 @@ static int do_signal(struct pt_regs *reg /* * If we were from a system call, check for system call restarting... */ - if (regs->orig_r2 >= 0) { + if (regs->orig_r2 >= 0 && regs->r1) { continue_addr = regs->ea; restart_addr = continue_addr - 4; retval = regs->r2;