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


Groups > linux.kernel > #1681090 > unrolled thread

[PATCH][drm-next] drm compat: ensure mode in drm_agp_info is being copied

Started byColin King <colin.king@canonical.com>
First post2017-07-04 18:50 +0200
Last post2017-07-04 19:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH][drm-next] drm compat: ensure mode in drm_agp_info is being copied Colin King <colin.king@canonical.com> - 2017-07-04 18:50 +0200
    Re: [PATCH][drm-next] drm compat: ensure mode in drm_agp_info is  being copied Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-04 19:40 +0200

#1681090 — [PATCH][drm-next] drm compat: ensure mode in drm_agp_info is being copied

FromColin King <colin.king@canonical.com>
Date2017-07-04 18:50 +0200
Subject[PATCH][drm-next] drm compat: ensure mode in drm_agp_info is being copied
Message-ID<tZzbt-2v3-9@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

A recent compat change removed the copying of i32.mode from info.mode.
Add it back in to fix this removal as we currently are leaking information
from the stack.

Detected by CoverityScan, CID#1449374 ("Unitialized scalar variable")

Fixes: 2337f2272ee1 ("compat_drm: switch AGP compat ioctls to drm_ioctl_kernel()")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/drm_ioc32.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
index 340eccfe35a1..94acf5109235 100644
--- a/drivers/gpu/drm/drm_ioc32.c
+++ b/drivers/gpu/drm/drm_ioc32.c
@@ -648,6 +648,7 @@ static int compat_drm_agp_info(struct file *file, unsigned int cmd,
 
 	i32.agp_version_major = info.agp_version_major;
 	i32.agp_version_minor = info.agp_version_minor;
+	i32.mode = info.mode;
 	i32.aperture_base = info.aperture_base;
 	i32.aperture_size = info.aperture_size;
 	i32.memory_allowed = info.memory_allowed;
-- 
2.11.0

[toc] | [next] | [standalone]


#1681108 — Re: [PATCH][drm-next] drm compat: ensure mode in drm_agp_info is being copied

FromAl Viro <viro@ZenIV.linux.org.uk>
Date2017-07-04 19:40 +0200
SubjectRe: [PATCH][drm-next] drm compat: ensure mode in drm_agp_info is being copied
Message-ID<tZzXQ-2ZJ-19@gated-at.bofh.it>
In reply to#1681090
On Tue, Jul 04, 2017 at 05:48:21PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> A recent compat change removed the copying of i32.mode from info.mode.
> Add it back in to fix this removal as we currently are leaking information
> from the stack.
> 
> Detected by CoverityScan, CID#1449374 ("Unitialized scalar variable")

Folded and pushed out.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web