quadd: fix stack info leak when getting capabilities
Jianqiang Zhao [Tue, 2 Aug 2016 03:57:13 +0000 (11:57 +0800)]
Fix stack info leak when getting capabilities

Bug 1797747

Change-Id: Ic39112748fb2f053e6963b88e46ba2d953390edf
Signed-off-by: Jianqiang Zhao <zhaojianqiang1@gmail.com>
Reviewed-on: http://git-master/r/1205756
GVS: Gerrit_Virtual_Submit
Tested-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

drivers/misc/tegra-profiler/comm.c

index 80c8461..b8bbb26 100644 (file)
@@ -483,6 +483,7 @@ device_ioctl(struct file *file,
                break;
 
        case IOCTL_GET_CAP:
+               memset(&cap, 0, sizeof(cap));
                comm_ctx.control->get_capabilities(&cap);
                if (copy_to_user((void __user *)ioctl_param, &cap,
                                 sizeof(struct quadd_comm_cap))) {