Bug 75508

Summary: PXE bootloader truncates kernel parameters
Product: Red Hat Enterprise Linux 2.1 Reporter: Nick Strugnell <nstrug>
Component: pxeAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.1CC: richard.coley
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-15 17:07:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch proposed by richard.coley@csfb.com
none
patch against pxe-0.1-33.src.rpm to fix problem with long cmdline
none
modified pxe.spec file with pxe-1.0-prepare.patch none

Description Nick Strugnell 2002-10-09 10:52:49 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020513

Description of problem:
When doing a PXE install, any kernel parameters that are passed to the
installing client locally (i.e. on the local console, not passed via TFTP or
DHCP) are truncated to the first 28 characters.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.Setup a PXE installation environment
2.Boot a client and hit F8 to bring up the PXE boot menu
3.Select install
4.Press a key to enter kernel parameters
5.Enter a long list of kernel parameters that will be ignored (e.g. -s
a123456789 b123456789 c123456789
6.Let the installation complete
7.After the post-installation reboot, type 'cat /proc/cmdline' to see the kernel
parameters that the kernel was started with
	

Actual Results:  The contents of /proc/cmdline is truncated to the first 28
characters

Expected Results:  The contents of /proc/cmdline should contain up to 255 chars

Additional info:

Possibly found the problem in pxe-linux/nbp.linux/prepare.c

line 18:
typedef struct s_bootsect_table {
        unsigned char reserved1[32];
        unsigned cmdline_magic;
        unsigned cmdline_offset;
        unsigned char reserved2[461];
...

line 214:
        strcpy(bootsect.reserved2, cmdline);    // copy the kernel
                                                // params to bootsect
line 258:
        memset(&((UINT8 *)&bootsect)[0x40], 0, 0x12); // fill bootsect
                                                      // starting at
                                                      // offset 64

Line 258 appears to be the culprit - reserved2 starts at offset 36 and we blank
it from 64 onwards, leaving only the first 28 characters of the kernel parameters.

Comment 1 Nick Strugnell 2002-10-11 12:36:32 UTC
Created attachment 79946 [details]
Patch proposed by richard.coley

Comment 2 Aleksandr Brezhnev 2002-10-12 06:35:41 UTC
Created attachment 80104 [details]
patch against pxe-0.1-33.src.rpm to fix problem with long cmdline

Comment 3 Aleksandr Brezhnev 2002-10-12 06:38:55 UTC
Created attachment 80105 [details]
modified pxe.spec file with pxe-1.0-prepare.patch

Comment 4 Aleksandr Brezhnev 2002-10-16 05:01:55 UTC
The bug is fixed. Please, include patch into errata.

Comment 5 Jim Wright 2002-10-27 11:07:24 UTC
this is a duplicate of 30837