sshd broken on arm?

Nicholas Clark nick at ccl4.org
Fri Jan 25 05:43:11 PST 2008


On Fri, Jan 25, 2008 at 01:54:39PM +0100, Dag-Erling Smrgrav wrote:
> Nicholas Clark <nick at ccl4.org> writes:
> > On Fri, Jan 25, 2008 at 12:23:09PM +0100, Dag-Erling Smrgrav wrote:
> > > None of this matters.  What John pointed out means that the code is
> > > wrong and the compiler is right.  The code is not allowed to assume
> > > that an object is correctly aligned unless it is of a type that
> > > requires the correct alignment.  The easiest way to do this is with
> > > a union, e.g.
> > Whilst that is correct, why is the compiler changing the alignment of the
> > struct for different optimiser settings but all other flags identical?
> 
> Because *it is not a struct*.

Aha. That was what I missed.

> It is an array of char, and char has no special alignment requirement.
> 
> The bug is in the code, which uses pointer aliasing in a way that is
> strictly speaking legal but which places responsibility for alignment
> issues squarely in the code and not the compiler.

Yes, I agree. In which case I agree with whoever said previously that the
fix needs to be taken upstream, but in turn that they may have already fixed
it as (IIRC) FreeBSD is using a non-current version of openssh.

Nicholas Clark


More information about the freebsd-arm mailing list