staging: ft1000: fix kernel info leak to userland for statistics
authorVasiliy Kulikov <segooon@gmail.com>
Sun, 3 Oct 2010 17:22:48 +0000 (21:22 +0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 5 Oct 2010 18:42:20 +0000 (11:42 -0700)
get_stat_data is not fully initialized before copy_to_user() call,
e.g. LedStat is not always set.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c

index 46e72e4b91fd7af2048aacb734e7ade07949439c..3325e876539029319e5dd3c680ba52c78273c800 100644 (file)
@@ -616,7 +616,7 @@ static long ft1000_ChIoctl (struct file *File, unsigned int Command,
         break;
     case IOCTL_GET_DSP_STAT_CMD:
         //DEBUG("FT1000:ft1000_ChIoctl: IOCTL_FT1000_GET_DSP_STAT called\n");
-
+       memset(&get_stat_data, 0, sizeof(get_stat_data));
         memcpy(get_stat_data.DspVer, info->DspVer, DSPVERSZ);
         memcpy(get_stat_data.HwSerNum, info->HwSerNum, HWSERNUMSZ);
         memcpy(get_stat_data.Sku, info->Sku, SKUSZ);