Bug 22321 - sysconf(_SC_IOV_MAX) returns -1 on Linux
Summary: sysconf(_SC_IOV_MAX) returns -1 on Linux
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.26
: P2 normal
Target Milestone: 2.27
Assignee: Florian Weimer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-19 15:22 UTC by Florian Weimer
Modified: 2017-10-20 02:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Weimer 2017-10-19 15:22:46 UTC
But the kernel defines

#define UIO_MAXIOV     1024

in include/uapi/linux/uio.h, and uses that definition.

Reported first here: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/KURGEUYR4HLV43WHGZV236SYTJUW7YRU/

Introduced by:

commit 37f802f86400684c8d13403958b2c598721d6360
Author: Zack Weinberg <zackw@panix.com>
Date:   Wed Mar 22 10:55:38 2017 -0400

    Remove __need_IOV_MAX and __need_FOPEN_MAX.

It looks like the fix is to include <sys/uio.h> in sysdeps/posix/sysconf.c; previously UIO_MAXIOV was supplied (indirectly) through <bits/stdio_lim.h>.
Comment 1 Sourceware Commits 2017-10-20 02:20:29 UTC
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, master has been updated
       via  63b4baa44e8d22501c433c4093aa3310f91b6aa2 (commit)
      from  95ccb619f553c130dde7b51098d69132547f8a90 (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=63b4baa44e8d22501c433c4093aa3310f91b6aa2

commit 63b4baa44e8d22501c433c4093aa3310f91b6aa2
Author: Florian Weimer <fweimer@redhat.com>
Date:   Fri Oct 20 04:10:15 2017 +0200

    sysconf: Fix missing definition of UIO_MAXIOV on Linux [BZ #22321]
    
    After commit 37f802f86400684c8d13403958b2c598721d6360 (Remove
    __need_IOV_MAX and __need_FOPEN_MAX), UIO_MAXIOV is no longer supplied
    (indirectly) through <bits/stdio_lim.h>, so sysdeps/posix/sysconf.c no
    longer sees the definition.

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

Summary of changes:
 ChangeLog                                          |   10 +++++++++
 sysdeps/posix/sysconf.c                            |    1 +
 sysdeps/unix/sysv/linux/Makefile                   |    5 +++-
 .../unix/sysv/linux/tst-sysconf-iov_max-uapi.c     |   13 +++++------
 .../unix/sysv/linux/tst-sysconf-iov_max.c          |   21 ++++++++++++-------
 5 files changed, 34 insertions(+), 16 deletions(-)
 copy support/xdup2.c => sysdeps/unix/sysv/linux/tst-sysconf-iov_max-uapi.c (78%)
 copy math/test-finite-macros.c => sysdeps/unix/sysv/linux/tst-sysconf-iov_max.c (60%)
Comment 2 Florian Weimer 2017-10-20 02:32:46 UTC
Fixed in 2.27.  Will backport to 2.26.
Comment 3 Sourceware Commits 2017-10-20 02:33:56 UTC
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  2e78ea7a207e49a47a3448fbbc387d606141ec9d (commit)
      from  05155f0772a4befcc10da16ab64060ae7836ff7c (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=2e78ea7a207e49a47a3448fbbc387d606141ec9d

commit 2e78ea7a207e49a47a3448fbbc387d606141ec9d
Author: Florian Weimer <fweimer@redhat.com>
Date:   Fri Oct 20 04:10:15 2017 +0200

    sysconf: Fix missing definition of UIO_MAXIOV on Linux [BZ #22321]
    
    After commit 37f802f86400684c8d13403958b2c598721d6360 (Remove
    __need_IOV_MAX and __need_FOPEN_MAX), UIO_MAXIOV is no longer supplied
    (indirectly) through <bits/stdio_lim.h>, so sysdeps/posix/sysconf.c no
    longer sees the definition.
    
    (cherry picked from commit 63b4baa44e8d22501c433c4093aa3310f91b6aa2)

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

Summary of changes:
 ChangeLog                                          |   10 ++++++
 NEWS                                               |    1 +
 sysdeps/posix/sysconf.c                            |    1 +
 sysdeps/unix/sysv/linux/Makefile                   |    8 +++-
 .../unix/sysv/linux/tst-sysconf-iov_max-uapi.c     |   13 +++----
 .../unix/sysv/linux/tst-sysconf-iov_max.c          |   33 ++++++++-----------
 6 files changed, 38 insertions(+), 28 deletions(-)
 copy support/xpipe.c => sysdeps/unix/sysv/linux/tst-sysconf-iov_max-uapi.c (78%)
 copy debug/tst-ssp-1.c => sysdeps/unix/sysv/linux/tst-sysconf-iov_max.c (59%)