[PATCH] drm/ttm: use designated initializers

Kees Cook keescook at chromium.org
Tue Dec 20 19:55:38 UTC 2016


On Sun, Dec 18, 2016 at 10:53 PM, Alexander Stein
<alexander.stein at systec-electronic.com> wrote:
> Hello Kees,
>
> While understanding what your patches (I've seen the other ones as well) do
> themself, I still don't get what your intention is, e.g. why you need this?
> Apart from a better readability.
>
> On Friday 16 December 2016 16:59:29, Kees Cook wrote:
>> Prepare to mark sensitive kernel structures for randomization by making
>> sure they're using designated initializers.
>
> Can you please elaborate what you mean with that sentence?

Hi! Sure: the coming (and optional) gcc plugin "randstruct" performs
structure layout randomization, which means that static initializers
cannot be "ordered" (they must be "designated"), since the place were
layout randomization occurs happens separate from how static
initializers are applied.

This change from ordered to designated is just to help the compiler do
the right thing.

-Kees

-- 
Kees Cook
Nexus Security


More information about the dri-devel mailing list