Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64f53a04 authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge Committed by Ingo Molnar
Browse files

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: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Cc: Glauber de Oliveira Costa <gcosta@redhat.com>
parent b56afe1d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;