linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Zero fill the return values of rtas arg buffer
@ 2008-07-30 16:23 Nathan Fontenot
  0 siblings, 0 replies; only message in thread
From: Nathan Fontenot @ 2008-07-30 16:23 UTC (permalink / raw)
  To: linuxppc-dev

The kernel copy of the rtas args struct contains the return
value(s) for the specified rtas call.  These are copied back
to user space with the assumption that every value is properly
updated prior.  This patch zero's out the return value fields
of the rtas args struct before processing the rtas call.

I am seeing an issue in testing partition mobility, where the
return value fields of the rtas args struct contain stale data.
This causes it to appear as thought the rtas call fails, when
it actually succeeds.

Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
---

Index: linux-2.6.git/arch/powerpc/kernel/rtas.c
===================================================================
--- linux-2.6.git.orig/arch/powerpc/kernel/rtas.c	2008-07-22 09:34:03.000000000 -0500
+++ linux-2.6.git/arch/powerpc/kernel/rtas.c	2008-07-28 11:25:18.000000000 -0500
@@ -792,6 +792,9 @@
 	if (args.token == RTAS_UNKNOWN_SERVICE)
 		return -EINVAL;
 
+	args.rets = &args.args[nargs];
+	memset(args.rets, 0, args.nret * sizeof(rtas_arg_t));
+
 	/* Need to handle ibm,suspend_me call specially */
 	if (args.token == ibm_suspend_me_token) {
 		rc = rtas_ibm_suspend_me(&args);
@@ -808,8 +811,6 @@
 	enter_rtas(__pa(&rtas.args));
 	args = rtas.args;
 
-	args.rets = &args.args[nargs];
-
 	/* A -1 return code indicates that the last command couldn't
 	   be completed due to a hardware error. */
 	if (args.rets[0] == -1)
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-30 16:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-30 16:23 [PATCH] Zero fill the return values of rtas arg buffer Nathan Fontenot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).