Bug 9641 - kexec userspace utilities cannot handle a kernel command line longer than 256 chars
Summary: kexec userspace utilities cannot handle a kernel command line longer than 256...
Status: CLOSED CODE_FIX
Alias: None
Product: Other
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Neil Horman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-26 16:26 UTC by Friedrich Oslage
Modified: 2008-03-05 05:22 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.23
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
kexec-tools-command_line_size.patch (337 bytes, patch)
2007-12-26 16:27 UTC, Friedrich Oslage
Details | Diff

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

Note You need to log in before you can comment on or make changes to this bug.