git-eintr
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Sun, 19 Sep 2021 18:46:59 +0000 (19:46 +0100)
committerAurelien Jarno <aurel32@debian.org>
Sun, 19 Sep 2021 18:46:59 +0000 (19:46 +0100)
Committed for glibc 2.34

commit 1ecc5307a84d34c25dc026aec02d9276cd569561
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Mar 22 22:44:36 2021 +0100

    hurd: handle EINTR during critical sections

    During critical sections, signal handling is deferred and thus RPCs return
    EINTR, even if SA_RESTART is set. We thus have to restart the whole critical
    section in that case.

    This also adds HURD_CRITICAL_UNLOCK in the cases where one wants to
    break the section in the middle.

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name git-eintr.diff

29 files changed:
hurd/dtable.c
hurd/geteuids.c
hurd/hurd/signal.h
hurd/hurdexec.c
hurd/hurdfchdir.c
hurd/hurdsock.c
hurd/seteuids.c
sysdeps/mach/hurd/faccessat.c
sysdeps/mach/hurd/fork.c
sysdeps/mach/hurd/getegid.c
sysdeps/mach/hurd/geteuid.c
sysdeps/mach/hurd/getgid.c
sysdeps/mach/hurd/getgroups.c
sysdeps/mach/hurd/getresgid.c
sysdeps/mach/hurd/getresuid.c
sysdeps/mach/hurd/getuid.c
sysdeps/mach/hurd/group_member.c
sysdeps/mach/hurd/setegid.c
sysdeps/mach/hurd/seteuid.c
sysdeps/mach/hurd/setgid.c
sysdeps/mach/hurd/setgroups.c
sysdeps/mach/hurd/setitimer.c
sysdeps/mach/hurd/setregid.c
sysdeps/mach/hurd/setresgid.c
sysdeps/mach/hurd/setresuid.c
sysdeps/mach/hurd/setreuid.c
sysdeps/mach/hurd/setsid.c
sysdeps/mach/hurd/setuid.c
sysdeps/mach/hurd/spawni.c

index 80d02474fa41f1c7687db56b621752ec65e69bef..dc8a96c9dc99b2cbafe1f08493f93804398b2b22 100644 (file)
@@ -189,6 +189,7 @@ ctty_new_pgrp (void)
 {
   int i;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_dtable_lock);
 
@@ -224,8 +225,19 @@ ctty_new_pgrp (void)
            /* This fd has a ctty-special port.  We need a new one, to tell
               the io server of our different process group.  */
            io_t new;
-           if (__term_open_ctty (port, _hurd_pid, _hurd_pgrp, &new))
-             new = MACH_PORT_NULL;
+           error_t err;
+           if ((err = __term_open_ctty (port, _hurd_pid, _hurd_pgrp, &new)))
+             {
+               if (err == EINTR)
+                 {
+                   /* Got a signal while inside an RPC of the critical section,
+                      retry.  */
+                   __mutex_unlock (&_hurd_dtable_lock);
+                   HURD_CRITICAL_UNLOCK;
+                   goto retry;
+                 }
+               new = MACH_PORT_NULL;
+             }
            _hurd_port_set (&d->ctty, new);
          }
 
index 476687b9f049b06922d33ec894c8348b1efb1500..a33f898e230e2f7838f58d329670e3dff913c4b3 100644 (file)
@@ -26,6 +26,7 @@ geteuids (int n, uid_t *uidset)
   int nuids;
   void *crit;
 
+retry:
   crit = _hurd_critical_section_lock ();
   __mutex_lock (&_hurd_id.lock);
 
@@ -33,6 +34,9 @@ geteuids (int n, uid_t *uidset)
     {
       __mutex_unlock (&_hurd_id.lock);
       _hurd_critical_section_unlock (crit);
+      if (err == EINTR)
+       /* Got a signal while inside an RPC of the critical section, retry.  */
+       goto retry;
       return __hurd_fail (err);
     }
 
