Subject: Re: wu-ftpd-2.4.2-beta-18-vr14 and HP-UX (fwd)

From: Gregory A Lundberg <[email-masked]>
Date: Wed, 17 Feb 1999 07:54:39 -0500 (EST)

---------- Forwarded message ----------
Date: Wed, 17 Feb 1999 07:16:12 -0500 (EST)
From: Gregory A Lundberg <[email-masked]>
To: Rainer Kuerschner <[email-masked]>
Subject: Re: wu-ftpd-2.4.2-beta-18-vr14 and HP-UX

I love open software!

Since I don't have an HP-UX 10.20 machine, I've never been able to test
this.

Over the past week, there have been at least five people trying to fix
that bug.  Nobody notice the bad linkage.

But, open software wins out again.  Finally, someone saw the obvious and
shared the observation.

Thank you.

On Wed, 17 Feb 1999, Rainer Kuerschner wrote:

> because of the recent CERT Advisory I upgraded the ftpd of our anonymous
> ftp server to your current version VR14. While linking I received several
> warnings about LoaD Word and STore Word instructions accessing unaligned data
> in access.o (System: HP 712, HP-UX 10.20, HP ANSI cc). Even though I haven't
> tried the executable the linker produced it would most probably receive a
> SIGBUS when executing one of these instructions. This misaligned data access
> is in my opinion caused by a coding flaw:
> 
> In File access.c line 71 the variable defumask is declared as an 'extern int',
> telling the compiler that defumask has 32 bit alignment. defumask is defined
> in file ftpd.c line 330 as type mode_t which boils down to an unsigned short,
> having only a guaranteed alignment of 16 bit. In function acl_getdefumask
> in file access.c defumask is assigned the result of a strtoul() call and as
> the compiler assumes defumask is 32 bit aligned it generates 32 bit store
> instructions. The result may vary depending on platform, compiler and compiler
> switches from everything OK through data corruption to a SIGBUS (on RISCs).
> The correct way should be declaring defumask as 'extern mode_t':
> 
> *** access.c.orig       Tue Feb 16 12:23:37 1999
> --- access.c    Tue Feb 16 12:24:13 1999
> ***************
> *** 68,76 ****
>   extern int nameserved,
>     anonymous,
>     guest,
> -   defumask,
>     TCPwindowsize,
>     use_accessfile;
>   char Shutdown[MAXPATHLEN];
>   #define MAXLINE       80
>   static  char  incline[MAXLINE];
> --- 68,76 ----
>   extern int nameserved,
>     anonymous,
>     guest,
>     TCPwindowsize,
>     use_accessfile;
> + extern mode_t defumask;
>   char Shutdown[MAXPATHLEN];
>   #define MAXLINE       80
>   static  char  incline[MAXLINE];
> 
> 
> 
> Greetings
>           Rainer K"urschner
> 
> 
> ================================================================================
> Rainer K"urschner                                  [email-masked]
> Institut f"ur Theoretische Astrophysik                        Network Management
> Tiergartenstrasse 15                                      Tel.: +49-6221-54-8988
> 69121 Heidelberg / Germany                                Fax : +49-6221-54-4221
> ================================================================================
> 

-- 

Gregory A Lundberg              Senior Partner, VRnet Company
1441 Elmdale Drive              [email-masked]
Kettering, OH 45409-1615 USA    1-800-809-2195