From: Dan Carpenter Date: Sun, 21 Apr 2013 11:08:31 +0000 (+0300) Subject: staging: dgrp: info leak in dgrp_dpa_ioctl() X-Git-Tag: upstream/snapshot3+hdmi~5290^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eecb262922209d714cc24a1dc8e5bf9a9fdbfc65;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git staging: dgrp: info leak in dgrp_dpa_ioctl() If "nd->nd_vpd_len" is less than 512 then the last part of the "vpd.vpd_data" has uninitialized stack information. We need to clear it before copying the buffer to user space. Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/dgrp/dgrp_dpa_ops.c b/drivers/staging/dgrp/dgrp_dpa_ops.c index 67fb3d6..ca10a33 100644 --- a/drivers/staging/dgrp/dgrp_dpa_ops.c +++ b/drivers/staging/dgrp/dgrp_dpa_ops.c @@ -432,6 +432,7 @@ static long dgrp_dpa_ioctl(struct file *file, unsigned int cmd, case DIGI_GETVPD: + memset(&vpd, 0, sizeof(vpd)); if (nd->nd_vpd_len > 0) { vpd.vpd_len = nd->nd_vpd_len; memcpy(&vpd.vpd_data, &nd->nd_vpd, nd->nd_vpd_len);