Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148471401
D26109.id75959.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D26109.id75959.diff
View Options
Index: lib/libc/gen/dlfcn.c
===================================================================
--- lib/libc/gen/dlfcn.c
+++ lib/libc/gen/dlfcn.c
@@ -42,6 +42,7 @@
#include <pthread.h>
#include "un-namespace.h"
#include "libc_private.h"
+#include "reentrant.h"
static char sorry[] = "Service unavailable";
@@ -164,6 +165,7 @@
#ifndef IN_LIBDL
static pthread_once_t dl_phdr_info_once = PTHREAD_ONCE_INIT;
static struct dl_phdr_info phdr_info;
+static mutex_t dl_phdr_info_lock = MUTEX_INITIALIZER;
static void
dl_init_phdr_info(void)
@@ -204,13 +206,17 @@
dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *) __unused,
void *data __unused)
{
-
#ifndef IN_LIBDL
+ int ret;
+
__init_elf_aux_vector();
if (__elf_aux_vector == NULL)
return (1);
_once(&dl_phdr_info_once, dl_init_phdr_info);
- return (callback(&phdr_info, sizeof(phdr_info), data));
+ mutex_lock(&dl_phdr_info_lock);
+ ret = callback(&phdr_info, sizeof(phdr_info), data);
+ mutex_unlock(&dl_phdr_info_lock);
+ return (ret);
#else
return (0);
#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 19, 3:04 AM (16 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29941125
Default Alt Text
D26109.id75959.diff (1 KB)
Attached To
Mode
D26109: dl_iterate_phdr: provide exclusive locking for callback when statically linked
Attached
Detach File
Event Timeline
Log In to Comment