projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f5bef0b
)
drm: avoid exposing kernel stack in compat_drm_getstats
author
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Sun, 21 Aug 2016 17:56:19 +0000
(19:56 +0200)
committer
Daniel Vetter
<daniel.vetter@ffwll.ch>
Mon, 22 Aug 2016 07:27:06 +0000
(09:27 +0200)
The C standard does not specify the size of the integer used
to store an enum. Hence in structure drm_stats32_t alignment
bytes may exist.
To avoid exposing bytes from the kernel stack it is
necessary to initialize variable s32 completely.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link:
http://patchwork.freedesktop.org/patch/msgid/1471802179-2886-1-git-send-email-xypron.glpk@gmx.de
drivers/gpu/drm/drm_ioc32.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/gpu/drm/drm_ioc32.c
b/drivers/gpu/drm/drm_ioc32.c
index 57676f8d7ecfe70c54fd79a3d714f196ff1406a5..32a489b0faff9ac87cae1fb7b899ee954b466d77 100644
(file)
--- a/
drivers/gpu/drm/drm_ioc32.c
+++ b/
drivers/gpu/drm/drm_ioc32.c
@@
-346,6
+346,7
@@
static int compat_drm_getstats(struct file *file, unsigned int cmd,
struct drm_stats __user *stats;
int i, err;
+ memset(&s32, 0, sizeof(drm_stats32_t));
stats = compat_alloc_user_space(sizeof(*stats));
if (!stats)
return -EFAULT;