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


Groups > linux.kernel > #1722510

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

From Vladis Dronov <vdronov@redhat.com>
Newsgroups linux.kernel
Subject [PATCH] video: fbdev: aty: do not leak uninitialized padding in clk to userspace
Date 2017-08-29 16:00 +0200
Message-ID <ujPdE-3jM-23@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


'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(-)

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;
-- 
2.9.5

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] video: fbdev: aty: do not leak uninitialized padding in clk to userspace Vladis Dronov <vdronov@redhat.com> - 2017-08-29 16:00 +0200
  Re: [PATCH] video: fbdev: aty: do not leak uninitialized padding in  clk to userspace Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> - 2017-09-04 15:40 +0200

csiph-web