bugGNU GRUB - Bugs: bug #36755, tftp stall due to endian issue


You are not allowed to post comments on this tracker with your current authentication level.

bug #36755: tftp stall due to endian issue

Submitter:  Michael Davidsaver <mdavidsaver>
Submitted:  Sat 30 Jun 2012 02:49:52 PM UTC
Category:  Network Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Closed Release:  other
Release:  Reproducibility:  Every Time
Planned Release:  None

Tue 03 Jul 2012 10:56:06 PM UTC, comment #2: 

Yes it work.  Thanks!

Michael Davidsaver <mdavidsaver>
Sun 01 Jul 2012 07:58:55 PM UTC, comment #1: 

Does the attached patch work?

(file #26133)

Vladimir Serbinenko <phcoder>
Project Administrator
Sat 30 Jun 2012 02:49:52 PM UTC, original submission:  

With Grub 2.00 I am unable to load via TFTP files bigger than ~32k.  Some investigation shows that the transfer proceeds normally for the first 50 packets, it then triggered a stall condition (tftp.c line 227) so that these packets could be consumed by grub_net_fs_read_real() in net.c

However it never resumes due to an issue with endianness of the values stored in the fields 'block' (native) and 'ack_sent' (big endian) of the tftp_data structure.  This causes the test 'data->ack_sent >= data->block' in tftp_packets_pulled() to always test true.

I think this issue will not effect big endian machines.

See attached patch

To reproduce

cat <<EOF > boot.cfg
set net_default_server=
set root=(pxe)
cat bigfile

dd if=/dev/zero of=bigfile bs=1024 count=40

grub-mkimage --format=i386-pc-pxe --output=grub.pxe --prefix='(pxe)/grub' --config=boot.cfg pxe tftp echo cat

qemu -no-reboot -boot n -net nic,model=e1000 -net user,tftp=$PWD,bootfile=grub.pxe

Michael Davidsaver <mdavidsaver>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #26133:  tftp.diff added by phcoder (680B - text/x-diff)
file #26126:  grub-2.00-tftp.patch added by mdavidsaver (615B - text/x-patch - convert ack_sent to cpu order)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by phcoder (Updated the item)
  • -email is unavailable- added by mdavidsaver (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-07-07 phcoder StatusNone Fixed
        Open/ClosedOpen Closed
    2012-07-01 phcoder Attached File- Added tftp.diff, #26133
    2012-06-30 mdavidsaver Attached File- Added grub-2.00-tftp.patch, #26126

    Back to the top

    Powered by Savane 3.9