Bug 9641

Summary: kexec userspace utilities cannot handle a kernel command line longer than 256 chars
Product: Other Reporter: Friedrich Oslage (bluebird)
Component: OtherAssignee: Neil Horman (nhorman)
Status: CLOSED CODE_FIX    
Severity: normal CC: horms, nhorman, protasnb
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.23 Subsystem:
Regression: --- Bisected commit-id:
Attachments: kexec-tools-command_line_size.patch

Description Friedrich Oslage 2007-12-26 16:26:35 UTC
This doesn't affect the kernel but the userspace utilities from http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/

Since 2.6.21 the maximum length of the kernel command line is 2048 for x86 and x86_64 but the kexec-tools still assume it's 256 therefore a command line longer than 256 chars is truncated upon kexec-reboot.

Steps to reproduce:
- Boot kernel with a command line longer than 256 chars
- cat /proc/cmdline | wc -c
- kexec-reboot
- cat /proc/cmdline | wc -c
Comment 1 Friedrich Oslage 2007-12-26 16:27:26 UTC
Created attachment 14194 [details]
kexec-tools-command_line_size.patch

minimalistic patch
Comment 2 Bernhard Walle 2007-12-27 02:03:52 UTC
See my patch http://www.mail-archive.com/fastboot@lists.osdl.org/msg03054.html.

The problem was that reading out the symbol table is not a very clean way to get the command line size of the kernel. I think we should still make sure that new kexec runs with old kernels properly.

However, since the command line size is now in the x86 boot protocol and we must currently use bzImage to load the relocatable kernels anyway, it may be a good start to detect the command line size for bzImage and allow larger values for that.

I can make a patch for this, but in the next year.
Comment 3 Horms 2008-01-10 21:16:59 UTC
Can we move this discussion over to kexec@lists.infradead.org?
Comment 4 Natalie Protasevich 2008-02-04 22:52:48 UTC
Can you please update the bugzilla with the highlights, and the conclusion of the discussion.
Thanks.
Comment 5 Neil Horman 2008-02-05 04:24:03 UTC
http://lists.infradead.org/pipermail/kexec/2008-January/001214.html
You can read the whole thread there
Comment 6 Horms 2008-03-04 17:42:05 UTC
Thanks to Neil Horman the fix for this was included in
kexec-tools-testing v20080227

http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/

For refrence, the relevant commit is 
b5c2ed5e02cfe862eded56be7f6c1106e84e6e6c in the horms/kexec-tools-testing
tree on git.kernel.org.

http://git.kernel.org/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=commit;h=b5c2ed5e02cfe862eded56be7f6c1106e84e6e6c

Neil, I think that we can close this bug now.
Comment 7 Neil Horman 2008-03-05 05:22:12 UTC
Copy that, closing