Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4577678pxj; Wed, 12 May 2021 08:32:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyghd8ur33jyNUjZut6XOuD9ZZ8esEgcR3jpaoRi12icidn2Ab8xpVVkGwT9XotAGEVURPQ X-Received: by 2002:a05:6808:1150:: with SMTP id u16mr7976365oiu.74.1620833577987; Wed, 12 May 2021 08:32:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620833577; cv=none; d=google.com; s=arc-20160816; b=Hdd9h+1UaYFR315evKFmXtpol0GCQdqJbFXKFv31UU8ejXiaPRu0Fzaj6zAJo9H98g fDymo9tU8a0vkhq8rIZHQytlVBKr32GYVH3F3Qr3nsyEVR8C37tTwQPrznItZp+DU4OB vvMnEguJAHt91xWDG3tim3RG7L+EwDq3LYbOAWY2fN44vsff2FnmPZHQH07xMWbzmCs+ TPF8IyfAIg7WjcgfphzebtKzKFAiIHCFKYWAP4Q8Ptq1xj6xXSW0TqOMSKt3zvLkQWgH 7R+W9MTuJ145d4P75hZek+VnSPiMuV/Bk2nKJ6UGPNg2wXGCnjnDDItD7Alsy78G5QN+ 4KDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hxf3FFoXtzfv5msiZjCUS6nQKgNPpourGi4+avMO2bk=; b=hQhaRsircZ9N2Se88LwmaHDIQ8v8V0s2wqEL3VrPjoUD+bd/c+gdA7le4L1uoxhjya 3qJ5wyKhA8itxVj1qErlokVGRR9fYh+Jq6R9i0v0eEAyIGry66Qf6EMdPI6CqM4a+Un5 mojO5xTeYJxFMpXxyMpcpjfsBKBwtiFeuhL/ZV99ImI6wM5OTECbA7hg+IgFflxwvxp0 wW+6y/J+rB96fBAD8JOVbb8dW7tuayA/GlrQAuhyCaIyw1MPFqJLEyb7jU9z3Aa0L74w cH+kn7in0KbHtddNDuA9TC9p3YOwvUuYCL52GutqU8UDWI/ItE1U57HOWG7c/mqMEjHF 5dQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=luDzcDV5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r8si198155otn.251.2021.05.12.08.32.43; Wed, 12 May 2021 08:32:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=luDzcDV5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234300AbhELPcW (ORCPT + 99 others); Wed, 12 May 2021 11:32:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:50766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233941AbhELPPi (ORCPT ); Wed, 12 May 2021 11:15:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6972B6193E; Wed, 12 May 2021 15:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620831911; bh=SFe4uRmtVkrqxJZehugrkHwY3YxnnFtWZhVWl5HPHM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=luDzcDV5skNM4LgzGPJnPkznlvASmBxH24OBQf3hoGwSsFjTVQ6wMwkcjZTbiMRKX +q9tAB85Na37g3F7psRkjOa30FLC0dLTIpzOQsTAAv9f0JYCmErMYlfYnRbkXCSHBL CbPPTamBGEJbVgmPVYCT/LPnsMXO9UuCXQEsZ3J0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Christian=20K=C3=B6nig?= , Colin Ian King , Alex Deucher Subject: [PATCH 5.10 064/530] drm/radeon: fix copy of uninitialized variable back to userspace Date: Wed, 12 May 2021 16:42:54 +0200 Message-Id: <20210512144821.863009550@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King 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 Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/radeon/radeon_kms.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c @@ -512,6 +512,7 @@ static int radeon_info_ioctl(struct drm_ *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: