lkml.org 
[lkml]   [2016]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ptrace vs FSGSBASE
Hi Andy,

let me first say that I never knew how this code (and the hardware)
actually works, I am not sure I even understand what ARCH_SET_.S
exactly does ;)

What is even worse, I do not understand your question. So it is not
that I am trying to help, I am asking you to help me understand the
problem.

On 04/29, Andy Lutomirski wrote:
>
> 1. I read fs_base using ptrace. I think I should get the actual
> fs_base without any nonsense.

Which fs_base? The member of user_regs_struct? But this structure/layout
is just the ABI, so to me it seems correct that getreg() tries to look
at ->fs and/or ->fsindex.

IOW. getreg(fs) should return the same value as prctl(ARCH_GET_FS)
returns if called by the tracee, no?

> 2. I read all the regs (PEEKUSER or whatever) and then write then all
> back verbatim. At the very least, I think that if I do this
> atomically using PTRACE_SETREGSET, the task's state needs to remain
> unchanged.

Agreed... do you mean this doesn't work?

> Since ptrace doesn't seem to have any real concept of
> atomic register state changes right now

Could you spell please?

I can't understand what does "atomically" mean in this context.

Oleg.

\
 
 \ /
  Last update: 2016-05-02 18:01    [W:2.528 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site