public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
From: fweimer@redhat.com (Florian Weimer)
To: libc-stable@sourceware.org
Subject: [2.24 COMMITTED] fork: Remove bogus parent PID assertions [BZ #21386]
Date: Sun, 01 Jan 2017 00:00:00 -0000	[thread overview]
Message-ID: <20170609111032.DA2B041300BF3@oldenburg.str.redhat.com> (raw)

(cherry picked from commit 1d2bc2eae969543b89850e35e532f3144122d80a)

2017-05-12  Florian Weimer  <fweimer@redhat.com>

	[BZ #21386]
	* sysdeps/nptl/fork.c (__libc_fork): Remove assertions on the
	parent PID.  The assertion in the child is incorrect with PID
	namespaces.

diff --git a/NEWS b/NEWS
index 71b41ea..82a718f 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ Security related changes:
 The following bugs are resolved with this release:
 
   [21289] Fix symbol redirect for fts_set
+  [21386] Assertion in fork for distinct parent PID is incorrect
 \f
 Version 2.24
 
diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c
index 02ff793..a5d1e86 100644
--- a/sysdeps/nptl/fork.c
+++ b/sysdeps/nptl/fork.c
@@ -131,10 +131,6 @@ __libc_fork (void)
       __malloc_fork_lock_parent ();
     }
 
-#ifndef NDEBUG
-  pid_t ppid = THREAD_GETMEM (THREAD_SELF, tid);
-#endif
-
 #ifdef ARCH_FORK
   pid = ARCH_FORK ();
 #else
@@ -147,8 +143,6 @@ __libc_fork (void)
     {
       struct pthread *self = THREAD_SELF;
 
-      assert (THREAD_GETMEM (self, tid) != ppid);
-
       /* See __pthread_once.  */
       if (__fork_generation_pointer != NULL)
 	*__fork_generation_pointer += __PTHREAD_ONCE_FORK_GEN_INCR;
@@ -222,8 +216,6 @@ __libc_fork (void)
     }
   else
     {
-      assert (THREAD_GETMEM (THREAD_SELF, tid) == ppid);
-
       /* Release acquired locks in the multi-threaded case.  */
       if (multiple_threads)
 	{

                 reply	other threads:[~2017-06-09 11:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20170609111032.DA2B041300BF3@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-stable@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).