[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fwd: Re: [XenPPC] [PATCH] Parse Xen command line properly]




--- Begin Message --- A long overdue comment about the size of the buffer buff and the size of the buffer bootargs also 256 bytes in boot_of.c. With the long file name for our nfs roots, combined with long names for our initialization scripts, I have actually gotten over the limit. Naturally this occurred just shortly before an important deadline. My current command line, for linux only, is 208 characters.
Amos Waterland wrote:
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



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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.