public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nss/25976] New: internal_end*ent in nss_compat may clobber errno, hiding ERANGE
@ 2020-05-12 11:48 fweimer at redhat dot com
  2020-05-12 11:48 ` [Bug nss/25976] " fweimer at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2020-05-12 11:48 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 25976
           Summary: internal_end*ent in nss_compat may clobber errno,
                    hiding ERANGE
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nss
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---

The end*ent functions such as internal_endpwent call into the rest of glibc and
other NSS modules, without saving errno around those calls. Since successful
function calls can clobber errno, a critical ERANGE error can be masked, and
the caller will not retry with a larger buffer, reporting a different error
instead.

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

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

* [Bug nss/25976] internal_end*ent in nss_compat may clobber errno, hiding ERANGE
  2020-05-12 11:48 [Bug nss/25976] New: internal_end*ent in nss_compat may clobber errno, hiding ERANGE fweimer at redhat dot com
@ 2020-05-12 11:48 ` fweimer at redhat dot com
  2020-05-12 12:53 ` fweimer at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2020-05-12 11:48 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

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

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

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

* [Bug nss/25976] internal_end*ent in nss_compat may clobber errno, hiding ERANGE
  2020-05-12 11:48 [Bug nss/25976] New: internal_end*ent in nss_compat may clobber errno, hiding ERANGE fweimer at redhat dot com
  2020-05-12 11:48 ` [Bug nss/25976] " fweimer at redhat dot com
@ 2020-05-12 12:53 ` fweimer at redhat dot com
  2020-05-12 13:02 ` fweimer at redhat dot com
  2020-05-19 12:20 ` fweimer at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2020-05-12 12:53 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at sourceware dot org   |fweimer at redhat dot com

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
Patch posted: https://sourceware.org/pipermail/libc-alpha/2020-May/113864.html

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

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

* [Bug nss/25976] internal_end*ent in nss_compat may clobber errno, hiding ERANGE
  2020-05-12 11:48 [Bug nss/25976] New: internal_end*ent in nss_compat may clobber errno, hiding ERANGE fweimer at redhat dot com
  2020-05-12 11:48 ` [Bug nss/25976] " fweimer at redhat dot com
  2020-05-12 12:53 ` fweimer at redhat dot com
@ 2020-05-12 13:02 ` fweimer at redhat dot com
  2020-05-19 12:20 ` fweimer at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2020-05-12 13:02 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugzilla.redhat.com
                   |                            |/show_bug.cgi?id=1402403

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

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

* [Bug nss/25976] internal_end*ent in nss_compat may clobber errno, hiding ERANGE
  2020-05-12 11:48 [Bug nss/25976] New: internal_end*ent in nss_compat may clobber errno, hiding ERANGE fweimer at redhat dot com
                   ` (2 preceding siblings ...)
  2020-05-12 13:02 ` fweimer at redhat dot com
@ 2020-05-19 12:20 ` fweimer at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2020-05-19 12:20 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |2.32

--- Comment #2 from Florian Weimer <fweimer at redhat dot com> ---
Fixed for glibc 2.32 with:

commit 790b8dda4455865cb8c3a47801f4304c1a43baf6
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue May 19 14:09:38 2020 +0200

    nss_compat: internal_end*ent may clobber errno, hiding ERANGE [BZ #25976]

    During cleanup, before returning from get*_r functions, the end*ent
    calls must not change errno.  Otherwise, an ERANGE error from the
    underlying implementation can be hidden, causing unexpected lookup
    failures.  This commit introduces an internal_end*ent_noerror
    function which saves and restore errno, and marks the original
    internal_end*ent function as warn_unused_result, so that it is used
    only in contexts were errors from it can be handled explicitly.

    Reviewed-by: DJ Delorie <dj@redhat.com>

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

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

end of thread, other threads:[~2020-05-19 12:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 11:48 [Bug nss/25976] New: internal_end*ent in nss_compat may clobber errno, hiding ERANGE fweimer at redhat dot com
2020-05-12 11:48 ` [Bug nss/25976] " fweimer at redhat dot com
2020-05-12 12:53 ` fweimer at redhat dot com
2020-05-12 13:02 ` fweimer at redhat dot com
2020-05-19 12:20 ` fweimer at redhat dot com

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).