From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Parisc List <linux-parisc@vger.kernel.org>
Subject: Re: [parisc] ptrace breakage
Date: Sun, 09 Dec 2012 10:19:51 +0000 [thread overview]
Message-ID: <1355048391.10297.3.camel@dabdike> (raw)
In-Reply-To: <20121209061614.GE4939@ZenIV.linux.org.uk>
On Sun, 2012-12-09 at 06:16 +0000, Al Viro wrote:
> 1) PTRACE_SYSCALL doesn't work for 64bit process on parisc64.
> Compat syscall table is used instead of 64bit one. IMO we should either
> refuse to allow PTRACE_SYSCALL for 64bit processes or duplicate the
> logics choosing the right syscall table into .Ltracesys.
We don't have a 64 bit userspace (except for a toy one I created to test
out a few thing), so I'd be happy returning -ENOSYS.
> 2) if you have let the tracee run with PTRACE_SYSCALL and
> it had stopped, you can use PTRACE_POKEUSR to modify syscall number
> (r20) and arguments 1--4 (r26--r23). Modifications will have effect.
> However, modifying arguments 5 and 6 (r22 and r21 resp.) works only
> when process (32bit one) runs on 64bit host - on 32bit one it has no
> effect. AFAICS, the diff below should fix that one.
>
> Comments?
>
> diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
> index 86742df..5e05524 100644
> --- a/arch/parisc/kernel/syscall.S
> +++ b/arch/parisc/kernel/syscall.S
> @@ -309,10 +309,13 @@ tracesys_next:
> LDREG TASK_PT_GR25(%r1), %r25
> LDREG TASK_PT_GR24(%r1), %r24
> LDREG TASK_PT_GR23(%r1), %r23
> -#ifdef CONFIG_64BIT
> LDREG TASK_PT_GR22(%r1), %r22
> LDREG TASK_PT_GR21(%r1), %r21
> +#ifdef CONFIG_64BIT
> ldo -16(%r30),%r29 /* Reference param save area */
> +#else
> + stw %r22, -52(%r30) /* 5th argument */
> + stw %r21, -56(%r30) /* 6th argument */
> #endif
I'll defer to the glibc guys on this. The code before you modified it
is correct according to the ABI, but it does look like gate calls are
done with 8 args in registers on 32 bit in which case the above would be
correct.
James
next prev parent reply other threads:[~2012-12-09 10:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-09 6:16 [parisc] ptrace breakage Al Viro
2012-12-09 10:19 ` James Bottomley [this message]
2012-12-09 16:44 ` Al Viro
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=1355048391.10297.3.camel@dabdike \
--to=james.bottomley@hansenpartnership.com \
--cc=linux-parisc@vger.kernel.org \
--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 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.