index 2a0aa20b721b4fd467e30db9b0eb943dd6fdde1b..f365802f7f89b17bed9374b1e56fba5834265e29 100644 (file)
@@ -277,6 +277,10 @@ _hurd_critical_section_unlock (void *our_lock)
   { void *__hurd_critical__ = _hurd_critical_section_lock ()
 #define HURD_CRITICAL_END \
       _hurd_critical_section_unlock (__hurd_critical__); } while (0)
+
+/* This one can be used inside the C scoping level, for early exits.  */
+#define HURD_CRITICAL_UNLOCK \
+      _hurd_critical_section_unlock (__hurd_critical__);
 \f
 /* Initialize the signal code, and start the signal thread.
    Arguments give the "init ints" from exec_startup.  */
index 20665942355bb85954f97266605fe0b31e84abdb..2f96813460840894167b326d46e84cef918837be 100644 (file)
@@ -123,6 +123,7 @@ _hurd_exec_paths (task_t task, file_t file,
 
   ss = _hurd_self_sigstate ();
 
+retry:
   assert (! __spin_lock_locked (&ss->critical_section_lock));
   __spin_lock (&ss->critical_section_lock);
 
@@ -429,6 +430,9 @@ _hurd_exec_paths (task_t task, file_t file,
 
   /* Safe to let signals happen now.  */
   _hurd_critical_section_unlock (ss);
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
  outargs:
   free (args);
index 27cba371236c3db06bd6cfff7d559ee9234e1191..471306d9f1a0e9b56dcd4a31ac887dae5488a60d 100644 (file)
@@ -32,6 +32,7 @@ _hurd_change_directory_port_from_fd (struct hurd_port *portcell, int fd)
   if (!d)
     return __hurd_fail (EBADF);
 
+retry:
   HURD_CRITICAL_BEGIN;
 
   ret = HURD_PORT_USE (&d->port,
@@ -53,6 +54,9 @@ _hurd_change_directory_port_from_fd (struct hurd_port *portcell, int fd)
                       }));
 
   HURD_CRITICAL_END;
+  if (ret == -1 && errno == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   return ret;
 }
index e7222a8b19e9abca3d6814d610141c82cec81206..75d431073d14b319cf4d21b6712459fdc5c4ea6c 100644 (file)
@@ -52,6 +52,7 @@ _hurd_socket_server (int domain, int dead)
       return MACH_PORT_NULL;
     }
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&lock);
 
@@ -101,6 +102,9 @@ _hurd_socket_server (int domain, int dead)
 
   __mutex_unlock (&lock);
   HURD_CRITICAL_END;
+  if (server == MACH_PORT_NULL && errno == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   return server;
 }
index 329a4d034af8a9b51a1b7b1640578a41e8741426..9866d11bfffe4ae59f2460e199684abd20836a06 100644 (file)
@@ -31,6 +31,7 @@ seteuids (int n, const uid_t *uids)
   for (i = 0; i < n; ++i)
     new[i] = uids[i];
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
   err = _hurd_check_ids ();
@@ -47,6 +48,9 @@ seteuids (int n, const uid_t *uids)
     }
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   if (err)
     return __hurd_fail (err);
