Module Name: src
Committed By: jym
Date: Sun Jul 22 19:30:19 UTC 2012
Modified Files:
src/sys/arch/xen/xen: xen_machdep.c
Log Message:
Don't leak stack content when reading the Xen suspend value.
XXX pull-up to -6.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/xen/xen/xen_machdep.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/xen/xen/xen_machdep.c
diff -u src/sys/arch/xen/xen/xen_machdep.c:1.11 src/sys/arch/xen/xen/xen_machdep.c:1.12
--- src/sys/arch/xen/xen/xen_machdep.c:1.11 Sat Jun 30 22:50:37 2012
+++ src/sys/arch/xen/xen/xen_machdep.c Sun Jul 22 19:30:19 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_machdep.c,v 1.11 2012/06/30 22:50:37 jym Exp $ */
+/* $NetBSD: xen_machdep.c,v 1.12 2012/07/22 19:30:19 jym Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -53,7 +53,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xen_machdep.c,v 1.11 2012/06/30 22:50:37 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_machdep.c,v 1.12 2012/07/22 19:30:19 jym Exp $");
#include "opt_xen.h"
@@ -247,7 +247,7 @@ sysctl_xen_suspend_setup(void)
CTL_CREATE, CTL_EOL);
sysctl_createv(NULL, 0, &node, &node,
- CTLFLAG_PERMANENT | CTLFLAG_READWRITE,
+ CTLFLAG_PERMANENT | CTLFLAG_READWRITE | CTLFLAG_IMMEDIATE,
CTLTYPE_INT, "suspend",
SYSCTL_DESCR("Suspend/save current Xen domain"),
sysctl_xen_suspend, 0, NULL, 0,
@@ -257,11 +257,10 @@ sysctl_xen_suspend_setup(void)
static int
sysctl_xen_suspend(SYSCTLFN_ARGS)
{
- int error, t;
+ int error;
struct sysctlnode node;
node = *rnode;
- node.sysctl_data = &t;
error = sysctl_lookup(SYSCTLFN_CALL(&node));
if (error || newp == NULL)