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

r5854 - in glibc-package/branches/glibc-branch-wheezy/debian: . patches patches/any



Author: aurel32
Date: 2013-12-03 14:04:38 +0000 (Tue, 03 Dec 2013)
New Revision: 5854

Added:
   glibc-package/branches/glibc-branch-wheezy/debian/patches/any/cvs-findlocale-div-by-zero.diff
Modified:
   glibc-package/branches/glibc-branch-wheezy/debian/changelog
   glibc-package/branches/glibc-branch-wheezy/debian/patches/series
Log:
  * patches/any/cvs-findlocale-div-by-zero.diff: patch from upstream to fix
    a SIGFPE when locale-archive has been corrupted to all zeros (Closes:
    #718890, #730336).



Modified: glibc-package/branches/glibc-branch-wheezy/debian/changelog
===================================================================
--- glibc-package/branches/glibc-branch-wheezy/debian/changelog	2013-12-03 13:28:55 UTC (rev 5853)
+++ glibc-package/branches/glibc-branch-wheezy/debian/changelog	2013-12-03 14:04:38 UTC (rev 5854)
@@ -7,6 +7,9 @@
     addressing CVE-2012-4412 and CVE-2012-4424 (Closes: #687530, #689423).
   * patches/any/CVE-2013-0242.diff: Backport buffer overrun in regexp matcher
     addressing CVE-2013-0242 (Closes: #699399).
+  * patches/any/cvs-findlocale-div-by-zero.diff: patch from upstream to fix
+    a SIGFPE when locale-archive has been corrupted to all zeros (Closes:
+    #718890, #730336).
 
   [ Petr Salinger ]
   * patches/kfreebsd/local-initgroups-order.diff: always put supplied extra

Added: glibc-package/branches/glibc-branch-wheezy/debian/patches/any/cvs-findlocale-div-by-zero.diff
===================================================================
--- glibc-package/branches/glibc-branch-wheezy/debian/patches/any/cvs-findlocale-div-by-zero.diff	                        (rev 0)
+++ glibc-package/branches/glibc-branch-wheezy/debian/patches/any/cvs-findlocale-div-by-zero.diff	2013-12-03 14:04:38 UTC (rev 5854)
@@ -0,0 +1,33 @@
+commit 18d1425127e5712dda888bb280d5d1a038a45c7f
+Author: Aurelien Jarno <aurelien@aurel32.net>
+Date:   Tue Dec 3 11:16:16 2013 +0100
+
+    locale: don't crash if locale-archive contains all zeros
+
+    In case of power failure followed by filesystem issues locale-archive
+    can end-up containing all zeros. In that case all calls to setlocale()
+    generate a SIGFPE. This renders a system with a default non-C locale
+    unbootable.
+
+    Avoid this by ignoring the locale instead of generating a SIGFPE.
+
+2013-12-03  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* locale/loadarchive.c (_nl_load_locale_from_archive): Avoid
+	division by 0.
+
+diff --git a/locale/loadarchive.c b/locale/loadarchive.c
+index 70136dc..f723780 100644
+--- a/locale/loadarchive.c
++++ b/locale/loadarchive.c
+@@ -274,6 +274,10 @@ _nl_load_locale_from_archive (int category, const char **namep)
+   namehashtab = (struct namehashent *) ((char *) head
+ 					+ head->namehash_offset);
+ 
++  /* Avoid division by 0 if the file is corrupted.  */
++  if (__glibc_unlikely (head->namehash_size == 0))
++    goto close_and_out;
++
+   idx = hval % head->namehash_size;
+   incr = 1 + hval % (head->namehash_size - 2);
+ 

Modified: glibc-package/branches/glibc-branch-wheezy/debian/patches/series
===================================================================
--- glibc-package/branches/glibc-branch-wheezy/debian/patches/series	2013-12-03 13:28:55 UTC (rev 5853)
+++ glibc-package/branches/glibc-branch-wheezy/debian/patches/series	2013-12-03 14:04:38 UTC (rev 5854)
@@ -376,3 +376,4 @@
 any/local-tst-eintr1-eagain.diff
 any/cvs-CVE-2012-44xx.diff
 any/cvs-CVE-2013-0242.diff
+any/cvs-findlocale-div-by-zero.diff


Reply to: