Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3326369rwa; Tue, 23 Aug 2022 02:54:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR7uNz39GYSyHBFtCSa8EoPRl4ntDuIlzjUZP82r5CYIbtXpcYGT9li4eEvRJMcnBNNh2fTC X-Received: by 2002:a05:6402:5205:b0:447:ede:e2ef with SMTP id s5-20020a056402520500b004470edee2efmr2812798edd.130.1661248492514; Tue, 23 Aug 2022 02:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248492; cv=none; d=google.com; s=arc-20160816; b=NE6jlq1OGWwR4DqUA3z87zhVcmasP7xQIMy/KnxoR2qlRE6IuGqyA34cjg75biJqpx C3tcTtg3yMQT9OWg4ZnW3pGpsg6sjit+KpwQ7fbk+eiLWAOytgQJhdoVlDvQ4Kk2TT/j J2x2+yCmGzbdoMgXZiUKcQGDviT0S3GGNI51PZRTgQVrpxobN2KnUgO7jSp6sEaoxO7w XlKGahAMsq+Q4JouHbBAqjYYxFlhCnOrhyyJOb3sLI641A3WG+2/pbWpd9zeHfz2lfs1 ppUMqhfeyHYGKz/UTJxClHv/u1YVsQ2FkmxmwmRfmegSvbPXec6SyaS8MXuj8Jjskm28 sDBA== 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=vI6v7rFSVDFb9MGT7tXKmra7R9uIqrn27ov8nT/v6+J2f3BWUxG+wz4a5B1sPmfz8I BfGnkdY7uw8CTAdtuZNUs/eQfRPe+K5spvzK/L4hiTu8OlnWxZweIKf1TGYUKSLYgnt2 /MYeG2S7KEQ5iVTZDSzv5coH7mbX0Fp5ESYlKu0qzYoRDYTOrtAVhM9q0E76Mk1KyvLb NOm7fxSPVTHIm/FY74414CbhXc1zpBrIb8sNJ1p7ZXK6oPRPc/AZVUyZKIHVgqshucOY B1t3tYDFYbQLNF2wzBOfSzTmTjXXfeFjpXj2Vwv/UTAbrZXySfTGZ3kP9FXlQicWolo4 Yn7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=faJo7Th6; 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 ga23-20020a1709070c1700b0072ed60fb78asi3190819ejc.548.2022.08.23.02.54.27; Tue, 23 Aug 2022 02:54:52 -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=faJo7Th6; 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 S243730AbiHWIct (ORCPT + 99 others); Tue, 23 Aug 2022 04:32:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243412AbiHWIaP (ORCPT ); Tue, 23 Aug 2022 04:30:15 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0338974E0B; Tue, 23 Aug 2022 01:15:17 -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 sin.source.kernel.org (Postfix) with ESMTPS id 71974CE1B35; Tue, 23 Aug 2022 08:15:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 879BCC433D7; Tue, 23 Aug 2022 08:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242502; bh=74BDVeIvMBWQuIu/Rh+9XV75YMCsgnfcdiv4ClaKEQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=faJo7Th67wI3Y8hrR1CeMEKasabHROba2H7QK58JoivYuQATcinlfIlRfOulbzrlS MYCOs2I54Xey4PTPLtXQXe7aFnpb0vCZ69m5rx0M9W6mFzRs52trJIXMzasWS42VRb bvQdmP9BMVRTwmCK2GKI/jKiBb3oH4m/W8YYp9gA= 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.9 081/101] nios2: fix syscall restart checks Date: Tue, 23 Aug 2022 10:03:54 +0200 Message-Id: <20220823080037.661864419@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080034.579196046@linuxfoundation.org> References: <20220823080034.579196046@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;