r6467 - in glibc-package/trunk/debian: . patches patches/hurd-i386
Author: sthibault
Date: 2015-08-09 21:18:28 +0000 (Sun, 09 Aug 2015)
New Revision: 6467
Added:
glibc-package/trunk/debian/patches/hurd-i386/tg-mmap32th_bit.diff
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/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/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2015-08-09 17:54:52 UTC (rev 6466)
+++ glibc-package/trunk/debian/changelog 2015-08-09 21:18:28 UTC (rev 6467)
@@ -1,3 +1,10 @@
+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
Added: glibc-package/trunk/debian/patches/hurd-i386/tg-mmap32th_bit.diff
===================================================================
--- glibc-package/trunk/debian/patches/hurd-i386/tg-mmap32th_bit.diff (rev 0)
+++ glibc-package/trunk/debian/patches/hurd-i386/tg-mmap32th_bit.diff 2015-08-09 21:18:28 UTC (rev 6467)
@@ -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/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series 2015-08-09 17:54:52 UTC (rev 6466)
+++ glibc-package/trunk/debian/patches/series 2015-08-09 21:18:28 UTC (rev 6467)
@@ -159,6 +159,7 @@
hurd-i386/cvs-libpthread-libc-lockP.diff
hurd-i386/cvs-libpthread-libc-lockP2.diff
hurd-i386/cvs-mlock.diff
+hurd-i386/tg-mmap32th_bit.diff
i386/local-biarch.diff
i386/local-cmov.diff
Reply to: