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.24-642-g5026977


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  502697713f4f129b602d7213253a9982ee1989f1 (commit)
       via  4cb89c158124c27006903f10e309b09d5311053a (commit)
      from  099191b1f5748e761f92c2b13aacde8a5a6dad74 (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=502697713f4f129b602d7213253a9982ee1989f1

commit 502697713f4f129b602d7213253a9982ee1989f1
Author: Chris Metcalf <cmetcalf@mellanox.com>
Date:   Mon Jan 16 15:38:25 2017 -0500

    tile: Check for pointer add overflow in memchr
    
    As was done in b224637928e9, check for large size causing an overflow
    in the loop that walks over the array.
    
    Branching out of line here is the fastest approach for handling this
    problem, since tile can bundle the instructions to compute the branch
    test in parallel with doing the required memchr loop setup computation.
    
    Unfortunately, the existing saturated ops (e.g. tilegx addxsc) are
    all signed saturing ops, so don't help with unsigned saturation.

diff --git a/ChangeLog b/ChangeLog
index 5388306..9498803 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2017-01-16  Chris Metcalf  <cmetcalf@mellanox.com>
 
+	* sysdeps/tile/tilegx/memchr.c (__memchr): Handle pointer
+	wrap-around.
+	* sysdeps/tile/tilepro/memchr.c (__memchr): Likewise.
+
 	* sysdeps/unix/sysv/linux/tile/ipc_priv.h: New file.
 
 2016-01-14  Siddhesh Poyarekar  <siddhesh@sourceware.org>
diff --git a/sysdeps/tile/tilegx/memchr.c b/sysdeps/tile/tilegx/memchr.c
index 34df19d..7da0f79 100644
--- a/sysdeps/tile/tilegx/memchr.c
+++ b/sysdeps/tile/tilegx/memchr.c
@@ -51,6 +51,10 @@ __memchr (const void *s, int c, size_t n)
   /* Compute the address of the last byte. */
   last_byte_ptr = (const char *) s + n - 1;
 
+  /* Handle possible addition overflow.  */
+  if (__glibc_unlikely ((uintptr_t) last_byte_ptr < (uintptr_t) s))
+    last_byte_ptr = (const char *) UINTPTR_MAX;
+
   /* Compute the address of the word containing the last byte. */
   last_word_ptr = (const uint64_t *) ((uintptr_t) last_byte_ptr & -8);
 
diff --git a/sysdeps/tile/tilepro/memchr.c b/sysdeps/tile/tilepro/memchr.c
index 1848a9c..fba1f70 100644
--- a/sysdeps/tile/tilepro/memchr.c
+++ b/sysdeps/tile/tilepro/memchr.c
@@ -51,6 +51,10 @@ __memchr (const void *s, int c, size_t n)
   /* Compute the address of the last byte. */
   last_byte_ptr = (const char *) s + n - 1;
 
+  /* Handle possible addition overflow.  */
+  if (__glibc_unlikely ((uintptr_t) last_byte_ptr < (uintptr_t) s))
+    last_byte_ptr = (const char *) UINTPTR_MAX;
+
   /* Compute the address of the word containing the last byte. */
   last_word_ptr = (const uint32_t *) ((uintptr_t) last_byte_ptr & -4);
 

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4cb89c158124c27006903f10e309b09d5311053a

commit 4cb89c158124c27006903f10e309b09d5311053a
Author: Chris Metcalf <cmetcalf@mellanox.com>
Date:   Thu Jan 12 10:19:43 2017 -0500

    tile: pass __IPC_64 as zero for SysV IPC calls
    
    In 1e5834c38a22 ("Refactor Linux ipc_priv header") a different
    approach to passing __IPC_64 as zero was created.  The tile
    architecture also needs to pass __IPC_64 as zero since it does
    not set CONFIG_ARCH_WANT_IPC_PARSE_VERSION in the kernel.
    So create a minimal ipc_priv.h that specifies __IPC_64 as zero.

diff --git a/ChangeLog b/ChangeLog
index d1b04bb..5388306 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-01-16  Chris Metcalf  <cmetcalf@mellanox.com>
+
+	* sysdeps/unix/sysv/linux/tile/ipc_priv.h: New file.
+
 2016-01-14  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
 	* NEWS: Fix typo.
diff --git a/sysdeps/unix/sysv/linux/tile/ipc_priv.h b/sysdeps/unix/sysv/linux/tile/ipc_priv.h
new file mode 100644
index 0000000..476dc18
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tile/ipc_priv.h
@@ -0,0 +1,21 @@
+/* Old SysV permission definition for Linux.  Tile version.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sys/ipc.h>  /* For __key_t  */
+
+#define __IPC_64	0x0

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

Summary of changes:
 ChangeLog                                          |    8 ++++++++
 sysdeps/tile/tilegx/memchr.c                       |    4 ++++
 sysdeps/tile/tilepro/memchr.c                      |    4 ++++
 .../unix/sysv/linux/{aarch64 => tile}/ipc_priv.h   |    4 ++--
 4 files changed, 18 insertions(+), 2 deletions(-)
 copy sysdeps/unix/sysv/linux/{aarch64 => tile}/ipc_priv.h (86%)


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]