svn commit: r302252 - head/sys/kern

Adrian Chadd adrian.chadd at gmail.com
Mon Jul 4 20:09:21 UTC 2016


On 4 July 2016 at 12:28, Ed Schouten <ed at nuxi.nl> wrote:
> 2016-07-04 21:08 GMT+02:00 Adrian Chadd <adrian.chadd at gmail.com>:
>> Does the specification / implementation also mandate that the padding
>> is zero'ed out or otherwise initialised?
>
> Well... That's tricky:
>
> https://stackoverflow.com/questions/13056364/is-zero-initialization-of-structures-guaranteed-to-wipe-padded-areas
> https://gustedt.wordpress.com/2012/10/24/c11-defects-initialization-of-padding/

Right, so if we're not careful, we could leak bits of kernel memory,
and it can also screw up key cache comparisons.

(I asked this question because I've been screwed by it recentlyish,
and it looks like the latest C standard didn't fix it..)


-adrian


More information about the svn-src-head mailing list