Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3409657rwa; Tue, 23 Aug 2022 04:25:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR4e+H2lJmusEoY9n3i0lq5xHL2MqbSql+IRV39pEWr17xXwDmzj591JOEy+suM3i3rnqR+b X-Received: by 2002:a05:6402:4282:b0:43e:612c:fcf7 with SMTP id g2-20020a056402428200b0043e612cfcf7mr3236574edc.242.1661253931834; Tue, 23 Aug 2022 04:25:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253931; cv=none; d=google.com; s=arc-20160816; b=stdXkguhCNg5zG65h6ToKOjCNWmX3wuHEb6NTDdbGHg9EcgZRQndvC7mFNRF9lJYL1 S+8yrK67NhYObkyZGieo9a2EZmkCUAvvoyOD0NRekJcxydlsun5VW0zVkiEWUhm3hFy5 B1/2cdnvjgN7JArU/tfA9g6xBj9DkUNmo2KeU1l9aD4VoHcVkF6mLjfIN6LWIAILP29H AHczbtGf7iV0Z4agHzkraWh1zJoUFpNKnu1D+5lCP1xNvKfzaW5JoF7CerhTdPteGoMM u2ZIHp4PZQ7So0Uy3UNKvchQTAlqSMQzXu6HJ2RvgqWLOCD73XZpOYmvuuXtAH5mbXpf EflA== 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=N+KQhjZzjRM6R6+J0oKHiTFloXiZssvfwJjXwQpDrxQ=; b=DeYvDI43+SJggRD+XA1/JBnH19aWye+XpK13o/m6aZ+/8R/35HwJL28LG6aoYvDLMs R60beSXepZYXpuJqh+Zd76l/NxW4h+q77+HOKXkWxswRqktABDAacoFoV5ccJ1WSY/Ke DBVdprhlDcurRZAPdYI5I6/wp7GaMnNoe9qe1F+uSwt4FWYdZHd+Fl69OORI272lU0tH z3THUtd3PiyvrNHNqnYXAAnYEdQmAAWks2aii096N58l1rkS6mKkVeIuQhWOVBAMjtUK HWAoL6bLaN9XY8cEAxwHNRCQqj1/pQ8WLeVndyZtOckdEto9v6JfQsoa9pCCJ+US0b8X UZOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="nZT/9W9T"; 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-20020a50e60d000000b00445f36fb1dcsi1617052edm.609.2022.08.23.04.25.05; Tue, 23 Aug 2022 04:25:31 -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="nZT/9W9T"; 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 S1352768AbiHWKRc (ORCPT + 99 others); Tue, 23 Aug 2022 06:17:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352361AbiHWKH1 (ORCPT ); Tue, 23 Aug 2022 06:07:27 -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 B1A4926546; Tue, 23 Aug 2022 01:54:04 -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 669FEB81B90; Tue, 23 Aug 2022 08:54:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B08CAC433D6; Tue, 23 Aug 2022 08:54:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244842; bh=74BDVeIvMBWQuIu/Rh+9XV75YMCsgnfcdiv4ClaKEQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nZT/9W9T+yeK1n6cW7kt1MKiwWLoGfmcD/k1j5zqfgC5GA6983OajMIf8TFa2fBQS YwD5zl79fckpUpIhdHVBAPmfKs+6j0QpVgmYHnhp3eC7Z46Jnc9oL7wSd1YxQUzweE vJrPXkEUQP9yLcb/Dbzy59NynTAoYThvyHBcluHY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Al Viro , Dinh Nguyen Subject: [PATCH 4.14 200/229] nios2: fix syscall restart checks Date: Tue, 23 Aug 2022 10:26:01 +0200 Message-Id: <20220823080100.783428681@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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 @@ -240,7 +240,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;