mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: "Colin King" <colin.king@canonical.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Marek Olšák" <marek.olsak@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/radeon: fix copy of uninitialized variable back to userspace
Date: Wed, 3 Mar 2021 08:42:31 +0100	[thread overview]
Message-ID: <490409f2-9fcb-d402-a6ae-b45c80bae3d2@amd.com> (raw)
In-Reply-To: <20210303002759.28752-1-colin.king@canonical.com>

Am 03.03.21 um 01:27 schrieb Colin King:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

Let's hope that this doesn't break UAPI.

Christian.

> ---
>   drivers/gpu/drm/radeon/radeon_kms.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
> index 2479d6ab7a36..58876bb4ef2a 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
> @@ -518,6 +518,7 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
>   			*value = rdev->config.si.backend_enable_mask;
>   		} else {
>   			DRM_DEBUG_KMS("BACKEND_ENABLED_MASK is si+ only!\n");
> +			return -EINVAL;
>   		}
>   		break;
>   	case RADEON_INFO_MAX_SCLK:


  reply	other threads:[~2021-03-03 13:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03  0:27 Colin King
2021-03-03  7:42 ` Christian König [this message]
2021-03-03 15:03   ` Alex Deucher
2021-03-11 13:10   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=490409f2-9fcb-d402-a6ae-b45c80bae3d2@amd.com \
    --to=christian.koenig@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=colin.king@canonical.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek.olsak@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®