WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [PATCH] Parse Xen command line properly

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [PATCH] Parse Xen command line properly
From: Amos Waterland <apw@xxxxxxxxxx>
Date: Mon, 2 Oct 2006 00:23:47 -0400
Delivery-date: Sun, 01 Oct 2006 21:24:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
We are improperly feeding the entire boot parameter string to Xen's
generic command line parser.  This can have unexpected results when one
of the dom0 parameters, such as console=X, has meaning to the Xen
parser.  First reported by Maria Butrico.

Signed-off-by: Amos Waterland <apw@xxxxxxxxxx>

---

 setup.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff -r 261c458e46af xen/arch/powerpc/setup.c
--- a/xen/arch/powerpc/setup.c  Fri Sep 29 18:13:27 2006 -0400
+++ b/xen/arch/powerpc/setup.c  Mon Oct 02 00:17:07 2006 -0400
@@ -279,8 +279,20 @@ static void __init __start_xen(multiboot
     ticks_per_usec = timebase_freq / 1000000ULL;
 
     /* Parse the command-line options. */
-    if ((mbi->flags & MBI_CMDLINE) && (mbi->cmdline != 0))
-        cmdline_parse(__va((ulong)mbi->cmdline));
+    if ((mbi->flags & MBI_CMDLINE) && (mbi->cmdline != 0)) {
+        char *end, *src = (char *)(ulong)mbi->cmdline;
+        char buff[256];
+
+        end = strstr(src, "--");
+
+        if (end && (end - src < sizeof(buff))) {
+            strlcpy(buff, src, end - src);
+        } else {
+            strlcpy(buff, src, sizeof(buff));
+        }
+
+        cmdline_parse(buff);
+    }
 
     /* We initialise the serial devices very early so we can get debugging. */
     ns16550.io_base = 0x3f8;

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>