Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp311141pxj; Thu, 20 May 2021 09:51:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtLEAHsVtvjpjxkb1GGePZ4ji4ES5kFxogTH1UZLHPNc1XrHkujuQLvuNxs+T/kyl62Q66 X-Received: by 2002:a17:907:2071:: with SMTP id qp17mr5597901ejb.15.1621529463640; Thu, 20 May 2021 09:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621529463; cv=none; d=google.com; s=arc-20160816; b=LI18NbHkbJlz9u09PUjmbe0dZh3WIOzrmQzXFXSLchLxk658AIEVPejSk8jVt2sqZN yz6bWDXd2UJFz8JPsuIqYcjMMOKwzNMjswjZkJ0loUt8ev2KGWybkEGhZTAJgz1pMt0v 0quoQAgQpMbNy/ot0OJRxWhKWgHLtyPBGEfNTxGn38TkBDEtEEmTyQMmiA+Nc9IZJXR/ s3lMXLFrbFpOxDJtEKBUnM/jsgo7tZein5vhdaZVK9ZcFnmg07s0yn6QbJLjEImDtcru rbkdB75tLMUeQ8HUaI9q8KjZNMkg3MHUvGvYHim7+K2IYgH63vSBHLI13LS8gPNfCTdT I9lA== 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=Ab70+p68e1T0v1NgjgKC2Bw+Jgs1bDhZ5G4WNyfM/1o=; b=npd9fBTIAZEzvaanMeXvi4HtPjAXZAIUeTdRuGR0vFaJCsB26NTEmjD22fUkdRMOFo XHVZ0iVZJUmeiuuG5TTVdjQpJtbo3m0dILEOHYyHh+5T2Q277YlSPHOE3yOn61Sl4lVZ faYMNFLUcrTgrIcpI7GugdvkLmLaZv56z9SKiV+bKoj5blf0Ru63yLKPQdngB/OijxvK BE1iW64DJP6XEE8iRUxG1usgjuMOr6sewrBjzRnT4aU2NSo7ZUciY+dH9QQ7i9B3DFQg LMT+3CVbaypuOAwz2UyqgvnJs7RsyTfphBLgNrX6bF8kH7MUU4NA2jCNTIeYICyIFt6J n4tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XfY1lTfM; 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 bh7si696010ejb.383.2021.05.20.09.50.39; Thu, 20 May 2021 09:51:03 -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=XfY1lTfM; 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 S234636AbhETJxs (ORCPT + 99 others); Thu, 20 May 2021 05:53:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:53062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234646AbhETJv2 (ORCPT ); Thu, 20 May 2021 05:51:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4CD8261554; Thu, 20 May 2021 09:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503349; bh=+Z+rvsEY+sOHZdoIbWCwNYUegcIPmxfWVzhya/8LMBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XfY1lTfMsGA8fqWgBGw+z1b0kOZjI3R+aVBUWll629RLAanSqZZ9N6orRnj50xjpM WJroHYOvmhUL84PZRCF5Lq9vjMGn31m+poF3C4nD1uhPnuEjYRQF+ZKfZFEe1pfUMW kHMfJn64yE+/UA7djmMRlMY0mUWR6SInGEF7l394= 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.19 147/425] drm/radeon: fix copy of uninitialized variable back to userspace Date: Thu, 20 May 2021 11:18:36 +0200 Message-Id: <20210520092136.262900323@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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 @@ -501,6 +501,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: