svn commit: r302252 - head/sys/kern

David Chisnall David.Chisnall at cl.cam.ac.uk
Tue Jul 5 08:30:29 UTC 2016


On 4 Jul 2016, at 21:09, Adrian Chadd <adrian.chadd at gmail.com> wrote:
> 
> 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..)

It was discussed at the WG14 meeting in London in April, but I don’t think that there was a clear consensus.  It gets particularly tricky for _Atomic types, and I think that there’s now a clarification (or will be in C2x, if not) that any padding in _Atomic types is zeroed.

Generally, compilers will turn this into a bzero and then a set of the remaining fields, so you’re likely to end up with the right thing, but it’s not guaranteed by the standard.

David



More information about the svn-src-all mailing list