lkml.org 
[lkml]   [2012]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Compat 32-bit syscall entry from 64-bit task!?
On 02/06/2012 12:39 PM, Roland McGrath wrote:
> On Mon, Feb 6, 2012 at 12:30 PM, H. Peter Anvin<hpa@zytor.com> wrote:
>> What is needed to make a regset variable-sized? Just declaring that it
>> may change in size in the future, or does one need a length field at the
>> top (I would personally have expected that both notes and ptrace would
>> have out-of-band methods for getting the size?)
>
> ELF notes do have a size field, so core files are self-explanatory. There
> is no ptrace interface to directly interrogate the regset details (one
> could be added). But the PTRACE_GETREGSET interface is to accept an upper
> bound and yield the actual size filled in (which might be less than the
> regset's size if the user-supplied buffer was smaller). So in practice, a
> caller can just use a buffer that's sure to be large enough, and then look
> at iov_len for the actual size delivered. (And nobody has yet complained
> about this for xstate, though that might just be that nobody is really
> using it.)
>

That should be fine, since you'd just set it to the size of the fields
that you know about, and if there are additional fields that you don't
know about, you logically don't care about them. If you want to dump
the full set of data you'd just read until you get a short read... like
if you were reading a regular file.

-hpa



\
 
 \ /
  Last update: 2012-02-06 21:49    [W:0.467 / U:1.032 seconds]
©2003-2014 Jasper Spaans. Advertise on this site