Skip to content

Commit

Permalink
x86: fix initialization of 'l' bit in ldt descriptors
Browse files Browse the repository at this point in the history
Make sure that fill_ldt() initializes the 'l' bit in the descriptor.
It always sets it to 0, ignoring 'lm' in user_desc, preserving original
x86_64 behaviour.

Previously it was leaving 'l' uninitialized.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Glauber de Oliveira Costa <gcosta@redhat.com>
  • Loading branch information
Jeremy Fitzhardinge authored and Ingo Molnar committed Jul 28, 2008
1 parent b56afe1 commit 64f53a0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/asm-x86/desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ static inline void fill_ldt(struct desc_struct *desc,
desc->d = info->seg_32bit;
desc->g = info->limit_in_pages;
desc->base2 = (info->base_addr & 0xff000000) >> 24;
/*
* Don't allow setting of the lm bit. It is useless anyway
* because 64bit system calls require __USER_CS:
*/
desc->l = 0;
}

extern struct desc_ptr idt_descr;
Expand Down

0 comments on commit 64f53a0

Please sign in to comment.