x86: fix initialization of 'l' bit in ldt descriptors
PATCH 1/1 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.
---include/asm-x86/desc.h | 5 +++++
1 file changed, 5 insertions(+)
include/asm-x86/desc.h +0 -0
@@ -24,6 +24,9 @@
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 anyways
+ because 64bit system calls require __USER_CS. */
+ desc->l = 0;
}
extern struct desc_ptr idt_descr;
Ingo Molnar
AppliedQuoted 5 lines · Jeremy Fitzhardinge
Make sure that
fill_ldt()initializes the 'l' bit in the descriptor. It always sets it to 0, ignoring 'lm' inuser_desc, preserving originalx86_64behaviour.Previously it was leaving 'l' uninitialized.
applied to tip/x86/xen. (will propagate it to x86/urgent after a bit of testing) Thanks,
Ingo