Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3293257rwa; Tue, 23 Aug 2022 02:08:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR7HPdEtgRz3ORMDAMOCCcGx5vLf7+yKOMrXjyMbgSAAd42XnDcs0W1eSiBe2Ft5NJv3R4dw X-Received: by 2002:a17:906:4796:b0:734:b5b5:96ed with SMTP id cw22-20020a170906479600b00734b5b596edmr15358254ejc.251.1661245724393; Tue, 23 Aug 2022 02:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661245724; cv=none; d=google.com; s=arc-20160816; b=hMX2ynwXZCH4tScd54PEbTu6NlICKh9yYlL9S4x4sgXZieMHxvzobJc20a7ml4094e LhBjf7oLhZ0V6dHjw1qsafcN8LhVS6RBh1iOZTcUUjcTQ1cFKecsA24WM43Gh3d6YDjG 4GAkc5Tzvec9ZUMZCRxov7XLkavHvmDoVRHvOPcD54mlR7MpX4PqH0YGFkQduQsHLqY2 rt8nx2t667k+nU5GsMjOhwq/cyc0eJ207e2obMrvX0TGRICqN7XyCdnsOoSi4vfy0Hlx 3QSjJ+lfT1MclWEUIRsJ0hwwHEb+H5gjS2NjyMvZ1kS/xiaC93tdePVuTQP6bGt2/IfA Ut9g== 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=f816bvCUPJZigk70hcEBjjcYjiaw0gTkhdDnn7Y3OL7jchC+3wOsFJmZ0WiZYUW28V YUE7nvaZD4QOuJNnbQI44A3v8p9ZRQtG0JJGQqkKpBySu4kUe6Tw3dymCtfnA6Pt5k1J eKwxLh0qGdNWkujDr2QqrKv4DO00TNP7HkC+x1/EAdoZoZZ3jGAkb4oxXQyEVN2dHEO/ fDezU8R8CHbdSaRWMonI3f2QyAmtaUd6aRE6w0wR8rnEiyRLPh9EjYojlN4RfW18lcmT rm/DOJjw917SyeXAQqoW+nQpN2cBcOAikVHIo/aqiww/yGDE63BjfOtSLbJOfZHBfHtA +luQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T4bpaJNZ; 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 y13-20020a056402270d00b004461b801769si1900989edd.390.2022.08.23.02.08.17; Tue, 23 Aug 2022 02:08:44 -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=T4bpaJNZ; 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 S1348855AbiHWIrF (ORCPT + 99 others); Tue, 23 Aug 2022 04:47:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347314AbiHWIoU (ORCPT ); Tue, 23 Aug 2022 04:44:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAB6E6B145; Tue, 23 Aug 2022 01:20:57 -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 ams.source.kernel.org (Postfix) with ESMTPS id E8AC8B81C20; Tue, 23 Aug 2022 08:19:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 595E8C433D7; Tue, 23 Aug 2022 08:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242794; bh=c6C804I79hfM6elqVFd462FubGbxEZh/S4AomCrJqhU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T4bpaJNZPwT+Dr10KR2NunMQJ08FlGwny/KxRRkx2flgbIDJ32plxUeKbj2xLaVTO aw9JFcwDZsxtnn9wBN0QHCVvYdapXk8RW20kwi8qyiOnptYVUZFlUwSmNhvtpixi3/ Iqf5H6T1St5Tu0M82OyXivcosyvuHDT1M+IXBfM4= 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.19 169/365] nios2: fix syscall restart checks Date: Tue, 23 Aug 2022 10:01:10 +0200 Message-Id: <20220823080125.293740190@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@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;