All of lore.kernel.org
 help / color / mirror / Atom feed
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: Wed, 20 Jan 2016 12:09:59 -0500	[thread overview]
Message-ID: <20160120170959.GS14840@vapier.lan> (raw)
In-Reply-To: <20160119150849.GA22546@p100.box>

[-- Attachment #1: Type: text/plain, Size: 1208 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.

i've checked that i can reset the syscall # fine and mung the return
value.  i haven't checked arg replacement although i don't need that
myself (yet?).  thanks !

Tested-by: Mike Frysinger <vapier@gentoo.org>
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      parent reply	other threads:[~2016-01-20 17:09 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
2016-01-19 20:13   ` Helge Deller
2016-01-20 17:09 ` Mike Frysinger [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=20160120170959.GS14840@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.