Subject: Re: file id alignment
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 07/01/2006 14:23:01
> I thinkt there has been some misunderstanding.  The padding we talk
> about is explicit padding (structure member tf_pad), not the implicit
> one done by the compiler if the members are not properly aligned.

Oh!  Yes, that does make a difference.  A big difference.

>> If zero-filling the padding is in any sense necessary, there is
>> something somewhere else that's broken.
> Well, for the concrete patch I posted it is necessary since we do
> *not* want random kernel stack garbage to leak anywhere.

Of course not - but (if we were talking about implicit padding) that
would still be the fault of the code that exposed pad bytes rather than
the fault of the code that didn't clear the pad bytes.

Yes, if the padding is explicit then I entirely agree.  The situation
is very similar to sin_zero in struct sockaddr_in.  (I have always
thought it was a botch to pay attention to sin_zero on input....)

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B