Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79971
b: refs/heads/master
c: 5af7250
h: refs/heads/master
i:
  79969: 14a772d
  79967: e0ecd66
v: v3
  • Loading branch information
Glauber de Oliveira Costa authored and Ingo Molnar committed Jan 30, 2008
1 parent b08427c commit 23ffb2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 25deca53e9b74a899efd3ae1f4493f4f2ce36846
refs/heads/master: 5af725026fe902bf81f1b90b1b9d9ee4b9e1eb6a
15 changes: 7 additions & 8 deletions trunk/arch/x86/kernel/ldt.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static int read_default_ldt(void __user *ptr, unsigned long bytecount)
static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode)
{
struct mm_struct *mm = current->mm;
__u32 entry_1, entry_2;
struct desc_struct ldt;
int error;
struct user_desc ldt_info;

Expand Down Expand Up @@ -218,21 +218,20 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode)
/* Allow LDTs to be cleared by the user. */
if (ldt_info.base_addr == 0 && ldt_info.limit == 0) {
if (oldmode || LDT_empty(&ldt_info)) {
entry_1 = 0;
entry_2 = 0;
memset(&ldt, 0, sizeof(ldt));
goto install;
}
}

entry_1 = LDT_entry_a(&ldt_info);
entry_2 = LDT_entry_b(&ldt_info);
ldt.a = LDT_entry_a(&ldt_info);
ldt.b = LDT_entry_b(&ldt_info);
if (oldmode)
entry_2 &= ~(1 << 20);
ldt.avl = 0;

/* Install the new entry ... */
install:
write_ldt_entry(mm->context.ldt, ldt_info.entry_number, entry_1,
entry_2);
write_ldt_entry(mm->context.ldt, ldt_info.entry_number,
ldt.a, ldt.b);
error = 0;

out_unlock:
Expand Down

0 comments on commit 23ffb2c

Please sign in to comment.