index 50d592ebb437dec2c84e2b9bd5d29355a51a1fc8..12d7ccd3b2db633ab8ac0acce37e73ac763b9f25 100644 (file)
@@ -127,6 +127,7 @@ __faccessat_common (int fd, const char *file, int type, int at_flags,
 
       rcrdir = rcwdir = MACH_PORT_NULL;
 
+     retry:
       HURD_CRITICAL_BEGIN;
 
       __mutex_lock (&_hurd_id.lock);
@@ -172,6 +173,9 @@ __faccessat_common (int fd, const char *file, int type, int at_flags,
       __mutex_unlock (&_hurd_id.lock);
 
       HURD_CRITICAL_END;
+      if (err == EINTR)
+       /* Got a signal while inside an RPC of the critical section, retry.  */
+       goto retry;
 
       if (rcrdir != MACH_PORT_NULL)
        __mach_port_deallocate (__mach_task_self (), rcrdir);
index 3767fd9a4c4d104a9dfb70e73a4029ccd7e74578..d0c3642f58b8e71dc2bcd61fa5fb86f9f32ed8bb 100644 (file)
@@ -72,6 +72,7 @@ __fork (void)
   RUN_HOOK (_hurd_atfork_prepare_hook, ());
 
   ss = _hurd_self_sigstate ();
+retry:
   __spin_lock (&ss->critical_section_lock);
 
 #undef LOSE
@@ -712,6 +713,9 @@ __fork (void)
   }
 
   _hurd_critical_section_unlock (ss);
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   if (!err)
     {
index 5bb1b24d9f3a336c1f79f7d8737c6d2ebb4accfb..f4187098f62137b4ac065be9e8eecdb4e0a0d86e 100644 (file)
@@ -27,6 +27,7 @@ __getegid (void)
   error_t err;
   gid_t egid;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
 
@@ -49,6 +50,9 @@ __getegid (void)
 
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (egid == -1 && errno == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   return egid;
 }
index a4b2a80389c927e9e68e3284a3b0b056935d120a..146c3bce93336330a418adbf734dd8c943b52598 100644 (file)
@@ -27,6 +27,7 @@ __geteuid (void)
   error_t err;
   uid_t euid;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
 
@@ -49,6 +50,9 @@ __geteuid (void)
 
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (euid == -1 && errno == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   return euid;
 }
index 0723f566418ec26500720cc6b444c4c11cb796b1..4b98e820df039bb8c781a8c14c44f4ee04224c4f 100644 (file)
@@ -27,6 +27,7 @@ __getgid (void)
   error_t err;
   gid_t gid;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
 
@@ -46,6 +47,9 @@ __getgid (void)
 
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (gid == -1 && errno == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   return gid;
 }
index 6d9619298ec38c4d99189273672365780de90262..15fdcf799684114a68ea31d635f14c593fdb59c2 100644 (file)
@@ -31,6 +31,7 @@ __getgroups (int n, gid_t *gidset)
   if (n < 0)
     return __hurd_fail (EINVAL);
 
+retry:
   crit = _hurd_critical_section_lock ();
   __mutex_lock (&_hurd_id.lock);
 
@@ -38,6 +39,9 @@ __getgroups (int n, gid_t *gidset)
     {
       __mutex_unlock (&_hurd_id.lock);
       _hurd_critical_section_unlock (crit);
+      if (err == EINTR)
+       /* Got a signal while inside an RPC of the critical section, retry.  */
+       goto retry;
       return __hurd_fail (err);
     }
 
index 66eac4356f463cd9dc539bdf93ffb0a47938a986..f5148b172d8070345a5e01ac5082bd44757844b3 100644 (file)
@@ -28,6 +28,7 @@ __getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid)
 {
   error_t err;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
 
@@ -49,6 +50,9 @@ __getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid)
 
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   return __hurd_fail (err);
 }
index 1de1c7d5367d78cb280d775abacbf7f2c9b1ae86..60ee3251c0deca7f6edb85a6915c66b6c5ce0b00 100644 (file)
@@ -28,6 +28,7 @@ __getresuid (uid_t *ruid, uid_t *euid, uid_t *suid)
 {
   error_t err;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
 
@@ -49,6 +50,9 @@ __getresuid (uid_t *ruid, uid_t *euid, uid_t *suid)
 
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   return __hurd_fail (err);
 }
index f0e8b984a40f40e7365ab72256498b7fa874f6ee..bddabd11404843d265174a55673d44c267bff4bd 100644 (file)
@@ -27,6 +27,7 @@ __getuid (void)
   error_t err;
   uid_t uid;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
 
@@ -46,6 +47,9 @@ __getuid (void)
 
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (uid == -1 && errno == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   return uid;
 }
index ada38a513e5c41b7d147a3e30ae2453309d205a8..62920752b45d8cedafc1a9369280a17df136f0f6 100644 (file)
@@ -28,6 +28,7 @@ __group_member (gid_t gid)
   error_t err;
   void *crit;
 
+retry:
   crit = _hurd_critical_section_lock ();
   __mutex_lock (&_hurd_id.lock);
 
@@ -45,6 +46,9 @@ __group_member (gid_t gid)
 
   __mutex_unlock (&_hurd_id.lock);
   _hurd_critical_section_unlock (crit);
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   if (err)
     __hurd_fail (err);
index 2318d65c24dbcb09f984ebf3a0b2f9b91a784a10..8bef13434ffb4faa72895b1c3c66099d04680fff 100644 (file)
@@ -29,6 +29,7 @@ setegid (gid_t gid)
   auth_t newauth;
   error_t err;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
   err = _hurd_check_ids ();
@@ -55,6 +56,9 @@ setegid (gid_t gid)
     }
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   if (err)
     return __hurd_fail (err);
index 0ff6e809b9e2e473e158679f0d82b193b93ad1e9..4e47df0f77fc328138c91be7ba052faaf50302f3 100644 (file)
@@ -29,6 +29,7 @@ seteuid (uid_t uid)
   auth_t newauth;
   error_t err;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
   err = _hurd_check_ids ();
@@ -55,6 +56,9 @@ seteuid (uid_t uid)
     }
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   if (err)
     return __hurd_fail (err);
index 68055568c44e210abb0fb7b9d3b58b41941a3c5e..90cc8c972781182a6d3f9ac56a661d4bbf481ca9 100644 (file)
@@ -32,6 +32,7 @@ __setgid (gid_t gid)
   auth_t newauth;
   error_t err;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
   err = _hurd_check_ids ();
@@ -81,6 +82,9 @@ __setgid (gid_t gid)
     }
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   if (err)
     return __hurd_fail (err);
index 7dd1c5507acf387952cdf1b9a4ac710cc4f76ab6..82d8b9a90a6621cf68a766a70272ade968b648fa 100644 (file)
@@ -34,6 +34,7 @@ setgroups (size_t n, const gid_t *groups)
   for (i = 0; i < n; ++i)
     new[i] = groups[i];
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
   err = _hurd_check_ids ();
@@ -50,6 +51,9 @@ setgroups (size_t n, const gid_t *groups)
     }
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   if (err)
     return __hurd_fail (err);
index a2b6c2aa5d0aaad93d7363f84da5ec5e65a3ba9f..e1954d93bdb4a0daca128966daceba6cc002a400 100644 (file)
@@ -339,6 +339,7 @@ __setitimer (enum __itimer_which which, const struct itimerval *new,
             struct itimerval *old)
 {
   void *crit;
+  int ret;
 
   switch (which)
     {
@@ -353,9 +354,15 @@ __setitimer (enum __itimer_which which, const struct itimerval *new,
       break;
     }
 
+retry:
   crit = _hurd_critical_section_lock ();
   __spin_lock (&_hurd_itimer_lock);
-  return setitimer_locked (new, old, crit, 0);
+  ret = setitimer_locked (new, old, crit, 0);
+  if (ret == -1 && errno == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
+
+  return ret;
 }
 \f
 static void
index f79aba585dfcb40f1d3dfaddf938fa68455bcc74..0bbd8c6f89f15f6239641f0669e0c178ea1b2c3b 100644 (file)
@@ -28,6 +28,7 @@ __setregid (gid_t rgid, gid_t egid)
   auth_t newauth;
   error_t err;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
   err = _hurd_check_ids ();
@@ -82,6 +83,9 @@ __setregid (gid_t rgid, gid_t egid)
     }
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   if (err)
     return __hurd_fail (err);
index 7d7c449f0b0fb9bc1cbe2c651ee05edbed67efeb..a67c5159bf47bc6e313f8dfacdbf381c486fb583 100644 (file)
@@ -29,6 +29,7 @@ __setresgid (gid_t rgid, gid_t egid, gid_t sgid)
   auth_t newauth;
   error_t err;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
   err = _hurd_check_ids ();
@@ -110,6 +111,9 @@ __setresgid (gid_t rgid, gid_t egid, gid_t sgid)
     }
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   if (err)
     return __hurd_fail (err);
index dc1c7d9ce7893cb15600732c0feae91e5d34ffe1..70fe9cd0606354224cebd4abdf8da41d45908cbb 100644 (file)
@@ -29,6 +29,7 @@ __setresuid (uid_t ruid, uid_t euid, uid_t suid)
   auth_t newauth;
   error_t err;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
   err = _hurd_check_ids ();
@@ -111,6 +112,9 @@ __setresuid (uid_t ruid, uid_t euid, uid_t suid)
 
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   if (err)
     return __hurd_fail (err);
index 223768365a6a42b88fa3801fe0ddf34209ed0884..f8e906f0c9f2f6cbd402d00d3b121818464ce38d 100644 (file)
@@ -28,6 +28,7 @@ __setreuid (uid_t ruid, uid_t euid)
   auth_t newauth;
   error_t err;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
   err = _hurd_check_ids ();
@@ -82,6 +83,9 @@ __setreuid (uid_t ruid, uid_t euid)
     }
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   if (err)
     return __hurd_fail (err);
index f5c95a334eb88b28c3a76efbe16d43f33681021a..64aac9b6e8ac82feaf2a0c198a7c229e8bd936d4 100644 (file)
@@ -32,6 +32,7 @@ __setsid (void)
   error_t err;
   unsigned int stamp;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_dtable_lock);
 
@@ -60,6 +61,9 @@ __setsid (void)
     }
 
   HURD_CRITICAL_END;
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   return err ? __hurd_fail (err) : _hurd_pgrp;
 }
index 5b0227f69c870dadfb93a3bfebed17a8c7ba41c6..c73126d76eb915c43951ee3222fdd6fc0083d268 100644 (file)
@@ -32,6 +32,7 @@ __setuid (uid_t uid)
   auth_t newauth;
   error_t err;
 
+retry:
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
   err = _hurd_check_ids ();
@@ -86,6 +87,9 @@ __setuid (uid_t uid)
     }
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
+  if (err == EINTR)
+    /* Got a signal while inside an RPC of the critical section, retry.  */
+    goto retry;
 
   if (err)
     return __hurd_fail (err);
index 178b271e4e80c11fc486471c7313ca7e08a7f7da..85533d5e8ed04ce36e04e3b4f23513a8c3e0e8f6 100644 (file)
@@ -333,6 +333,7 @@ __spawni (pid_t *pid, const char *file,
 
   ss = _hurd_self_sigstate ();
 
+retry:
   assert (! __spin_lock_locked (&ss->critical_section_lock));
   __spin_lock (&ss->critical_section_lock);
 
@@ -437,7 +438,20 @@ __spawni (pid_t *pid, const char *file,
                                                 MACH_PORT_RIGHT_SEND, +1));
 
   if (err)
-    goto out;
+    {
+      _hurd_critical_section_unlock (ss);
+
+      if (err == EINTR)
+       {
+         /* Got a signal while inside an RPC of the critical section,
+            retry.  */
+         __mach_port_deallocate (__mach_task_self (), auth);
+         auth = MACH_PORT_NULL;
+         goto retry;
+       }
+
+      goto out;
+    }
 
   /* Pack up the descriptor table to give the new program.
      These descriptors will need to be reauthenticated below