This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.25-754-g00d7a37


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  00d7a3777369bac3d8d44152dde2bb7381984ef6 (commit)
      from  91ac3a7d8474480685632cd25f844d3154c69fdf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=00d7a3777369bac3d8d44152dde2bb7381984ef6

commit 00d7a3777369bac3d8d44152dde2bb7381984ef6
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Jul 17 09:58:29 2017 +0100

    [AArch64] Fix out of bound array access regression
    
    Partially revert ea01a4da219011f4a4db97eef3c5bfc2f6e8fc6b
    "aarch64: Add hwcap string routines" because _dl_procinfo cannot
    be future proof and avoid oob access in _dl_hwcap_string.

diff --git a/ChangeLog b/ChangeLog
index baf8543..5944df0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-07-18  Szabolcs Nagy  <szabolcs.nagy@arm.com>
+
+	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h (_dl_procinfo): Revert.
+	(_dl_hwcap_string): Check range.
+
 2017-07-17  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
 
 	[BZ #21707]
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
index 04fc6be..44dc296 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
@@ -25,36 +25,7 @@
 #include <sysdep.h>
 
 /* We cannot provide a general printing function.  */
-static inline int
-__attribute__ ((unused))
-_dl_procinfo (unsigned int type, unsigned long int word)
-{
-  /* This table should match the information from arch/arm64/kernel/cpuinfo.c
-     in the kernel sources.  */
-  int i;
-
-  /* Fallback to unknown output mechanism.  */
-  if (type == AT_HWCAP2)
-    return -1;
-
-  _dl_printf ("AT_HWCAP:   ");
-
-  for (i = 0; i < 32; ++i)
-    if ((word >> i) & 1)
-      _dl_printf (" %s", GLRO(dl_aarch64_cap_flags)[i]);
-
-  _dl_printf ("\n");
-
-  return 0;
-}
-
-static inline const char *
-__attribute__ ((unused))
-_dl_hwcap_string (int idx)
-{
-  return GLRO(dl_aarch64_cap_flags)[idx];
-};
-
+#define _dl_procinfo(type, word) -1
 
 /* Number of HWCAP bits set.  */
 #define _DL_HWCAP_COUNT 13
@@ -66,6 +37,13 @@ _dl_hwcap_string (int idx)
    library search.  */
 #define HWCAP_IMPORTANT HWCAP_CPUID
 
+static inline const char *
+__attribute__ ((unused))
+_dl_hwcap_string (int idx)
+{
+  return (unsigned)idx < _DL_HWCAP_COUNT ? GLRO(dl_aarch64_cap_flags)[idx] : "";
+};
+
 static inline int
 __attribute__ ((unused))
 _dl_string_hwcap (const char *str)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                     |    5 +++
 sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h |   38 +++++-------------------
 2 files changed, 13 insertions(+), 30 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]