staging/dgnc: fix info leak in ioctl
authorSalva Peiró <speirofr@gmail.com>
Wed, 14 Oct 2015 15:48:02 +0000 (17:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Oct 2015 05:51:40 +0000 (22:51 -0700)
The dgnc_mgmt_ioctl() code fails to initialize the 16 _reserved bytes of
struct digi_dinfo after the ->dinfo_nboards member. Add an explicit
memset(0) before filling the structure to avoid the info leak.

Signed-off-by: Salva Peiró <speirofr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_mgmt.c

index 9ec3efe0a287affdd44d9b6864e9efd40e9c0eaf..518fbd5e2d0e20159ba4b548b92e418b67c36858 100644 (file)
@@ -110,6 +110,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                spin_lock_irqsave(&dgnc_global_lock, flags);
 
+               memset(&ddi, 0, sizeof(ddi));
                ddi.dinfo_nboards = dgnc_NumBoards;
                sprintf(ddi.dinfo_version, "%s", DG_PART);