[Bug libc/23579] Errors misreported in preadv2

cvs-commit at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Fri Sep 28 19:20:00 GMT 2018


https://sourceware.org/bugzilla/show_bug.cgi?id=23579

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
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, release/2.26/master has been updated
       via  202d08db40f297e718699f628e3c2111be335c2c (commit)
       via  3022a296bd4106caf3121401d4cd80d32f6c8631 (commit)
      from  c5c90b480e4f21ed1d28e0e6d942b06b8d9e8bd7 (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 -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=202d08db40f297e718699f628e3c2111be335c2c

commit 202d08db40f297e718699f628e3c2111be335c2c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Aug 29 16:36:44 2018 -0300

    Fix misreported errno on preadv2/pwritev2 (BZ#23579)

    The fallback code of Linux wrapper for preadv2/pwritev2 executes
    regardless of the errno code for preadv2, instead of the case where
    the syscall is not supported.

    This fixes it by calling the fallback code iff errno is ENOSYS. The
    patch also adds tests for both invalid file descriptor and invalid
    iov_len and vector count.

    The only discrepancy between preadv2 and fallback code regarding
    error reporting is when an invalid flags are used.  The fallback code
    bails out earlier with ENOTSUP instead of EINVAL/EBADF when the syscall
    is used.

    Checked on x86_64-linux-gnu on a 4.4.0 and 4.15.0 kernel.

        [BZ #23579]
        * misc/tst-preadvwritev2-common.c (do_test_with_invalid_fd): New
        test.
        * misc/tst-preadvwritev2.c, misc/tst-preadvwritev64v2.c (do_test):
        Call do_test_with_invalid_fd.
        * sysdeps/unix/sysv/linux/preadv2.c (preadv2): Use fallback code iff
        errno is ENOSYS.
        * sysdeps/unix/sysv/linux/preadv64v2.c (preadv64v2): Likewise.
        * sysdeps/unix/sysv/linux/pwritev2.c (pwritev2): Likewise.
        * sysdeps/unix/sysv/linux/pwritev64v2.c (pwritev64v2): Likewise.

    (cherry picked from commit 7a16bdbb9ff4122af0a28dc20996c95352011fdd)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3022a296bd4106caf3121401d4cd80d32f6c8631

commit 3022a296bd4106caf3121401d4cd80d32f6c8631
Author: Florian Weimer <fweimer@redhat.com>
Date:   Fri Feb 2 10:46:26 2018 +0100

    preadv2/pwritev2: Handle offset == -1 [BZ #22753]

    Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

    (cherry picked from commit d4b4a00a462348750bb18544eb30853ee6ac5d10)

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

Summary of changes:
 ChangeLog                             |   31 +++++++++++++
 NEWS                                  |    2 +
 manual/llio.texi                      |   21 ++++++---
 misc/tst-preadvwritev-common.c        |   38 ++++++++++++++++
 misc/tst-preadvwritev2-common.c       |   77 ++++++++++++++++++++++++++++++++-
 misc/tst-preadvwritev2.c              |    3 +
 misc/tst-preadvwritev64v2.c           |    3 +
 sysdeps/posix/preadv2.c               |    5 ++-
 sysdeps/posix/preadv64v2.c            |    5 ++-
 sysdeps/posix/pwritev2.c              |    5 ++-
 sysdeps/posix/pwritev64v2.c           |    5 ++-
 sysdeps/unix/sysv/linux/preadv2.c     |    7 ++-
 sysdeps/unix/sysv/linux/preadv64v2.c  |    8 +++-
 sysdeps/unix/sysv/linux/pwritev2.c    |    7 ++-
 sysdeps/unix/sysv/linux/pwritev64v2.c |    7 ++-
 15 files changed, 204 insertions(+), 20 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list