[CRIU] [PATCH] dump: Make sure we're not dumping unsupported task

Cyrill Gorcunov gorcunov at openvz.org
Thu Feb 14 03:17:11 EST 2013


On Thu, Feb 14, 2013 at 12:11:35PM +0400, Cyrill Gorcunov wrote:
> On Thu, Feb 14, 2013 at 12:06:46PM +0400, Pavel Emelyanov wrote:
> > On 02/14/2013 12:39 AM, Cyrill Gorcunov wrote:
> > > On Thu, Feb 14, 2013 at 12:21:34AM +0400, Pavel Emelyanov wrote:
> > >> On 02/13/2013 08:49 PM, Cyrill Gorcunov wrote:
> > >>> Ping?
> > >> Sorry.
> > >>
> > >> Checking for task bitness by its auxv size is ... ugly.
> > > 
> > > The kernel doesn't provide other interface as far as I know
> > > in case of x86-32 task running on x86-64 node (there is a
> > > couple of tricks which could be used to figure that out
> > > but they are ugly). I'll try to talk to a knowing person
> > > about that, will report.
> > 
> > AFAIK we can check for cs/ds values in regsets to distinguish that.
> 
> No, before we can _test_ the segment registers we need to fetch
> them somehow, and when task is in compat mode the ptrace returns
> different registers view (not that we're providing buffer for).
> That said, it's easier to read auxv than mocking with ptrace data.

We could do the following I guess

 - provide space for user_regs_struct (where registers are filled
   with some invalid values such as -1ull)
 - call for ptrace
 - if some space left untouched it means we're in compat mode

sounds reasonable?


More information about the CRIU mailing list