Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2179500rdf; Mon, 6 Nov 2023 07:01:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGedWfyidNFC3vwiHzDp21xKDpDKNESz4QiCf2W2MwZqK8kUZ68yFJO8rqqGYXH6t1bm8dM X-Received: by 2002:a25:d411:0:b0:da0:c64f:ea10 with SMTP id m17-20020a25d411000000b00da0c64fea10mr28467261ybf.43.1699282884058; Mon, 06 Nov 2023 07:01:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699282884; cv=none; d=google.com; s=arc-20160816; b=gZ3S+ai6EAgr+HrsrkFwCG8hDo5moe7kwJNIflPceELfg8OhZP8lnJQyHjk+z1Dhxc bf0p5SnUU4Xx602/14DCXnx9eZsIrwXEik7tKSNICO+AlXxxmOnIbFkHc3G1Hor4Vhoc 8B1/FOqIAd4xorGLF/94FXRMUoX3p7Ov5lgbbkjHIEmN+urjOT/fNdFUO3rub8i6xvXh iJLH7tcbB8V+f+Pb946noYVTxe+wR4XH99DQHSdVMxdOhF3UopQWnTI9EYT6ssqyii69 SRW79pTU07L9Uniehh9Cp6C+N3DpcIsvl+UTj/hamQsFLS0uJEv4Hp9fL1tBp0+hxBTk ZnsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:date:message-id :from:subject:content-transfer-encoding:mime-version:dkim-signature; bh=otWInKo9rg2frlgKetZegLywOIvQAXBo4rWiEnzmRvI=; fh=SKNciySQha0LcxNhkor8SJXp809BP032AfJ2Cu4QSKA=; b=zZdocR6zOIz+hzS8klFb0eD5zFFT2zdAtNDGgD37yMGjbgopne2YpUeMcLzNUJuzrj UX4WqzPQklSimi01rwKB4UJADIwwrclidIXMMkS5tNf186wY5IXfLRE8C46V/qV954vm 1xDJy+6K1qwTNTLHHjchD1hYAntR/qzl8dSzQ/8wnmv3TwCV0oEBTfuic9rlBVqEeFlJ W8iVnYz8AlgS3FfiNw1JmA1cOl6uFiinOPQ9Y5rewiXh3T5++fhUjcqSoB3wFy2QS3ow zRX3b6DAbMoc8YUq8zfe9IPGrjvi3utv0zo1OrXMWE0/BX7rVmWVm1c4AJfk6LnZyPiN rEPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="MSulK/Zn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id y130-20020a253288000000b00d9a5ed8b678si4656800yby.76.2023.11.06.07.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 07:01:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="MSulK/Zn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BFBA580481B0; Mon, 6 Nov 2023 07:01:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232202AbjKFPAv (ORCPT + 99 others); Mon, 6 Nov 2023 10:00:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231913AbjKFPAe (ORCPT ); Mon, 6 Nov 2023 10:00:34 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62F51134 for ; Mon, 6 Nov 2023 07:00:31 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPS id 527F7C43397; Mon, 6 Nov 2023 15:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699282829; bh=YFVybbzYNtADnD7EN41/e4YtU6Oeh/3FbWJwT1GX5OM=; h=Subject:From:Date:References:In-Reply-To:To:Cc:From; b=MSulK/ZnMKO8w5IDzRsJ4GAkqFH8+9Z1yTj35fU9fQv+DO2RbO0BakiRQcOY1ET+i 8TlZsU3ACLLt5ICONLUMQINAN+/U5fkHJykYL0Gr9GHa0V7ptKDeUCLwgEehP3hFfB iy/M0dSQWUQ3XRwt4q404PNVn/OBfoN9/QucdK0+3YY6tlnWQGziuei9USrbQBwflg 1PuNgnR1DhAF/gyw5Bt/RZbVYttN72GtkYnH6CUwHXlHbsCsSsgWzkEsVP8kZ9gIGa hsn9LWFuNlj0IhzljyPCoP3DsfnQn1QGQgfxt8MZuFebUr3o/1klL8Cd8CX+CDcZo8 syoP3l3d0xcvQ== Received: from aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (localhost.localdomain [127.0.0.1]) by aws-us-west-2-korg-oddjob-1.ci.codeaurora.org (Postfix) with ESMTP id 2B44BC00446; Mon, 6 Nov 2023 15:00:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [PATCH] riscv: signal: handle syscall restart before get_signal From: patchwork-bot+linux-riscv@kernel.org Message-Id: <169928282917.16503.10982051973529578442.git-patchwork-notify@kernel.org> Date: Mon, 06 Nov 2023 15:00:29 +0000 References: <20230803224458.4156006-1-ancientmodern4@gmail.com> In-Reply-To: <20230803224458.4156006-1-ancientmodern4@gmail.com> To: Haorong Lu Cc: linux-riscv@lists.infradead.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, conor.dooley@microchip.com, andy.chiu@sifive.com, heiko@sntech.de, guoren@kernel.org, viro@zeniv.linux.org.uk, mathis.salmen@matsal.de, abrestic@rivosinc.com, greentime.hu@sifive.com, vincent.chen@sifive.com, linux-kernel@vger.kernel.org X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 06 Nov 2023 07:01:15 -0800 (PST) Hello: This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt : On Thu, 3 Aug 2023 15:44:54 -0700 you wrote: > In the current riscv implementation, blocking syscalls like read() may > not correctly restart after being interrupted by ptrace. This problem > arises when the syscall restart process in arch_do_signal_or_restart() > is bypassed due to changes to the regs->cause register, such as an > ebreak instruction. > > Steps to reproduce: > 1. Interrupt the tracee process with PTRACE_SEIZE & PTRACE_INTERRUPT. > 2. Backup original registers and instruction at new_pc. > 3. Change pc to new_pc, and inject an instruction (like ebreak) to this > address. > 4. Resume with PTRACE_CONT and wait for the process to stop again after > executing ebreak. > 5. Restore original registers and instructions, and detach from the > tracee process. > 6. Now the read() syscall in tracee will return -1 with errno set to > ERESTARTSYS. > > [...] Here is the summary with links: - riscv: signal: handle syscall restart before get_signal https://git.kernel.org/riscv/c/ce4f78f1b53d You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html