When loading dso without PT_GNU_STACK phdr, only call
__pthread_map_stacks_exec() on architectures that allow executable stacks. Reported and tested by: marcel (ia64)
This commit is contained in:
parent
f1410015f0
commit
cb38d4941c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=217851
@ -73,4 +73,7 @@ typedef struct {
|
||||
|
||||
extern void *__tls_get_addr(tls_index *ti);
|
||||
|
||||
#define RTLD_DEFAULT_STACK_PF_EXEC PF_X
|
||||
#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC
|
||||
|
||||
#endif
|
||||
|
@ -69,4 +69,7 @@ void _rtld_bind_start(void);
|
||||
|
||||
extern void *__tls_get_addr(tls_index *ti);
|
||||
|
||||
#define RTLD_DEFAULT_STACK_PF_EXEC PF_X
|
||||
#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC
|
||||
|
||||
#endif
|
||||
|
@ -74,4 +74,7 @@ typedef struct {
|
||||
extern void *___tls_get_addr(tls_index *ti) __attribute__((__regparm__(1)));
|
||||
extern void *__tls_get_addr(tls_index *ti);
|
||||
|
||||
#define RTLD_DEFAULT_STACK_PF_EXEC PF_X
|
||||
#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC
|
||||
|
||||
#endif
|
||||
|
@ -65,4 +65,7 @@ void call_initfini_pointer(const struct Struct_Obj_Entry *, Elf_Addr);
|
||||
|
||||
extern void *__tls_get_addr(unsigned long module, unsigned long offset);
|
||||
|
||||
#define RTLD_DEFAULT_STACK_PF_EXEC 0
|
||||
#define RTLD_DEFAULT_STACK_EXEC 0
|
||||
|
||||
#endif
|
||||
|
@ -101,7 +101,7 @@ map_object(int fd, const char *path, const struct stat *sb)
|
||||
phdyn = phinterp = phtls = NULL;
|
||||
phdr_vaddr = 0;
|
||||
segs = alloca(sizeof(segs[0]) * hdr->e_phnum);
|
||||
stack_flags = PF_X | PF_R | PF_W;
|
||||
stack_flags = RTLD_DEFAULT_STACK_PF_EXEC | PF_R | PF_W;
|
||||
while (phdr < phlimit) {
|
||||
switch (phdr->p_type) {
|
||||
|
||||
|
@ -69,4 +69,7 @@ void _rtld_bind_start(void);
|
||||
|
||||
extern void *__tls_get_addr(tls_index *ti);
|
||||
|
||||
#define RTLD_DEFAULT_STACK_PF_EXEC PF_X
|
||||
#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC
|
||||
|
||||
#endif
|
||||
|
@ -84,4 +84,7 @@ typedef struct {
|
||||
|
||||
extern void *__tls_get_addr(tls_index* ti);
|
||||
|
||||
#define RTLD_DEFAULT_STACK_PF_EXEC PF_X
|
||||
#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC
|
||||
|
||||
#endif
|
||||
|
@ -76,4 +76,7 @@ typedef struct {
|
||||
|
||||
extern void *__tls_get_addr(tls_index* ti);
|
||||
|
||||
#define RTLD_DEFAULT_STACK_PF_EXEC PF_X
|
||||
#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC
|
||||
|
||||
#endif
|
||||
|
@ -191,7 +191,7 @@ extern Elf_Dyn _DYNAMIC;
|
||||
|
||||
int osreldate, pagesize;
|
||||
|
||||
static int stack_prot = PROT_READ | PROT_WRITE | PROT_EXEC;
|
||||
static int stack_prot = PROT_READ | PROT_WRITE | RTLD_DEFAULT_STACK_EXEC;
|
||||
static int max_stack_flags;
|
||||
|
||||
/*
|
||||
|
@ -65,4 +65,7 @@ typedef struct {
|
||||
|
||||
extern void *__tls_get_addr(tls_index *ti);
|
||||
|
||||
#define RTLD_DEFAULT_STACK_PF_EXEC 0
|
||||
#define RTLD_DEFAULT_STACK_EXEC 0
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user