Skip to content
Commit e73fd06b authored by Florian Weimer's avatar Florian Weimer
Browse files

string: strerror, strsignal cannot use buffer after dlmopen (bug 32026)



Secondary namespaces have a different malloc.  Allocating the
buffer in one namespace and freeing it another results in
heap corruption.  Fix this by using a static string (potentially
translated) in secondary namespaces.  It would also be possible
to use the malloc from the initial namespace to manage the
buffer, but these functions would still not be safe to use in
auditors etc. because a call to strerror could still free a
buffer while it is used by the application.  Another approach
could use proper initial-exec TLS, duplicated in secondary
namespaces, but that would need a callback interface for freeing
libc resources in namespaces on thread exit, which does not exist
today.

Reviewed-by: default avatarAdhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit 25a5eb40)
parent 37c2aa4e
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