[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r5056 - in glibc-package/trunk/debian: . patches patches/hurd-i386



Author: sthibault
Date: 2011-12-08 00:48:10 +0000 (Thu, 08 Dec 2011)
New Revision: 5056

Added:
   glibc-package/trunk/debian/patches/hurd-i386/submitted-select-inputcheck.diff
Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/hurd-i386/local-select.diff
   glibc-package/trunk/debian/patches/series
Log:
hurd-i386/submitted-select-inputcheck.diff: Add select input check.

Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog	2011-12-07 19:28:17 UTC (rev 5055)
+++ glibc-package/trunk/debian/changelog	2011-12-08 00:48:10 UTC (rev 5056)
@@ -72,6 +72,7 @@
     timeout. Closes: #79358.
   * patches/hurd-i386/tg-struct_stat.diff: Add POSIX 2008 visibility.
   * patches/hurd-i386/submitted-posix2008.diff: Add POSIX 2008 visibility.
+  * patches/hurd-i386/submitted-select-inputcheck.diff: Add select input check.
 
   [ Petr Salinger ]
   * kfreebsd/local-sysdeps.diff: update to revision 3763 (from glibc-bsd).

Modified: glibc-package/trunk/debian/patches/hurd-i386/local-select.diff
===================================================================
--- glibc-package/trunk/debian/patches/hurd-i386/local-select.diff	2011-12-07 19:28:17 UTC (rev 5055)
+++ glibc-package/trunk/debian/patches/hurd-i386/local-select.diff	2011-12-08 00:48:10 UTC (rev 5056)
@@ -3,25 +3,16 @@
 this is not a proper fix, but should unbreak quite a few things.
 
 -- 
- hurdselect.c |    9 +++++++++
- 1 file changed, 9 insertions(+)
-diff --git a/hurd/hurdselect.c b/hurd/hurdselect.c
-index a7228f0..7afe22c 100644
---- a/hurd/hurdselect.c
-+++ b/hurd/hurdselect.c
-@@ -75,6 +75,15 @@ _hurd_select (int nfds,
-   if (sigmask && __sigprocmask (SIG_SETMASK, sigmask, &oset))
-     return -1;
+ hurdselect.c |    2 ++
+ 1 file changed, 2 insertions(+)
+--- a/hurd/hurdselect.c.orig	2011-12-08 01:45:07.802727557 +0100
++++ b/hurd/hurdselect.c	2011-12-08 01:45:16.230596929 +0100
+@@ -85,6 +85,8 @@
  
-+  if (timeout == NULL)
-+    to = 0;
-+  else
-+    {
-+      to = timeout->tv_sec * 1000 + (timeout->tv_nsec + 999999) / 1000000;
+       to = timeout->tv_sec * 1000 +
+ 	   (timeout->tv_nsec + 999999) / 1000000;
 +      if (!to)
 +	to = 1;
-+    }
-+
-   if (pollfds)
-     {
-       /* Collect interesting descriptors from the user's `pollfd' array.
+     }
+ 
+   if (sigmask && __sigprocmask (SIG_SETMASK, sigmask, &oset))

Added: glibc-package/trunk/debian/patches/hurd-i386/submitted-select-inputcheck.diff
===================================================================
--- glibc-package/trunk/debian/patches/hurd-i386/submitted-select-inputcheck.diff	                        (rev 0)
+++ glibc-package/trunk/debian/patches/hurd-i386/submitted-select-inputcheck.diff	2011-12-08 00:48:10 UTC (rev 5056)
@@ -0,0 +1,50 @@
+_hurd_select: check for invalid parameter values
+
+Check for invalid values of the `timeout' and `nfds' parameters; move the
+calculation of `to' right after the validation of `timeout'.
+
+2011-11-26  Pino Toscano  <toscano.pino@tiscali.it>
+
+	* hurd/hurdselect.c (_hurd_select): Return EINVAL for negative
+	`timeout' values.
+	Return EINVAL for `nfds' values either negative or greater than
+	FD_SETSIZE.
+--- a/hurd/hurdselect.c
++++ b/hurd/hurdselect.c
+@@ -50,10 +50,7 @@ _hurd_select (int nfds,
+   error_t err;
+   fd_set rfds, wfds, xfds;
+   int firstfd, lastfd;
+-  mach_msg_timeout_t to = (timeout != NULL ?
+-			   (timeout->tv_sec * 1000 +
+-			    (timeout->tv_nsec + 999999) / 1000000) :
+-			   0);
++  mach_msg_timeout_t to = 0;
+   struct
+     {
+       struct hurd_userlink ulink;
+@@ -72,6 +69,24 @@ _hurd_select (int nfds,
+   assert (sizeof (union typeword) == sizeof (mach_msg_type_t));
+   assert (sizeof (uint32_t) == sizeof (mach_msg_type_t));
+ 
++  if (nfds < 0 || nfds > FD_SETSIZE)
++    {
++      errno = EINVAL;
++      return -1;
++    }
++
++  if (timeout != NULL)
++    {
++      if (timeout->tv_sec < 0 || timeout->tv_nsec < 0)
++	{
++	  errno = EINVAL;
++	  return -1;
++	}
++
++      to = timeout->tv_sec * 1000 +
++	   (timeout->tv_nsec + 999999) / 1000000;
++    }
++
+   if (sigmask && __sigprocmask (SIG_SETMASK, sigmask, &oset))
+     return -1;
+ 

Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series	2011-12-07 19:28:17 UTC (rev 5055)
+++ glibc-package/trunk/debian/patches/series	2011-12-08 00:48:10 UTC (rev 5056)
@@ -166,6 +166,7 @@
 hurd-i386/cvs-sgttyb.diff
 hurd-i386/submitted-_hurd_socket_server-indexcheck.diff
 hurd-i386/submitted-hurd-recvfrom.diff
+hurd-i386/submitted-select-inputcheck.diff
 hurd-i386/local-select.diff
 hurd-i386/submitted-posix2008.diff
 


Reply to: