gma/gma500: fix a memory disclosure bug due to uninitialized bytes
Subsystems (3)
PATCH 1/1 gma/gma500: fix a memory disclosure bug due to uninitialized bytes
best_clock is an object that may be sent out. Object clock contains uninitialized bytes that are copied to best_clock, which leads to memory disclosure and information leak.
--- drivers/gpu/drm/gma500/cdv_intel_display.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/gma500/cdv_intel_display.c +2 -0
@@ -405,6 +405,8 @@ static bool cdv_intel_find_dp_pll(const struct gma_limit_t *limit,struct gma_crtc *gma_crtc =to_gma_crtc (crtc);struct gma_clock_t clock; +memset (&clock,0 ,sizeof (clock)); +switch (refclk) {case 27000 :if (target <200000 ) {
Signature · 1 line
2.17.1
Quoted 14 lines · Kangjie Lu
best_clockis an object that may be sent out. Objectclockcontains uninitialized bytes that are copied tobest_clock, which leads to memory disclosure and information leak.Signed-off-by Kangjie Lu <[email protected]>--- drivers/gpu/drm/gma500/cdv_intel_display.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/gma500/cdv_intel_display.c +0
-0
drivers/gpu/drm/gma500/cdv_intel_display.c static bool cdv_intel_find_dp_pll(const struct gma_limit_t *limit, · line 408
Quoted 4 lines
drivers/gpu/drm/gma500/cdv_intel_display.c +1
-0@@ -405,6 +405,8 @@ static bool cdv_intel_find_dp_pll(const struct gma_limit_t *limit,struct gma_crtc *gma_crtc =to_gma_crtc (crtc);struct gma_clock_t clock; +memset (&clock,0 ,sizeof (clock));
I guess whatever analyzer you use for this doesn't see past the ->clock vfunc call, so shouldn't be a real issue. Also, it's not an information disclosure since we only ever leak this to other kernel code, never userspace.
But I guess doesn't hurt, so applied.
-Daniel
Quoted 7 lines
drivers/gpu/drm/gma500/cdv_intel_display.c +1
-0+switch (refclk) {case 27000 :if (target <200000 ) {Signature · 1 line
2.17.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch