]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/radeon: fix copy of uninitialized variable back to userspace
authorColin Ian King <colin.king@canonical.com>
Wed, 3 Mar 2021 00:27:59 +0000 (00:27 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:49:27 +0000 (10:49 +0200)
commit7ad2d0e8430de51b35d12e1e9c8c58d3150f8105
tree049b8a9324552624244f906c332e198c6c7a0011
parent62b5cf10d13a5fcc64e21b6e597c7ecd46b26196
drm/radeon: fix copy of uninitialized variable back to userspace

commit 8dbc2ccac5a65c5b57e3070e36a3dc97c7970d96 upstream.

Currently the ioctl command RADEON_INFO_SI_BACKEND_ENABLED_MASK can
copy back uninitialised data in value_tmp that pointer *value points
to. This can occur when rdev->family is less than CHIP_BONAIRE and
less than CHIP_TAHITI.  Fix this by adding in a missing -EINVAL
so that no invalid value is copied back to userspace.

Addresses-Coverity: ("Uninitialized scalar variable)
Cc: stable@vger.kernel.org # 3.13+
Fixes: 439a1cfffe2c ("drm/radeon: expose render backend mask to the userspace")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/radeon/radeon_kms.c