* [PATCH] drm/nouveau: use designated initializers
@ 2016-12-17 1:04 Kees Cook
2016-12-18 13:47 ` Daniel Vetter
0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2016-12-17 1:04 UTC (permalink / raw
To: linux-kernel; +Cc: Ben Skeggs, David Airlie, dri-devel, nouveau
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 <keescook@chromium.org>
---
drivers/gpu/drm/nouveau/nouveau_ttm.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
index a6dbe8258040..ec4668a41e01 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
@@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
}
const struct ttm_mem_type_manager_func nouveau_vram_manager = {
- nouveau_vram_manager_init,
- nouveau_vram_manager_fini,
- nouveau_vram_manager_new,
- nouveau_vram_manager_del,
+ .init = nouveau_vram_manager_init,
+ .takedown = nouveau_vram_manager_fini,
+ .get_node = nouveau_vram_manager_new,
+ .put_node = nouveau_vram_manager_del,
};
static int
@@ -184,11 +184,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
}
const struct ttm_mem_type_manager_func nouveau_gart_manager = {
- nouveau_gart_manager_init,
- nouveau_gart_manager_fini,
- nouveau_gart_manager_new,
- nouveau_gart_manager_del,
- nouveau_gart_manager_debug
+ .init = nouveau_gart_manager_init,
+ .takedown = nouveau_gart_manager_fini,
+ .get_node = nouveau_gart_manager_new,
+ .put_node = nouveau_gart_manager_del,
+ .debug = nouveau_gart_manager_debug
};
/*XXX*/
@@ -257,11 +257,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
}
const struct ttm_mem_type_manager_func nv04_gart_manager = {
- nv04_gart_manager_init,
- nv04_gart_manager_fini,
- nv04_gart_manager_new,
- nv04_gart_manager_del,
- nv04_gart_manager_debug
+ .init = nv04_gart_manager_init,
+ .takedown = nv04_gart_manager_fini,
+ .get_node = nv04_gart_manager_new,
+ .put_node = nv04_gart_manager_del,
+ .debug = nv04_gart_manager_debug
};
int
--
2.7.4
--
Kees Cook
Nexus Security
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/nouveau: use designated initializers
2016-12-17 1:04 [PATCH] drm/nouveau: use designated initializers Kees Cook
@ 2016-12-18 13:47 ` Daniel Vetter
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2016-12-18 13:47 UTC (permalink / raw
To: Kees Cook; +Cc: linux-kernel, nouveau, Ben Skeggs, dri-devel
On Fri, Dec 16, 2016 at 05:04:42PM -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 <keescook@chromium.org>
Merged all drm ones except the amdgpu one (I'll leave that one to Alex) to
drm-misc for 4.11 (so will show up in linux-next after xmas or so).
-Daniel
> ---
> drivers/gpu/drm/nouveau/nouveau_ttm.c | 28 ++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> index a6dbe8258040..ec4668a41e01 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> @@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
> }
>
> const struct ttm_mem_type_manager_func nouveau_vram_manager = {
> - nouveau_vram_manager_init,
> - nouveau_vram_manager_fini,
> - nouveau_vram_manager_new,
> - nouveau_vram_manager_del,
> + .init = nouveau_vram_manager_init,
> + .takedown = nouveau_vram_manager_fini,
> + .get_node = nouveau_vram_manager_new,
> + .put_node = nouveau_vram_manager_del,
> };
>
> static int
> @@ -184,11 +184,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
> }
>
> const struct ttm_mem_type_manager_func nouveau_gart_manager = {
> - nouveau_gart_manager_init,
> - nouveau_gart_manager_fini,
> - nouveau_gart_manager_new,
> - nouveau_gart_manager_del,
> - nouveau_gart_manager_debug
> + .init = nouveau_gart_manager_init,
> + .takedown = nouveau_gart_manager_fini,
> + .get_node = nouveau_gart_manager_new,
> + .put_node = nouveau_gart_manager_del,
> + .debug = nouveau_gart_manager_debug
> };
>
> /*XXX*/
> @@ -257,11 +257,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
> }
>
> const struct ttm_mem_type_manager_func nv04_gart_manager = {
> - nv04_gart_manager_init,
> - nv04_gart_manager_fini,
> - nv04_gart_manager_new,
> - nv04_gart_manager_del,
> - nv04_gart_manager_debug
> + .init = nv04_gart_manager_init,
> + .takedown = nv04_gart_manager_fini,
> + .get_node = nv04_gart_manager_new,
> + .put_node = nv04_gart_manager_del,
> + .debug = nv04_gart_manager_debug
> };
>
> int
> --
> 2.7.4
>
>
> --
> Kees Cook
> Nexus Security
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-18 13:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-17 1:04 [PATCH] drm/nouveau: use designated initializers Kees Cook
2016-12-18 13:47 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).