Linux Kernel Silent Patching: VMI write_ldt_entry() privilege escalation

| No Comments | No TrackBacks

Once again, the Linux kernel developers delight us with their always discreet (read: silent, no-advisory, no-warning policy) and wonderful patching practices. Sometime between 2.6.24 and 2.6.25 a patch from a Red Hat developer was committed into the Linux kernel git tree, implementing changes to the VMI interfaces hooking some functions dealing with the GDT and LDT.

diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
index 6ca515d..edfb09f 100644
--- a/arch/x86/kernel/vmi_32.c
+++ b/arch/x86/kernel/vmi_32.c
@@ -235,7 +235,7 @@ static void vmi_write_ldt_entry(struct desc_struct *dt, int entry,
 				const void *desc)
 {
 	u32 *ldt_entry = (u32 *)desc;
-	vmi_ops.write_idt_entry(dt, entry, ldt_entry[0], ldt_entry[1]);
+	vmi_ops.write_ldt_entry(dt, entry, ldt_entry[0], ldt_entry[1]);
 }
 
 static void vmi_load_sp0(struct tss_struct *tss,

It's not truly clear if there's a reliable way to abuse this issue properly (since data passed to sys_modify_ldt goes through several checks and might not trigger the vulnerable code path right away). Although, the original commit mentions that it was discovered when JRE caused failures. In addition, vmi_ops.write_idt_entry might do further validation, thus reducing the issue to a mere denial of service in the worst case. Also, it affects only x86 VMI guests.

No TrackBacks

TrackBack URL: http://www.subreption.com/mt/mt-tb.fcgi/94

Leave a comment

About this Entry

This page contains a single entry by Subreption LLC published on October 28, 2008 2:52 PM.

Custom shellcode and return-to-libc on Mac OS X was the previous entry in this blog.

Apple Mac OS X 10.4 temp_patch_ptrace(): Nonsense in kernel-land is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.