]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86: fix initialization of 'l' bit in ldt descriptors
authorJeremy Fitzhardinge <jeremy@goop.org>
Sun, 27 Jul 2008 15:42:32 +0000 (08:42 -0700)
committerIngo Molnar <mingo@elte.hu>
Mon, 28 Jul 2008 12:26:26 +0000 (14:26 +0200)
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>
include/asm-x86/desc.h

index 24a524f5e1a279328eb9995429603cc28eebe7b3..06f786f4b4fbdd6f912fafae47c5805045ba313b 100644 (file)
@@ -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;