提交 7f414195 编写于 作者: T Thomas Gleixner

x86/ldt: Make LDT pgtable free conditional

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: NAndy Lutomirski <luto@amacapital.net>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 a62d6985
...@@ -426,7 +426,8 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode) ...@@ -426,7 +426,8 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode)
* already installed then the PTE page is already * already installed then the PTE page is already
* populated. Mop up a half populated page table. * populated. Mop up a half populated page table.
*/ */
free_ldt_pgtables(mm); if (!WARN_ON_ONCE(old_ldt))
free_ldt_pgtables(mm);
free_ldt_struct(new_ldt); free_ldt_struct(new_ldt);
goto out_unlock; goto out_unlock;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册