Skip to content

Commit

Permalink
User set_thread_area instead of modify_ldt
Browse files Browse the repository at this point in the history
  • Loading branch information
mittorn committed Aug 23, 2018
1 parent 179cc83 commit 15be0a7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions loader/ldt_keeper.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,17 @@ ldt_fs_t* Setup_LDT_Keeper(void)
array.limit_in_pages=0;
#ifdef __linux__
//ret=LDT_Modify(0x1, &array, sizeof(struct modify_ldt_ldt_s));
ret=syscall(SYS_modify_ldt, 0x1, &array, sizeof(struct modify_ldt_ldt_s));
ret = syscall(SYS_set_thread_area, &array);
if(ret<0)
{
perror("install_fs");
printf("Couldn't install fs segment, expect segfault\n");
perror("set_thread_area");
ret = syscall(SYS_modify_ldt, 0x1, &array, sizeof(struct modify_ldt_ldt_s));
if(ret<0)
{
perror("modify_ldt");
printf("Couldn't install fs segment, expect segfault\n");
return NULL;
}
}
#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
{
Expand Down

0 comments on commit 15be0a7

Please sign in to comment.