public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nscd/31572] New: getnetgrent_r stores results outside buffer if nscd is running
@ 2024-03-28 19:08 byrnes at deshaw dot com
  2024-03-29  4:24 ` [Bug nscd/31572] " sam at gentoo dot org
  0 siblings, 1 reply; 2+ messages in thread
From: byrnes at deshaw dot com @ 2024-03-28 19:08 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 31572
           Summary: getnetgrent_r stores results outside buffer if nscd is
                    running
           Product: glibc
           Version: 2.39
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: nscd
          Assignee: unassigned at sourceware dot org
          Reporter: byrnes at deshaw dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 15442
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15442&action=edit
repro.c - reproducer for getnetgrent_r nscd bug

If nscd is running, getnetgrent_r stores (user, group, domain) strings outside
of the specified buffer.

This easy to reproduce:

Compile the attached program with gcc -DNETGROUP=\"valid-netgroup-name\" ...

Run on a system with nscd running and configured to enable netgroup caching,
and with glibc configured to use nscd.  Observe the assertion failures because
(user, group, domain) point to locations outside of the buffer.

I think this happens because nscd_getnetgrent doesn't use the buffer at all.

I can reproduce this on all glibc versions that I've tried between 2.28 and
2.38 - I believe it will also reproduce on the latest 2.39.

This is bad because the strings in the buffer are supposed to remain valid even
after other netgroup-related functions are called, but I suspect that's not
really true when the results are elsewhere.

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

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

* [Bug nscd/31572] getnetgrent_r stores results outside buffer if nscd is running
  2024-03-28 19:08 [Bug nscd/31572] New: getnetgrent_r stores results outside buffer if nscd is running byrnes at deshaw dot com
@ 2024-03-29  4:24 ` sam at gentoo dot org
  0 siblings, 0 replies; 2+ messages in thread
From: sam at gentoo dot org @ 2024-03-29  4:24 UTC (permalink / raw)
  To: glibc-bugs

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

Sam James <sam at gentoo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sam at gentoo dot org

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

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

end of thread, other threads:[~2024-03-29  4:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28 19:08 [Bug nscd/31572] New: getnetgrent_r stores results outside buffer if nscd is running byrnes at deshaw dot com
2024-03-29  4:24 ` [Bug nscd/31572] " sam at gentoo dot 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).