]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Linux: Terminate subprocess on late failure in tst-pidfd (bug 29485)
authorFlorian Weimer <fweimer@redhat.com>
Mon, 15 Aug 2022 14:43:59 +0000 (16:43 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 16 Aug 2022 05:30:25 +0000 (07:30 +0200)
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit f82e05ebb295cadd35f7372f652c72264da810ad)

NEWS
sysdeps/unix/sysv/linux/tst-pidfd.c

diff --git a/NEWS b/NEWS
index 15f3dd2cdb4b8712760510df17231149a21bd3c1..f8fb8db51085376e8c3f9a5fbe37cbfcd1729b05 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ Version 2.36.1
 The following bugs are resolved with this release:
 
   [29446] _dlopen now ignores dl_caller argument in static mode
+  [29485] Linux: Terminate subprocess on late failure in tst-pidfd
 
 \f
 Version 2.36
index 037af22290a76ac6eb75cc87d2aba5d7e214cb38..5711d1c312948ca0f1436bfb08bcc5e40cdcec09 100644 (file)
@@ -147,8 +147,11 @@ do_test (void)
        may be denied if the process doesn't have CAP_SYS_PTRACE or
        if a LSM security_ptrace_access_check denies access.  */
     if (fd == -1 && errno == EPERM)
-      FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
-                       "skipping test");
+      {
+       TEST_COMPARE (pidfd_send_signal (pidfd, SIGKILL, NULL, 0), 0);
+       FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
+                         "skipping test");
+      }
     TEST_VERIFY (fd > 0);
 
     char *path = xasprintf ("/proc/%d/fd/%d", pid, remote_fd);