lkml.org 
[lkml]   [2014]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 0/6] uprobes/x86: fix the reprel jmp/call handling
From
Date
On Sun, 2014-04-06 at 22:15 +0200, Oleg Nesterov wrote:
> On 04/04, Jim Keniston wrote:
> >
> > On Fri, 2014-04-04 at 21:32 +0200, Oleg Nesterov wrote:
> > >
> > > 1. Why insn_get_displacement() doesn't work? See "HELP!!!"
> > > below.
> >
> > insn->moffset1.value seems to be what you want.
>
> Works! Thanks a lot.
>
> Still I can't understand why displacement.nbytes == 0 in this case...
> Nevermind.

Looking at Masami's arch/x86/lib/x86-opcode-map.txt and related code, I
see that the operands to the Jcc and JMP instructions are treated as
immediate values. So insn->immediate.value (which is in the same union
as insn->moffset1.value) is more appropriate, and insn->immediate.nbytes
should get you the correct size. Again, insn_get_length() finishes
parsing the whole instruction as necessary, so insn_get_immediate() gets
called as a side effect.

>
> OK. Please see the RFC changes. Obviously not for inclusion yet. And
> totally untested, except I verified that the test-case from 4/6 works.
>
> Please comment.

I'll look at the new patches today.

>
> Oleg.

Jim



\
 
 \ /
  Last update: 2014-04-07 21:41    [W:0.125 / U:5.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site