From: Jeremy Fitzhardinge Date: Sun, 27 Jul 2008 15:42:32 +0000 (-0700) Subject: x86: fix initialization of 'l' bit in ldt descriptors X-Git-Tag: v2.6.28-rc1~699^2^2~44 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=64f53a0492b4bc11868307990bb8f7c1e0764f89;p=linux-2.6-omap-h63xx.git x86: fix initialization of 'l' bit in ldt descriptors 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 Cc: Glauber de Oliveira Costa Signed-off-by: Ingo Molnar Cc: Glauber de Oliveira Costa --- diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h index 24a524f5e1a..06f786f4b4f 100644 --- a/include/asm-x86/desc.h +++ b/include/asm-x86/desc.h @@ -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;