diff mbox

video: fbdev: aty: do not leak uninitialized padding in clk to userspace

Message ID 20170829135004.5739-1-vdronov@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vladis Dronov Aug. 29, 2017, 1:50 p.m. UTC
'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>
---
 drivers/video/fbdev/aty/atyfb_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bartlomiej Zolnierkiewicz Sept. 4, 2017, 1:32 p.m. UTC | #1
On Tuesday, August 29, 2017 03:50:04 PM Vladis Dronov wrote:
> '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>

Patch queued for 4.14, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index b55fdac..e4c91d7 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -1855,7 +1855,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;