Module Name: src
Committed By: bouyer
Date: Wed Aug 22 19:52:40 UTC 2012
Modified Files:
src/sys/arch/amd64/amd64 [netbsd-4-0]: trap.c
Log Message:
Apply patch, requested by spz in ticket #1454:
sys/arch/amd64/amd64/trap.c: patch
Fix potential stack frame corruption
To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.27.14.1 src/sys/arch/amd64/amd64/trap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.27 src/sys/arch/amd64/amd64/trap.c:1.27.14.1
--- src/sys/arch/amd64/amd64/trap.c:1.27 Sun Jul 23 22:06:04 2006
+++ src/sys/arch/amd64/amd64/trap.c Wed Aug 22 19:52:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.27 2006/07/23 22:06:04 ad Exp $ */
+/* $NetBSD: trap.c,v 1.27.14.1 2012/08/22 19:52:40 bouyer Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.27 2006/07/23 22:06:04 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.27.14.1 2012/08/22 19:52:40 bouyer Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -285,7 +285,8 @@ copyfault:
*/
switch (*(u_char *)frame->tf_rip) {
case 0xcf: /* iret */
- vframe = (void *)((u_int64_t)&frame->tf_rsp - 44);
+ vframe = (void *)((u_int64_t)&frame->tf_rsp -
+ offsetof(struct trapframe, tf_rip));
resume = resume_iret;
break;
/*