]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: Fix pwritev*
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 7 Jan 2018 12:31:36 +0000 (13:31 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 7 Jan 2018 12:31:36 +0000 (13:31 +0100)
This follows c45d78aac ('posix: Fix generic p{read,write}v buffer allocation
(BZ#22457)'), which made pwritev to use __mmap instead of __posix_memalign,
but didn't pass PROT_READ to it, while the pwrite() call does need to
read the data we have just copied over.

* sysdeps/posix/pwritev_common.c: Add PROT_READ to __mmap prot.

ChangeLog
sysdeps/posix/pwritev_common.c

index 8ddf37ebb88ec08bca913ef7a8c95ed837734084..f0eb187b3841121037f3c17d284e3043b0e08edd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,7 @@
        (__glob64): Define GLIBC_2_27 versioned symbol instead of glob64.
        * sysdeps/gnu/glob-lstat-compat.c: New file.
        * sysdeps/gnu/glob64-lstat-compat.c: New file.
+       * sysdeps/posix/pwritev_common.c: Add PROT_READ to __mmap prot.
 
 2018-01-05  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
 
index bd0f5c52570c1e28d68b4adbd269620d07e93d82..344ab4d61b54522e933fd250f3cd0b32179d95f6 100644 (file)
@@ -55,7 +55,7 @@ PWRITEV (int fd, const struct iovec *vector, int count, OFF_T offset)
      but 1. it is system specific (not meant in generic implementation), and
      2. it would make the implementation more complex, and 3. it will require
      another syscall (fcntl).  */
-  void *buffer = __mmap (NULL, bytes, PROT_WRITE,
+  void *buffer = __mmap (NULL, bytes, PROT_READ | PROT_WRITE,
                         MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
   if (__glibc_unlikely (buffer == MAP_FAILED))
     return -1;