]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix infinite loop in check_pf (BZ #12926)
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Tue, 14 Oct 2014 15:35:33 +0000 (21:05 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Tue, 14 Oct 2014 15:35:33 +0000 (21:05 +0530)
The recvmsg could return 0 under some conditions and cause the
make_request function to be stuck in an infinite loop.

Thank you Jim King <jim.king@simplivity.com> for posting Paul's patch
on the list.

ChangeLog
NEWS
sysdeps/unix/sysv/linux/check_pf.c

index e40ba1f346c53cc9859585d30708eb586e19ba2d..73db0841e148ab6be82de5f8e468a49d58b402c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-10-14  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+       [BZ #12926]
+       * sysdeps/unix/sysv/linux/check_pf.c (make_request): Avoid
+       infinite loop when __recvmsg returns 0.
+
 2014-10-10  Joseph Myers  <joseph@codesourcery.com>
 
        * CANCEL-FCT-WAIVE: Remove file.
diff --git a/NEWS b/NEWS
index accc1441d6b289fd7f3c88c76a18c0d6a48335eb..987f30665565340aecc25b9cc5ff5b32ae716aba 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ Version 2.21
 
 * The following bugs are resolved with this release:
 
-  6652, 14171, 17266, 17363, 17370, 17371, 17411, 17460.
+  6652, 12926, 14171, 17266, 17363, 17370, 17371, 17411, 17460.
 \f
 Version 2.20
 
index c7fd9b0376a58cf8720d3d7b4f82b46dbe6223da..976f249e209d7f8f9e6eaaf0b5db69409620c809 100644 (file)
@@ -180,7 +180,7 @@ make_request (int fd, pid_t pid)
        };
 
       ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
-      if (read_len < 0)
+      if (read_len <= 0)
        goto out_fail2;
 
       if (msg.msg_flags & MSG_TRUNC)