Bug 57259 - tftp completely broken on non x86 architectures due to bad header file
Summary: tftp completely broken on non x86 architectures due to bad header file
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: tftp
Version: 1.0
Hardware: strongarm
OS: Linux
medium
high
Target Milestone: ---
Assignee: Elliot Lee
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-12-07 23:20 UTC by Ralph Siemsen
Modified: 2007-04-18 16:38 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2001-12-07 23:34:07 UTC
Embargoed:


Attachments (Terms of Use)

Description Ralph Siemsen 2001-12-07 23:20:19 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120

Description of problem:
The 0.17 distribution of TFTP (currently available on RawHide) once again
includes its own copy of the <arpa/tftp.h> header file.  The structures
defined therein are transmitted over ethernet and therefore the compiler
must not add any additional padding to them.  This was reported and fixed
in RedHat 6.2 but the patch seems to have been lost.

Why do you need to supply your own headers anyways?  The system header,
which is part of glibc-devel, has the correct definitions in them. 
Building against that header file results in correct operation of the daemon.

As distributed the tftp service is totally broken on platforms like ARM
where the compiler will insert padding bytes in structures to align things
on 32-bit boundaries by default.

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

How reproducible:
Always

Steps to Reproduce:
1. Build/install tftp-0.17 on ARM platform
2. Start the server via inetd/xinetd
3. Try to retrieve a file (for example)
tftp
> connect localhost
> get /boot/vmlinux


Actual Results:  An error message similar to:
The number varies randomly (its garbage data from uninitialized memory)

TFTP- Error 16283 - GAL operation


Expected Results:  The requested file should have been transferred.

Additional info:

This is easily fixed by removing the arpa/tftp.h header file included with
the package.

If that is not acceptible, then the struct tftphdr needs to be modified to
have __attribute__ ((__packed__)) right before the th_u member, and once
again after the closing brace of the same structure definition.  I can
provide a patch if this is not obvious.

Comment 1 Ralph Siemsen 2001-12-07 23:34:02 UTC
This might well affect current shipping versions of RH (7.x) as well - I haven't
checked.  It was working correctly in tfp-0.15-1.src.rpm, which dates back to
the early RedHat 6.x time if I'm not mistaken.


Comment 2 Elliot Lee 2001-12-18 21:31:33 UTC
I just removed the file...


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