video: fbdev: aty: do not leak uninitialized padding in clk to userspace
authorVladis Dronov <vdronov@redhat.com>
Mon, 4 Sep 2017 14:00:50 +0000 (16:00 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 12 Oct 2017 14:27:20 +0000 (15:27 +0100)
commit 8e75f7a7a00461ef6d91797a60b606367f6e344d upstream.

'clk' is copied to a userland with padding byte(s) after 'vclk_post_div'
field unitialized, leaking data from the stack. Fix this ensuring all of
'clk' is initialized to zero.

References: https://github.com/torvalds/linux/pull/441
Reported-by: sohu0106 <sohu0106@126.com>
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/video/aty/atyfb_base.c

index 44bdce4..3f75f5f 100644 (file)
@@ -1852,7 +1852,7 @@ static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
 #if defined(DEBUG) && defined(CONFIG_FB_ATY_CT)
        case ATYIO_CLKR:
                if (M64_HAS(INTEGRATED)) {
-                       struct atyclk clk;
+                       struct atyclk clk = { 0 };
                        union aty_pll *pll = &par->pll;
                        u32 dsp_config = pll->ct.dsp_config;
                        u32 dsp_on_off = pll->ct.dsp_on_off;