mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-05 21:00:05 +00:00
Update.
* elf/dl-load.c (_dl_map_object_from_fd): Prevent dynamically loading modules with the DF_STATIC_TLS flag set. * elf/dynamic-link.h (elf_get_dynamic_info): Initialize l_flags element. * include/link.h (struct link_map): Add l_flags field. * elf/elf.h (DF_STATIC_TLS): New definition.
This commit is contained in:
parent
472d82fc06
commit
ec70c01155
@ -1,5 +1,12 @@
|
||||
2002-02-05 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* elf/dl-load.c (_dl_map_object_from_fd): Prevent dynamically
|
||||
loading modules with the DF_STATIC_TLS flag set.
|
||||
* elf/dynamic-link.h (elf_get_dynamic_info): Initialize l_flags
|
||||
element.
|
||||
* include/link.h (struct link_map): Add l_flags field.
|
||||
* elf/elf.h (DF_STATIC_TLS): New definition.
|
||||
|
||||
* dlfcn/Makefile: Add rules to build and run bug-dlopen1.
|
||||
* dlfcn/bug-dlopen1.c: New file. By Bruno Haible.
|
||||
|
||||
|
@ -1170,7 +1170,11 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
|
||||
|
||||
/* Make sure we are dlopen()ing an object which has the DF_1_NOOPEN
|
||||
flag set. */
|
||||
if (__builtin_expect (l->l_flags_1 & DF_1_NOOPEN, 0)
|
||||
if ((__builtin_expect (l->l_flags_1 & DF_1_NOOPEN, 0)
|
||||
#ifdef USE_TLS
|
||||
|| __builtin_expect (l->l_flags & DF_STATIC_TLS, 0)
|
||||
#endif
|
||||
)
|
||||
&& (mode & __RTLD_DLOPEN))
|
||||
{
|
||||
/* We are not supposed to load this object. Free all resources. */
|
||||
|
@ -117,12 +117,12 @@ elf_get_dynamic_info (struct link_map *l)
|
||||
/* Flags are used. Translate to the old form where available.
|
||||
Since these l_info entries are only tested for NULL pointers it
|
||||
is ok if they point to the DT_FLAGS entry. */
|
||||
ElfW(Word) flags = info[DT_FLAGS]->d_un.d_val;
|
||||
if (flags & DF_SYMBOLIC)
|
||||
l->l_flags = info[DT_FLAGS]->d_un.d_val;
|
||||
if l->l_(flags & DF_SYMBOLIC)
|
||||
info[DT_SYMBOLIC] = info[DT_FLAGS];
|
||||
if (flags & DF_TEXTREL)
|
||||
if l->l_(flags & DF_TEXTREL)
|
||||
info[DT_TEXTREL] = info[DT_FLAGS];
|
||||
if (flags & DF_BIND_NOW)
|
||||
if (l->l_flags & DF_BIND_NOW)
|
||||
info[DT_BIND_NOW] = info[DT_FLAGS];
|
||||
}
|
||||
#endif
|
||||
|
@ -730,6 +730,7 @@ typedef struct
|
||||
#define DF_SYMBOLIC 0x00000002 /* Symbol resolutions starts here */
|
||||
#define DF_TEXTREL 0x00000004 /* Object contains text relocations */
|
||||
#define DF_BIND_NOW 0x00000008 /* No lazy binding for this object */
|
||||
#define DF_STATIC_TLS 0x00000010 /* Module uses the static TLS model */
|
||||
|
||||
/* State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1
|
||||
entry in the dynamic section. */
|
||||
|
@ -237,6 +237,7 @@ struct link_map
|
||||
/* Various flag words. */
|
||||
ElfW(Word) l_feature_1;
|
||||
ElfW(Word) l_flags_1;
|
||||
ElfW(Word) l_flags;
|
||||
|
||||
/* Temporarily used in `dl_close'. */
|
||||
unsigned int l_idx;
|
||||
|
Loading…
Reference in New Issue
Block a user