linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Fontenot <nfont@austin.ibm.com>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH] Memset the kernel copy of rtas args before using
Date: Fri, 25 Jul 2008 16:25:47 -0500	[thread overview]
Message-ID: <488A44DB.7090400@austin.ibm.com> (raw)

The kernel copy of the rtas args struct that is read in from
user space is a stack variable.  This structure should be
zero'ed out before we do any reads/writes to/from the user
when handling a rtas call request.  This patch adds a memset
to do this.

I am seeing an issue in testing partition mobility, where the
parts of the rtas args struct that return status top the user
contain stale data.

Signed-off-by: Nathan Fontenot <nfont@ausitn,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-25 16:06:00.000000000 -0500
@@ -775,6 +775,8 @@
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
+	memset(&args, 0, sizeof(args));
+
 	if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0)
 		return -EFAULT;
 

             reply	other threads:[~2008-07-25 21:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-25 21:25 Nathan Fontenot [this message]
2008-07-26  4:17 ` [PATCH] Memset the kernel copy of rtas args before using Milton Miller
2008-07-26 10:52 ` Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=488A44DB.7090400@austin.ibm.com \
    --to=nfont@austin.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).