2016-12-17 01:04:11

by Kees Cook

[permalink] [raw]
Subject: [PATCH] drm/vmwgfx: use designated initializers

Prepare to mark sensitive kernel structures for randomization by making
sure they're using designated initializers. These were identified during
allyesconfig builds of x86, arm, and arm64, with most initializer fixes
extracted from grsecurity.

Signed-off-by: Kees Cook <[email protected]>
---
drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
index 170b61be1e4e..fec7348cea2c 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
@@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
}

const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
- vmw_gmrid_man_init,
- vmw_gmrid_man_takedown,
- vmw_gmrid_man_get_node,
- vmw_gmrid_man_put_node,
- vmw_gmrid_man_debug
+ .init = vmw_gmrid_man_init,
+ .takedown = vmw_gmrid_man_takedown,
+ .get_node = vmw_gmrid_man_get_node,
+ .put_node = vmw_gmrid_man_put_node,
+ .debug = vmw_gmrid_man_debug
};
--
2.7.4


--
Kees Cook
Nexus Security


2016-12-19 22:13:57

by Sinclair Yeh

[permalink] [raw]
Subject: Re: [PATCH] drm/vmwgfx: use designated initializers

Reviewed-by: Sinclair Yeh <[email protected]>

thanks!

On Fri, Dec 16, 2016 at 05:04:02PM -0800, Kees Cook wrote:
> Prepare to mark sensitive kernel structures for randomization by making
> sure they're using designated initializers. These were identified during
> allyesconfig builds of x86, arm, and arm64, with most initializer fixes
> extracted from grsecurity.
>
> Signed-off-by: Kees Cook <[email protected]>
> ---
> drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> index 170b61be1e4e..fec7348cea2c 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
> @@ -164,9 +164,9 @@ static void vmw_gmrid_man_debug(struct ttm_mem_type_manager *man,
> }
>
> const struct ttm_mem_type_manager_func vmw_gmrid_manager_func = {
> - vmw_gmrid_man_init,
> - vmw_gmrid_man_takedown,
> - vmw_gmrid_man_get_node,
> - vmw_gmrid_man_put_node,
> - vmw_gmrid_man_debug
> + .init = vmw_gmrid_man_init,
> + .takedown = vmw_gmrid_man_takedown,
> + .get_node = vmw_gmrid_man_get_node,
> + .put_node = vmw_gmrid_man_put_node,
> + .debug = vmw_gmrid_man_debug
> };
> --
> 2.7.4
>
>
> --
> Kees Cook
> Nexus Security