]> git.ipfire.org Git - thirdparty/glibc.git/commit
nss: Protect against errno changes in function lookup (bug 28953)
authorFlorian Weimer <fweimer@redhat.com>
Fri, 11 Mar 2022 07:23:56 +0000 (08:23 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 11 Mar 2022 10:14:24 +0000 (11:14 +0100)
commit54b12733959238204d7b0e46e69fc7f7d8890b20
tree35edae2c9d4ab15c376ab2a51e256f4bb525dca5
parentb53f0c11de409b04560a70570178d1a9d03d5860
nss: Protect against errno changes in function lookup (bug 28953)

dlopen may clobber errno.  The nss_test_errno module uses an ELF
constructor to achieve that, but there could be internal errors
during dlopen that cause this, too.  Therefore, the NSS framework
has to guard against such errno clobbers.

__nss_module_get_function is currently the only function that calls
__nss_module_load, so it is sufficient to save and restore errno
around this call.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 9bdf92c79d63b42f931101bb6df87129c408b0c4)
NEWS
nss/Makefile
nss/nss_module.c
nss/nss_test_errno.c [new file with mode: 0644]
nss/tst-nss-test_errno.c [new file with mode: 0644]