From: Simon Kagstrom Subject: [PATCH] fix out-of-bounds memory access in linux-xen-low.c (gdbserver) Date: Fri, 12 May 2006 16:37:09 +0200 Message-ID: <87psij48dm.wl%simon.kagstrom@bth.se> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Fri_May_12_16:37:09_2006-1" Return-path: 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 list List-Id: xen-devel@lists.xenproject.org --Multipart_Fri_May_12_16:37:09_2006-1 Content-Type: text/plain; charset=US-ASCII The following patch fixes an out-of-bounds memory access in xc_ptrace.c. Currently, Xen always copies the entire 512 byte extended FPU state (fxsave) even if only the "regular" FPU state was requested. This breaks since the memory buffer allocated in linux-xen-low.c:regsets_fetch_inferior_registers() is only large enough to hold the "plain" FPU registers. Signed-Off-By: Simon Kagstrom --Multipart_Fri_May_12_16:37:09_2006-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="xc_ptrace-fpregs.patch" Content-Transfer-Encoding: quoted-printable diff -r 5df90f95916e tools/libxc/xc_ptrace.c --- a/tools/libxc/xc_ptrace.c Fri May 12 10:36:26 2006 +0200 +++ b/tools/libxc/xc_ptrace.c Fri May 12 16:32:07 2006 +0200 @@ -510,6 +510,11 @@ xc_ptrace( break; =20 case PTRACE_GETFPREGS: + if (!current_isfile && fetch_regs(xc_handle, cpu, NULL))=20 + goto out_error; + memcpy(data, &ctxt[cpu].fpu_ctxt, sizeof (elf_fpregset_t)); + break; + case PTRACE_GETFPXREGS: if (!current_isfile && fetch_regs(xc_handle, cpu, NULL))=20 goto out_error; --Multipart_Fri_May_12_16:37:09_2006-1 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Multipart_Fri_May_12_16:37:09_2006-1--