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

Commit 57849de1 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Greg Kroah-Hartman
Browse files

x86/ldt: Make LDT pgtable free conditional



commit 7f414195b0c3612acd12b4611a5fe75995cf10c7 upstream.

Andy prefers to be paranoid about the pagetable free in the error path of
write_ldt(). Make it conditional and warn whenever the installment of a
secondary LDT fails.

Requested-by: default avatarAndy Lutomirski <luto@amacapital.net>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3e133155
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -426,6 +426,7 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode)
		 * already installed then the PTE page is already
		 * populated. Mop up a half populated page table.
		 */
		if (!WARN_ON_ONCE(old_ldt))
			free_ldt_pgtables(mm);
		free_ldt_struct(new_ldt);
		goto out_unlock;