diff options
author | 2019-07-27 17:30:30 +0800 | |
---|---|---|
committer | 2019-07-31 01:26:09 -0500 | |
commit | 929e571c04c285861e0bb049a396a2bdaea63282 (patch) | |
tree | 91719c3f9d8e946292ad7d17d2ab9e6710b1633d /tools/perf/scripts/python/export-to-postgresql.py | |
parent | drm/amdgpu: fix error handling in amdgpu_cs_process_fence_dep (diff) | |
download | wireguard-linux-929e571c04c285861e0bb049a396a2bdaea63282.tar.xz wireguard-linux-929e571c04c285861e0bb049a396a2bdaea63282.zip |
drm/amdgpu: fix a potential information leaking bug
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>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions