From: Chris Wright Subject: [PATCH] proper bounds check in do_set_gdt entry point Date: Mon, 27 Jun 2005 11:41:57 -0700 Message-ID: <20050627184157.GM9157@shell0.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Unless I missed something, not bounds checking entries in do_set_gdt is a security hole. Signed-off-by: Chris Wright --- 1.184/xen/arch/x86/mm.c 2005-06-23 02:35:56 -07:00 +++ edited/xen/arch/x86/mm.c 2005-06-27 11:37:30 -07:00 @@ -2442,6 +2442,9 @@ long do_set_gdt(unsigned long *frame_lis unsigned long frames[16]; long ret; + if ( entries > FIRST_RESERVED_GDT_ENTRY ) + return -EINVAL; + if ( copy_from_user(frames, frame_list, nr_pages * sizeof(unsigned long)) ) return -EFAULT;