public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/18641] New: pwd.h: add __nonnull markings
@ 2015-07-08  7:16 vapier at gentoo dot org
  2015-07-08  7:22 ` [Bug libc/18641] " cvs-commit at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vapier at gentoo dot org @ 2015-07-08  7:16 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 18641
           Summary: pwd.h: add __nonnull markings
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: vapier at gentoo dot org
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

per the thread:
https://sourceware.org/ml/libc-alpha/2015-05/msg00867.html

when you use many functions in pwd.h with NULL pointers, glibc will crash. 
POSIX doesn't require NULL to be supported, so we want to mark all the funcs as
nonnull instead.  this way user code is compiled with warnings and our API
expectations are documented.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/18641] pwd.h: add __nonnull markings
  2015-07-08  7:16 [Bug libc/18641] New: pwd.h: add __nonnull markings vapier at gentoo dot org
  2015-07-08  7:22 ` [Bug libc/18641] " cvs-commit at gcc dot gnu.org
@ 2015-07-08  7:22 ` vapier at gentoo dot org
  2015-07-24 14:44 ` fweimer at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: vapier at gentoo dot org @ 2015-07-08  7:22 UTC (permalink / raw)
  To: glibc-bugs

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

Mike Frysinger <vapier at gentoo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
           Assignee|unassigned at sourceware dot org   |vapier at gentoo dot org

--- Comment #2 from Mike Frysinger <vapier at gentoo dot org> ---
fixed by aforementioned commit

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/18641] pwd.h: add __nonnull markings
  2015-07-08  7:16 [Bug libc/18641] New: pwd.h: add __nonnull markings vapier at gentoo dot org
@ 2015-07-08  7:22 ` cvs-commit at gcc dot gnu.org
  2015-07-08  7:22 ` vapier at gentoo dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-07-08  7:22 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 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, master has been updated
       via  808696696837b8b8fc858f2e6f8d4e40e26e1308 (commit)
       via  61d95397de01ead73b828c6106a4a832d9681652 (commit)
      from  8b59c73386ddb64331ee03c29925a18dae547733 (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=808696696837b8b8fc858f2e6f8d4e40e26e1308

commit 808696696837b8b8fc858f2e6f8d4e40e26e1308
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sat May 30 14:55:16 2015 -0400

    nscd: drop selinux/flask.h include

    Building nscd w/selinux enabled yields a warning which yields an error:
    In file included from selinux.c:32:0:
    /usr/include/selinux/flask.h:5:2: error:
     #warning "Please remove any #include's of this header in your source
code."

    I've done just that and it builds cleanly with libselinux-2.4.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=61d95397de01ead73b828c6106a4a832d9681652

commit 61d95397de01ead73b828c6106a4a832d9681652
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sat May 30 13:33:22 2015 -0400

    pwd.h: add __nonnull markings [BZ #18641]

    Mark all the functions that don't handle NULL pointers as __nonnull.
    POSIX does not require either behavior, so the prototypes should match
    the reality of the codebase.

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

Summary of changes:
 ChangeLog      |   15 +++++++++++++++
 NEWS           |    2 +-
 nscd/selinux.c |    1 -
 pwd/pwd.h      |   18 +++++++++++-------
 4 files changed, 27 insertions(+), 9 deletions(-)

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/18641] pwd.h: add __nonnull markings
  2015-07-08  7:16 [Bug libc/18641] New: pwd.h: add __nonnull markings vapier at gentoo dot org
  2015-07-08  7:22 ` [Bug libc/18641] " cvs-commit at gcc dot gnu.org
  2015-07-08  7:22 ` vapier at gentoo dot org
@ 2015-07-24 14:44 ` fweimer at redhat dot com
  2015-07-28  3:41 ` vapier at gentoo dot org
  2015-07-28  3:47 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: fweimer at redhat dot com @ 2015-07-24 14:44 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
              Flags|                            |security-

--- Comment #3 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Mike Frysinger from comment #0)
> per the thread:
> https://sourceware.org/ml/libc-alpha/2015-05/msg00867.html
> 
> when you use many functions in pwd.h with NULL pointers, glibc will crash. 
> POSIX doesn't require NULL to be supported, so we want to mark all the funcs
> as nonnull instead.  this way user code is compiled with warnings and our
> API expectations are documented.

I couldn't find this discussed on the mailing list.

putpwent at least is documented as returning EINVAL for NULL arguments in its
manual page:

       EINVAL Invalid (NULL) argument given.

And the code has checks for that.  Future GCC versions may rewrite the NULL
check to an abort because of the nonnull attribute with just -O2 optimization. 
I am not convinced this is what we want.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/18641] pwd.h: add __nonnull markings
  2015-07-08  7:16 [Bug libc/18641] New: pwd.h: add __nonnull markings vapier at gentoo dot org
                   ` (2 preceding siblings ...)
  2015-07-24 14:44 ` fweimer at redhat dot com
@ 2015-07-28  3:41 ` vapier at gentoo dot org
  2015-07-28  3:47 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: vapier at gentoo dot org @ 2015-07-28  3:41 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #4 from Mike Frysinger <vapier at gentoo dot org> ---
(In reply to Florian Weimer from comment #3)

i missed the code doing the checking for this specific func.  i'll revert the
markings for it due to the release being close.  however i'm not sure the NULL
checks are useful at all and it would be better to penalize bad usage here.  do
you have an example of where this functionality is actually useful ?

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libc/18641] pwd.h: add __nonnull markings
  2015-07-08  7:16 [Bug libc/18641] New: pwd.h: add __nonnull markings vapier at gentoo dot org
                   ` (3 preceding siblings ...)
  2015-07-28  3:41 ` vapier at gentoo dot org
@ 2015-07-28  3:47 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-07-28  3:47 UTC (permalink / raw)
  To: glibc-bugs

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

--- 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, master has been updated
       via  1eb8bf804937bea53f5e8cfa2f84d256373cdb64 (commit)
      from  3df5cd98371dd9f10b6853efa4d54d359614007d (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=1eb8bf804937bea53f5e8cfa2f84d256373cdb64

commit 1eb8bf804937bea53f5e8cfa2f84d256373cdb64
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Mon Jul 27 23:43:09 2015 -0400

    pwd.h: revert __nonnull markings on putpwent [BZ #18641]

    This function actually checks for NULL arguments and the API has been
    tenatively documented as using EINVAL in that case.  We can debate
    leaving it this way, but it should be done after the pending release.

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

Summary of changes:
 ChangeLog |    5 +++++
 pwd/pwd.h |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-07-28  3:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-08  7:16 [Bug libc/18641] New: pwd.h: add __nonnull markings vapier at gentoo dot org
2015-07-08  7:22 ` [Bug libc/18641] " cvs-commit at gcc dot gnu.org
2015-07-08  7:22 ` vapier at gentoo dot org
2015-07-24 14:44 ` fweimer at redhat dot com
2015-07-28  3:41 ` vapier at gentoo dot org
2015-07-28  3:47 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).