Skip to content
Commit 3721784a authored by Maninder Singh's avatar Maninder Singh Committed by Szabolcs Nagy
Browse files

elf: Fix data race in _dl_name_match_p [BZ #21349]



dlopen updates libname_list by writing to lastp->next, but concurrent
reads in _dl_name_match_p were not synchronized when it was called
without holding GL(dl_load_lock), which can happen during lazy symbol
resolution.

This patch fixes the race between _dl_name_match_p reading lastp->next
and add_name_to_object writing to it. This could cause segfault on
targets with weak memory order when lastp->next->name is read, which
was observed on an arm system. Fixes bug 21349.

(Code is from Maninder Singh, comments and description is from Szabolcs
Nagy.)

Co-authored-by: default avatarSzabolcs Nagy <szabolcs.nagy@arm.com>
parent 90458da8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment