Bug 57259 - tftp completely broken on non x86 architectures due to bad header file
tftp completely broken on non x86 architectures due to bad header file
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: tftp (Show other bugs)
1.0
strongarm Linux
medium Severity high
: ---
: ---
Assigned To: Elliot Lee
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-12-07 18:20 EST by Ralph Siemsen
Modified: 2007-04-18 12:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-12-07 18:34:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ralph Siemsen 2001-12-07 18:20:19 EST
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 18:34:02 EST
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 16:31:33 EST
I just removed the file...

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