bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #36755] tftp stall due to endian issue


From: Michael Davidsaver
Subject: [bug #36755] tftp stall due to endian issue
Date: Sat, 30 Jun 2012 14:49:52 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.4) Gecko/20100101 Firefox/10.0.4

URL:
  <http://savannah.gnu.org/bugs/?36755>

                 Summary: tftp stall due to endian issue
                 Project: GNU GRUB
            Submitted by: mdavidsaver
            Submitted on: Sat 30 Jun 2012 02:49:52 PM GMT
                Category: Network
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 
                 Release: other
         Reproducibility: Every Time
         Planned Release: None

    _______________________________________________________

Details:

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





    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sat 30 Jun 2012 02:49:52 PM GMT  Name: grub-2.00-tftp.patch  Size: 615B 
 By: mdavidsaver
convert ack_sent to cpu order
<http://savannah.gnu.org/bugs/download.php?file_id=26126>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?36755>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]