linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: kirill@shutemov.name (Kirill A. Shutemov)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] ptrace: system call number interpretation during PTRACE_SET_SYSCALL request handling
Date: Fri, 18 Sep 2009 00:12:25 +0300	[thread overview]
Message-ID: <cc557aab0909171412i1399b56s5e55529f46f40318@mail.gmail.com> (raw)
In-Reply-To: <20090917205221.GC12766@n2100.arm.linux.org.uk>

On Thu, Sep 17, 2009 at 11:52 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Thu, Sep 17, 2009 at 11:41:43PM +0300, Kirill A. Shutemov wrote:
>> On Tue, Sep 15, 2009 at 12:37 PM, Kirill A. Shutemov
>> <kirill@shutemov.name> wrote:
>> > On Sun, Jun 1, 2008 at 11:30 AM, Russell King - ARM Linux
>> > <linux@arm.linux.org.uk> wrote:
>> >> On Fri, May 30, 2008 at 09:30:27PM +0300, Volodymyr G. Lukiianyk wrote:
>> >>> I've encountered a problem while running strace on the kernel with
>> >>> CONFIG_AEABI not set. This problem can be worked around in userspace,
>> >>> but it looks like the correct place for a fix is the kernel.
>> >>
>> >> I'm really nervous about this. ?I need to check what my own strace
>> >> patches do - and if they don't suffer from this problem I'd say that
>> >> the bug lies in userspace.
>> >
>> > Any results? Do we need to workaround it in user space or it will be
>> > fixed in kernel?
>>
>> Russell?
>
> I've not really been around much the last three days.
>
> What was the issue again?
>


It's about this patch for strace:

Syscall numbers do not start at 0 for OABI, so need
to mask off the high order bits when changing syscall

Signed-off-by: Steve Bennett <steveb@workware.net.au>

diff --git a/process.c b/process.c
index 23bd413..dd5464f 100644
--- a/process.c
+++ b/process.c
@@ -792,7 +792,7 @@ change_syscall(struct tcb *tcp, int new)
 #  define PTRACE_SET_SYSCALL 23
 # endif

-       if (ptrace (PTRACE_SET_SYSCALL, tcp->pid, 0, new) != 0)
+       if (ptrace (PTRACE_SET_SYSCALL, tcp->pid, 0, new & 0xFFFF) != 0)
               return -1;

       return 0;
--

Should it be applied or kernel will be fixed?

      reply	other threads:[~2009-09-17 21:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <484047C3.4090509@gmail.com>
     [not found] ` <20080601083036.GD5818@flint.arm.linux.org.uk>
2009-09-15  9:37   ` [RFC] ptrace: system call number interpretation during PTRACE_SET_SYSCALL request handling Kirill A. Shutemov
2009-09-17 20:41     ` Kirill A. Shutemov
2009-09-17 20:52       ` Russell King - ARM Linux
2009-09-17 21:12         ` Kirill A. Shutemov [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=cc557aab0909171412i1399b56s5e55529f46f40318@mail.gmail.com \
    --to=kirill@shutemov.name \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).