From patchwork Sun Jan 7 12:34:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 856543 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-88911-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="mYp85Ex+"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zDyWq1YtZz9sNw for ; Sun, 7 Jan 2018 23:34:14 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=K6heDetbTP55wVvGwn88EJ+yItV2aHRqZZ0lVy2PN+PXErEokEp4d mcBCTPDL/gSFsB/sM+svuZr6to0EQcuiZN6gsHiOpKvpZ8nPc8mjgP5LiMS3hz9/ 2b/cw5BzGGBaY0HoWY6HoIXjWNYZj0/jasVJXxU6lxUmoQh1FhpZ3c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=bPRN1jjrXl8aLETcgYr8/obbHRo=; b=mYp85Ex+TJDp3MRNN3bSxWafPVU1 w4TlHPykBYVmU4mZMFG+FEwoHXn5r92gbcRiVe0tAL4QoamVi9t7AVlgcjwf5kkc ZhSCZZxyQdFA1xLOGyG8/niwW4BcoBNg3D8fbG4yUU0x5FFsIwPLBtYXQNOcRb5r +yuuhekrxe3/S/A= Received: (qmail 83949 invoked by alias); 7 Jan 2018 12:34:09 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 83938 invoked by uid 89); 7 Jan 2018 12:34:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.2 spammy= X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault Subject: [hurd,commited] hurd: Fix pwritev* Date: Sun, 7 Jan 2018 13:34:01 +0100 Message-Id: <20180107123401.32262-1-samuel.thibault@ens-lyon.org> 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 | 1 + sysdeps/posix/pwritev_common.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8ddf37ebb8..f0eb187b38 100644 --- 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 diff --git a/sysdeps/posix/pwritev_common.c b/sysdeps/posix/pwritev_common.c index bd0f5c5257..344ab4d61b 100644 --- a/sysdeps/posix/pwritev_common.c +++ b/sysdeps/posix/pwritev_common.c @@ -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;