From: Mike Frysinger <vapier@gentoo.org>
To: Helge Deller <deller@gmx.de>
Cc: linux-parisc@vger.kernel.org,
James Bottomley <James.Bottomley@HansenPartnership.com>,
John David Anglin <dave.anglin@bell.net>
Subject: Re: [PATCH] parisc: Fix ptrace: syscall number and return value modification
Date: Tue, 19 Jan 2016 14:47:07 -0500 [thread overview]
Message-ID: <20160119194707.GE14840@vapier.lan> (raw)
In-Reply-To: <20160119150849.GA22546@p100.box>
[-- Attachment #1: Type: text/plain, Size: 1278 bytes --]
On 19 Jan 2016 16:08, Helge Deller wrote:
> Mike Frysinger reported that his ptrace testcase showed strange
> behaviour on parisc: It was not possible to avoid a syscall and the
> return value of a syscall couldn't be changed.
>
> To modify a syscall number, we were missing to save the new syscall
> number to gr20 which is then picked up later in assembly again.
>
> The effect that the return value couldn't be changed is a side-effect of
> another bug in the assembly code. When a process is ptraced, userspace
> expects each syscall to report entrance and exit of a syscall. If a
> syscall number was given which doesn't exist, we jumped to the normal
> syscall exit code instead of informing userspace that the (non-existant)
> syscall exits. This unexpected behaviour confuses userspace and thus the
> bug was misinterpreted as if we can't change the return value.
>
> This patch fixes both problems and was tested on 64bit kernel with
> 32bit userspace.
thanks, i'll give it a spin on my box too
on a related note, can you check if arg reloading works too ?
i.e. i should also be able to mung syscall args on the fly.
e.g. if the tracee does open("/foo", O_RDWR), the tracer should
be able to munge it to do open("/foo", O_RDONLY).
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-01-19 19:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-19 15:08 [PATCH] parisc: Fix ptrace: syscall number and return value modification Helge Deller
2016-01-19 19:47 ` Mike Frysinger [this message]
2016-01-19 20:13 ` Helge Deller
2016-01-20 17:09 ` Mike Frysinger
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=20160119194707.GE14840@vapier.lan \
--to=vapier@gentoo.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=dave.anglin@bell.net \
--cc=deller@gmx.de \
--cc=linux-parisc@vger.kernel.org \
/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