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

r6468 - in glibc-package/branches/glibc-2.21/debian: . patches patches/hurd-i386



Author: sthibault
Date: 2015-08-09 21:19:46 +0000 (Sun, 09 Aug 2015)
New Revision: 6468

Added:
   glibc-package/branches/glibc-2.21/debian/patches/hurd-i386/tg-mmap32th_bit.diff
Modified:
   glibc-package/branches/glibc-2.21/debian/changelog
   glibc-package/branches/glibc-2.21/debian/patches/series
Log:
patches/hurd-i386/tg-mmap32th_bit.diff: New patch to fix libpciaccess
mapping of BARs above 2GiB. Closes: #793543.


Modified: glibc-package/branches/glibc-2.21/debian/changelog
===================================================================
--- glibc-package/branches/glibc-2.21/debian/changelog	2015-08-09 21:18:28 UTC (rev 6467)
+++ glibc-package/branches/glibc-2.21/debian/changelog	2015-08-09 21:19:46 UTC (rev 6468)
@@ -216,6 +216,13 @@
 
  -- Adam Conrad <adconrad@0c3.net>  Fri, 06 Mar 2015 13:47:43 -0700
 
+glibc (2.19-20~0) UNRELEASED; urgency=medium
+
+  * patches/hurd-i386/tg-mmap32th_bit.diff: New patch to fix libpciaccess
+    mapping of BARs above 2GiB. Closes: #793543.
+
+ -- Samuel Thibault <sthibault@debian.org>  Sun, 09 Aug 2015 20:00:16 +0000
+
 glibc (2.19-19) unstable; urgency=medium
 
   * patches/hurd-i386/cvs-mlock.diff: New patch to permit to use mlock from

Copied: glibc-package/branches/glibc-2.21/debian/patches/hurd-i386/tg-mmap32th_bit.diff (from rev 6467, glibc-package/trunk/debian/patches/hurd-i386/tg-mmap32th_bit.diff)
===================================================================
--- glibc-package/branches/glibc-2.21/debian/patches/hurd-i386/tg-mmap32th_bit.diff	                        (rev 0)
+++ glibc-package/branches/glibc-2.21/debian/patches/hurd-i386/tg-mmap32th_bit.diff	2015-08-09 21:19:46 UTC (rev 6468)
@@ -0,0 +1,67 @@
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Subject: [PATCH] Make mmap64 use vm_offset_t for overflow check
+
+The RPC interface used by mmap uses the unsigned vm_offset_t, not the
+signed off_t, so 32bit bigger than 2GiB values are fine actually.
+
+sysdeps/mach/hurd/mmap64.c: New file.
+
+---
+ sysdeps/mach/hurd/mmap64.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 47 insertions(+)
+
+diff --git a/sysdeps/mach/hurd/mmap64.c b/sysdeps/mach/hurd/mmap64.c
+new file mode 100644
+index 0000000..24e1e3e
+--- /dev/null
++++ b/sysdeps/mach/hurd/mmap64.c
+@@ -0,0 +1,47 @@
++/* Copyright (C) 1997-2015 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 <errno.h>
++#include <sys/mman.h>
++#include <sys/types.h>
++
++/* Map addresses starting near ADDR and extending for LEN bytes.  From
++   OFFSET into the file FD describes according to PROT and FLAGS.  If ADDR
++   is nonzero, it is the desired mapping address.  If the MAP_FIXED bit is
++   set in FLAGS, the mapping will be at ADDR exactly (which must be
++   page-aligned); otherwise the system chooses a convenient nearby address.
++   The return value is the actual mapping address chosen or MAP_FAILED
++   for errors (in which case `errno' is set).  A successful `mmap' call
++   deallocates any previous mapping for the affected region.  */
++
++__ptr_t
++__mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd,
++	  __off64_t offset)
++{
++  vm_offset_t small_offset = (vm_offset_t) offset;
++
++  if (small_offset != offset)
++    {
++      /* We cannot do this since the offset is too large.  */
++      __set_errno (EOVERFLOW);
++      return MAP_FAILED;
++    }
++
++  return __mmap (addr, len, prot, flags, fd, small_offset);
++}
++
++weak_alias (__mmap64, mmap64)
+-- 
+tg: (58695b8..) t/mmap32th_bit (depends on: baseline)

Modified: glibc-package/branches/glibc-2.21/debian/patches/series
===================================================================
--- glibc-package/branches/glibc-2.21/debian/patches/series	2015-08-09 21:18:28 UTC (rev 6467)
+++ glibc-package/branches/glibc-2.21/debian/patches/series	2015-08-09 21:19:46 UTC (rev 6468)
@@ -143,6 +143,7 @@
 hurd-i386/cvs-warnings.diff
 hurd-i386/cvs-check-local-headers.diff
 hurd-i386/cvs-mlock.diff
+hurd-i386/tg-mmap32th_bit.diff
 
 i386/local-biarch.diff
 i386/local-cmov.diff


Reply to: