Linux Container Development
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: ctx->pipe_child bug ?
Date: Thu, 20 Jan 2011 23:39:18 -0800	[thread overview]
Message-ID: <20110121073918.GA15385@us.ibm.com> (raw)

Oren,


In usercr commit 0dd3f9dacc0a08f5fb562e385a4e4244f453b41c we have the following
diff:

@@ -1868,10 +1902,16 @@ static int ckpt_fork_feeder(struct ckpt_ctx *ctx)
        close(ctx->pipe_child[0]);
        ctx->pipe_out = ctx->pipe_child[1];

+       ctx->pipe_child[0] = -1;  /* mark unused */
+       ctx->pipe_child[1] = -1;  /* mark unused */

---

ckpt_fork_feeder() creates the ->pipe_child[] pipe and clones the fork_feeder.
ckpt_do_feeder() does the following:


        /* children pipe */
        close(ctx->pipe_child[1]);
        ctx->pipe_in = ctx->pipe_child[0];

        /* feeder pipe */
        close(ctx->pipe_feed[0]);

But if the fork_feeder process runs after the parent marks the fds unused, the
fork feeder would end up with a -1 in ctx->pipe_in right ?

The two threads don't share the fds but they do share the same VM and hence
changes to 'ctx' in one process is visible in the other right ?

Sukadev

             reply	other threads:[~2011-01-21  7:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21  7:39 Sukadev Bhattiprolu [this message]
     [not found] ` <20110121073918.GA15385-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2011-01-22 18:28   ` ctx->pipe_child bug ? Oren Laadan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110121073918.GA15385@us.ibm.com \
    --to=sukadev-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox