Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp61296pxj; Thu, 20 May 2021 04:36:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSAIMBizbNJbbKEqbMTCCk2Bg0wKAhdeyXJWvBKCGmkKoCdjUZSIIEoZZIXRvIYgEhghuc X-Received: by 2002:a05:6402:22fa:: with SMTP id dn26mr4380575edb.5.1621510561429; Thu, 20 May 2021 04:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621510561; cv=none; d=google.com; s=arc-20160816; b=wzJGZ9nw8nB31RhsqDZdIZEt8zwpdAl6Fkjgh0wfJ94p90VpsUmNAQ3/e4fOxhxtaY xTMvR5PmZAFwOW7gyvGWXc+PCR4uCBVuIf4Zi1zWk70a12U+ePPMZu8o6A074GG+VoIK GBxu4XZO4CkBTyWTObfi3gEGtKcphiVJs+LOMOFa8zbIGRZoGUX/HFp84ADGzI6EHMod TlxmkafeDjQZTR7wgLJy2IU0ecT2cquQp1+2bNxoo1renb9DeR8+yxf+Olf56OEtYHHa RLy2veJ8KR8Wd/d9R07cxmjXsd05YRg1AguwZQXy4nCMeKRGitkTIwItcc1Lp2xAWmTt yaAg== 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=m4+ssaKLZsRz4O7bOiMhS77F0FHFqXkrinv2Nir8VQE=; b=qWJkKiPKnfaZlvLS6oOI2m6YPKeSjBaxypIrcQTyaZ7WOut9R+B/1u5VjRut1Mkoof f/UfEuCs07+wnPtt1A/d1CkcI1+P5jeiKRgW7JVvGK1hjxsVhq2C+3djgvTkKbxr7nBd wXGrUygaY96MWX8tgFu1EkPK/o97wcs+/Ks3Jx8McAD8IXYQn+16iFZMWtR8Uq6v/pHa pFAL0zIJapsVXdMPkG6VRlaAUAMze8KvXycNWRuE/7MJ8hkZdxHr0w8o+UlsVFFiq/0s viSXwYRd5pv6IZpQ/EcuwgOpJ4Z/mbuDQ2St9BQP9+mMwGvd4Gdt3vIXzSEL7P86TkAe YLMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wnDYxv2W; 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 f10si2400464edy.212.2021.05.20.04.35.37; Thu, 20 May 2021 04:36:01 -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=wnDYxv2W; 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 S242022AbhETLeP (ORCPT + 99 others); Thu, 20 May 2021 07:34:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:56154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239163AbhETLN2 (ORCPT ); Thu, 20 May 2021 07:13:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4B94561945; Thu, 20 May 2021 10:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505295; bh=eQT+RUYMSSOGUfAbho9vRK5AgeDf4JlAwvHPotC8SRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wnDYxv2W7LIb34fn2EdgU5SRSwekYp2nY/UqR82ZxgkkxXvQ1Bgv3t7AHYYMpC6OI nIAOr52aatth51jHXlxDj2kpRDfSU5qmIUIsbpM8V6xFelraoyf7kdOkvLsdMwrC2C grbSuOmiKCF4zggCkuTJrXBbuEAAUwZtItZdHrN8= 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 4.4 069/190] drm/radeon: fix copy of uninitialized variable back to userspace Date: Thu, 20 May 2021 11:22:13 +0200 Message-Id: <20210520092104.458188854@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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 @@ -503,6 +503,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: