x32: decode clone LDT user_desc entries for x86 processes

* mem.c [X32]: Include asm/ldt.h.
[X32] (print_ldt_entry, sys_modify_ldt, sys_set_thread_area,
sys_get_thread_area): Define.
* process.c [X32]: Include asm/ldt.h.
(sys_clone) [X32]: Decode LDT entry if current_personality == 1.
This commit is contained in:
Дмитрий Левин 2014-04-09 12:30:38 +00:00
parent 44655a451e
commit f94e84780e
2 changed files with 8 additions and 8 deletions

8
mem.c
View File

@ -33,12 +33,12 @@
#include "defs.h"
#include <asm/mman.h>
#include <sys/mman.h>
#if defined(I386) || defined(X86_64)
#if defined(I386) || defined(X86_64) || defined(X32)
# include <asm/ldt.h>
# ifdef HAVE_STRUCT_USER_DESC
# define modify_ldt_ldt_s user_desc
# endif
#endif /* I386 || X86_64 */
#endif /* I386 || X86_64 || X32 */
static unsigned long
get_pagesize()
@ -543,7 +543,7 @@ sys_getpagesize(struct tcb *tcp)
}
#endif
#if defined(I386) || defined(X86_64)
#if defined(I386) || defined(X86_64) || defined(X32)
void
print_ldt_entry(struct modify_ldt_ldt_s *ldt_entry)
{
@ -635,7 +635,7 @@ sys_get_thread_area(struct tcb *tcp)
return 0;
}
#endif /* I386 || X86_64 */
#endif /* I386 || X86_64 || X32 */
#if defined(M68K)
int

View File

@ -491,13 +491,13 @@ static const struct xlat clone_flags[] = {
XLAT_END
};
#if defined I386 || defined X86_64
#if defined I386 || defined X86_64 || defined X32
# include <asm/ldt.h>
# ifdef HAVE_STRUCT_USER_DESC
# define modify_ldt_ldt_s user_desc
# endif
extern void print_ldt_entry();
#endif /* I386 || X86_64 */
#endif /* I386 || X86_64 || X32 */
#if defined IA64
# define ARG_FLAGS 0
@ -556,7 +556,7 @@ sys_clone(struct tcb *tcp)
if (flags & CLONE_PARENT_SETTID)
tprintf(", parent_tidptr=%#lx", tcp->u_arg[ARG_PTID]);
if (flags & CLONE_SETTLS) {
#if defined I386 || defined X86_64
#if defined I386 || defined X86_64 || defined X32
# ifndef I386
if (current_personality == 1)
# endif
@ -572,7 +572,7 @@ sys_clone(struct tcb *tcp)
}
}
else
#endif /* I386 || X86_64 */
#endif /* I386 || X86_64 || X32 */
tprintf(", tls=%#lx", tcp->u_arg[ARG_TLS]);
}
if (flags & (CLONE_CHILD_SETTID|CLONE_CHILD_CLEARTID))