kernel-fxtec-pro1x/drivers/gpu
Wang Xiayang 68340db992 drm/amdgpu: fix a potential information leaking bug
[ Upstream commit 929e571c04c285861e0bb049a396a2bdaea63282 ]

Coccinelle reports a path that the array "data" is never initialized.
The path skips the checks in the conditional branches when either
of callback functions, read_wave_vgprs and read_wave_sgprs, is not
registered. Later, the uninitialized "data" array is read
in the while-loop below and passed to put_user().

Fix the path by allocating the array with kcalloc().

The patch is simplier than adding a fall-back branch that explicitly
calls memset(data, 0, ...). Also it does not need the multiplication
1024*sizeof(*data) as the size parameter for memset() though there is
no risk of integer overflow.

Signed-off-by: Wang Xiayang <xywang.sjtu@sjtu.edu.cn>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-08-25 10:47:55 +02:00
..
drm drm/amdgpu: fix a potential information leaking bug 2019-08-25 10:47:55 +02:00
host1x gpu: host1x: Increase maximum DMA segment size 2019-07-31 07:26:59 +02:00
ipu-v3 gpu: ipu-v3: ipu-ic: Fix saturation bit offset in TPMEM 2019-07-26 09:14:29 +02:00
vga vga_switcheroo: Fix missing gpu_bound call at audio client registration 2018-11-13 11:09:00 -08:00
Makefile