about summary refs log tree commit diff
path: root/inet/gethstbynm2.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-11-10 14:40:30 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-03-08 12:51:29 -0300
commitc54d689269c7f10e7f7d28b1cb5b3a6a0dd5a889 (patch)
tree740094e56b211d8e3af5393129431fc05fc7ea7f /inet/gethstbynm2.c
parentedddffc9df5ea5882192bca7ddaad8f6440bcc44 (diff)
downloadglibc-c54d689269c7f10e7f7d28b1cb5b3a6a0dd5a889.tar.gz
glibc-c54d689269c7f10e7f7d28b1cb5b3a6a0dd5a889.tar.xz
glibc-c54d689269c7f10e7f7d28b1cb5b3a6a0dd5a889.zip
inet: Fix getnameinfo (NI_NOFQDN) race condition (BZ#28566)
The 'not_first' is accessed on nrl_domainname() in a non atomically
way, although it is only updated after the lock is taken.

This patch fix the double-checked locking by using acquire-release
atomic operation instead of plain load and by moving the 'not_first'
store only after 'domain' is actually set.

Checked on x86_64-linux-gnu.

Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'inet/gethstbynm2.c')
0 files changed, 0 insertions, 0 deletions