gpu: nvgpu: initialize local variable
Deepak Nibade [Thu, 4 Aug 2016 14:12:38 +0000 (19:12 +0530)]
Initialize character array buf in gk20a_channel_ioctl() to zero
Keeping it uninitialized can result in leaking kernel stack
info to user space since we pass this buffer to UMD

Bug 1793398

Change-Id: Iffd654dbaca3b4e3c8fd2ac270d0febd01c165b8
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1195862
(cherry picked from commit 118809f4bd07af20df2b6c012828834695a5fccf)
Reviewed-on: http://git-master/r/1201487
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>

drivers/gpu/nvgpu/gk20a/channel_gk20a.c

index 277e038..109c7b1 100644 (file)
@@ -2475,7 +2475,7 @@ long gk20a_channel_ioctl(struct file *filp,
 {
        struct channel_gk20a *ch = filp->private_data;
        struct platform_device *dev = ch->g->dev;
-       u8 buf[NVGPU_IOCTL_CHANNEL_MAX_ARG_SIZE];
+       u8 buf[NVGPU_IOCTL_CHANNEL_MAX_ARG_SIZE] = {0};
        int err = 0;
 
        gk20a_dbg_fn("start %d", _IOC_NR(cmd));