From: patchwork-bot+linux-riscv@kernel.org
To: Haorong Lu <ancientmodern4@gmail.com>
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
Subject: Re: [PATCH] riscv: signal: handle syscall restart before get_signal
Date: Mon, 06 Nov 2023 15:00:29 +0000 [thread overview]
Message-ID: <169928282917.16503.10982051973529578442.git-patchwork-notify@kernel.org> (raw)
In-Reply-To: <20230803224458.4156006-1-ancientmodern4@gmail.com>
Hello:
This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:
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
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
prev parent reply other threads:[~2023-11-06 15:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-03 22:44 [PATCH] riscv: signal: handle syscall restart before get_signal Haorong Lu
2023-08-04 1:08 ` Guo Ren
2023-08-04 6:36 ` Haorong Lu
2023-11-06 15:00 ` patchwork-bot+linux-riscv [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=169928282917.16503.10982051973529578442.git-patchwork-notify@kernel.org \
--to=patchwork-bot+linux-riscv@kernel.org \
--cc=abrestic@rivosinc.com \
--cc=ancientmodern4@gmail.com \
--cc=andy.chiu@sifive.com \
--cc=aou@eecs.berkeley.edu \
--cc=conor.dooley@microchip.com \
--cc=greentime.hu@sifive.com \
--cc=guoren@kernel.org \
--cc=heiko@sntech.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mathis.salmen@matsal.de \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=vincent.chen@sifive.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox