Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1698969

Re: [PATCH] drm/amd/powerplay: rv: Use designated initializers

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH] drm/amd/powerplay: rv: Use designated initializers
Date 2017-07-28 19:20 +0200
Message-ID <u8h5E-6CJ-17@gated-at.bofh.it> (permalink)
References <u7fSi-8jG-23@gated-at.bofh.it> <u82zD-5vS-3@gated-at.bofh.it> <u8h5E-6CJ-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Jul 28, 2017 at 2:13 AM, Christian König
<christian.koenig@amd.com> wrote:
> Am 28.07.2017 um 03:43 schrieb Alex Deucher:
>>
>> On Tue, Jul 25, 2017 at 5:47 PM, Kees Cook <keescook@chromium.org> wrote:
>>>
>>> As done for vega10 in commit 3ddd396f6b57 ("drm/amd/powerplay: Use
>>> designated initializers") mark other tableFunction entries with
>>> designated
>>> initializers. The randstruct plugin requires designated initializers for
>>> structures that are entirely function pointers.
>>>
>>> Cc: Rex Zhu <Rex.Zhu@amd.com>
>>> Cc: Hawking Zhang <Hawking.Zhang@amd.com>
>>> Cc: Alex Deucher <alexander.deucher@amd.com>
>>> Signed-off-by: Kees Cook <keescook@chromium.org>
>>> ---
>>> If I can get an Ack for this, I'll carry it in the gcc-plugins tree,
>>> unless
>>> you think this is worth landing for v4.13, in which case, please take it
>>> now. :)
>>>
>> Acked-by: Alex Deucher <alexander.deucher@amd.com>
>>
>> I'm happy to take this through my tree if that is ok with you.
>
>
> I'm wondering a bit how the plugin detects that it can randomize a structure
> layout?
>
> We have a couple of structs where this would be fatal.

Automatic randomization only happen on struct that are entirely
function pointers.

See:
https://git.kernel.org/linus/313dd1b629219db50cad532dba6a3b3b22ffe622

And:
https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?id=914e2dfc61195a95868ae5c750690a7f1c87bc66

If you have any structures that are shared externally from the kernel,
I can mark them with __no_randomize_layout.

-Kees

-- 
Kees Cook
Pixel Security

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] drm/amd/powerplay: rv: Use designated initializers Kees Cook <keescook@chromium.org> - 2017-07-25 23:50 +0200
  Re: [PATCH] drm/amd/powerplay: rv: Use designated initializers Alex Deucher <alexdeucher@gmail.com> - 2017-07-28 03:50 +0200
    Re: [PATCH] drm/amd/powerplay: rv: Use designated initializers Kees Cook <keescook@chromium.org> - 2017-07-28 19:20 +0200
      RE: [PATCH] drm/amd/powerplay: rv: Use designated initializers "Deucher, Alexander" <Alexander.Deucher@amd.com> - 2017-07-28 19:30 +0200
    Re: [PATCH] drm/amd/powerplay: rv: Use designated initializers Kees Cook <keescook@chromium.org> - 2017-07-28 19:20 +0200

csiph-web