[PATCH v2 0/3] getlogin_r NULL pointer dereference on ENOMEM (bug 28940)

Florian Weimer fweimer@redhat.com
Mon Feb 9 09:25:23 GMT 2026


* Florian Weimer:

> I believe this version addresses DJ's review comments.  I added a couple
> more failure checks to nss_database.c.
>
> There were additional test failures stemming from the utmp fallback path
> in the Linux getlogin_r implementation.  I adjusted the conditions under
> which it would be used (in particular, not after getpwuid_r failures),
> which avoids those.  I also added a workaround to the test for the
> long-standing dlopen caching bug in NSS (bug 22041).
>
> The test is now more specific to getlogin_r, so I renamed it.
>
> The initialized field confused me when I worked on the additional
> failures the test uncovered, so I cleaned that up first.
>
> Thanks,
> Florian
>
> Florian Weimer (3):
>   nss: Introduce dedicated struct nss_database_for_fork type
>   Linux: In getlogin_r, use utmp fallback only for specific errors
>   nss: Missing checks in __nss_configure_lookup, __nss_database_get (bug
>     28940)
>
>  nss/Makefile                            |   1 +
>  nss/nss_database.c                      |  21 +-
>  nss/nss_database.h                      |  12 +-
>  nss/tst-nss-malloc-failure-getlogin_r.c | 345 ++++++++++++++++++++++++
>  posix/fork.c                            |   2 +-
>  sysdeps/unix/sysv/linux/getlogin_r.c    |  21 +-
>  6 files changed, 386 insertions(+), 16 deletions(-)
>  create mode 100644 nss/tst-nss-malloc-failure-getlogin_r.c

Ping?  Could I get a review for this?

  <https://inbox.sourceware.org/libc-alpha/cover.1769457628.git.fweimer@redhat.com>

Thanks,
Florian



More information about the Libc-alpha mailing list