Index | Thread | Search

From:
"Theo de Raadt" <deraadt@openbsd.org>
Subject:
Re: ether extract headers alingment memcpy
To:
Alexander Bluhm <alexander.bluhm@gmx.net>
Cc:
Mark Kettenis <mark.kettenis@xs4all.nl>, Marcus Glocker <marcus@nazgul.ch>, tech@openbsd.org
Date:
Tue, 13 Feb 2024 07:15:32 -0700

Download raw body.

Thread
Alexander Bluhm <alexander.bluhm@gmx.net> wrote:

> On Tue, Feb 13, 2024 at 03:05:14PM +0100, Mark Kettenis wrote:
> > > Date: Tue, 13 Feb 2024 14:47:36 +0100
> > > From: Marcus Glocker <marcus@nazgul.ch>
> > 
> > I would really like to understand what is happening here.  What bluhm@
> > described just didn' make sense.  And I think some of the testing
> > being done is flawed.
> 
> The test that claimed, using uint8_t would help was flawed.  I found
> no other way than memcpy() to get rid of 32 bit load of bit fields.

I still think this is a problem in the older pre-gpl3 gcc, and very
similar to what we ran into on alpha; a wrong decision is made somewhere,
and it performs the full register load.  Back in the day, we thought this
was becaue early alpha's didn't have byte load instructions, so that's why
gcc was biased towards doing 32-bit loads.  But I've never believed this
is an alpha-only problem, rather, I think there is some logic error which
loses the plot on a potential alignment problem.