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

 
 

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

bug #36755: tftp stall due to endian issue

Submitted by:  Michael Davidsaver <mdavidsaver>
Submitted on:  Sat 30 Jun 2012 02:49:52 PM UTC  
 
Category: NetworkSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: ClosedRelease: 
Release: otherReproducibility: 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
net_bootp
set net_default_server=10.0.2.2
set root=(pxe)
cat bigfile
EOF

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>

 

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
  • -unavailable- added by phcoder (Updated the item)
  • -unavailable- added by mdavidsaver (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 07 Jul 2012 09:11:20 AM UTCphcoderStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Sun 01 Jul 2012 07:58:55 PM UTCphcoderAttached File-=>Added tftp.diff, #26133
    Sat 30 Jun 2012 02:49:52 PM UTCmdavidsaverAttached File-=>Added grub-2.00-tftp.patch, #26126

    Back to the top


    Powered by Savane 3.1-cleanup