lkml.org 
[lkml]   [2008]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC v10][PATCH 05/13] Dump memory address space
From
Date
On Fri, 2008-11-28 at 10:53 +0000, Al Viro wrote:
>
> > +static int cr_ctx_checkpoint(struct cr_ctx *ctx, pid_t pid)
> > +{
> > + ctx->root_pid = pid;
> > +
> > + /*
> > + * assume checkpointer is in container's root vfs
> > + * FIXME: this works for now, but will change with real containers
> > + */
> > + ctx->vfsroot = &current->fs->root;
> > + path_get(ctx->vfsroot);
>
> This is going to break as soon as you get another thread doing e.g. chroot(2)
> while you are in there.

Yeah, we do need at least a read_lock(&current->fs->lock) to keep people
from chroot()'ing underneath us.

> And it's a really, _really_ bad idea to take a
> pointer to shared object, increment refcount on the current *contents* of
> said object and assume that dropping refcount on the later contents of the
> same will balance out.

Absolutely. I assume you mean get_fs_struct(current) instead of
path_get().

-- Dave



\
 
 \ /
  Last update: 2008-12-01 19:03    [W:0.118 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site