mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
drm: avoid exposing kernel stack in compat_drm_getstats
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
This commit is contained in:
parent
f5bef0b85e
commit
ec913f31a5
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue