Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp2110823lkv; Thu, 20 May 2021 03:40:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCXQ8SgJ0ycIkuMmZFNhZeRSW4pPU103udvc6ufLj0EUrDlzdeFdkdwhZ1VSewKHorFspb X-Received: by 2002:a02:866a:: with SMTP id e97mr3376909jai.136.1621507208790; Thu, 20 May 2021 03:40:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621507208; cv=none; d=google.com; s=arc-20160816; b=F/MEAeBjmLxXqYLEiRYGv5Zp72PtUkKmgImYi6RXDuTu5n556DRE2w3U/hgLW87Js4 lX4VqTIkMX3Z8gSN/qGQLtvJNQXHutV5kknTZvHydKeaWCfwwifj3biIPd3FJpOKBoN/ PRXq/Ed63eLxaDRPUM4C8IgjNAJkhUFwzC4zAZ93pCfoO2aFWHKlI8DzcSLpNqWZBDh4 Qzh1ob3SxmOgq9nspTHcq2hTXiLWYUHOL3xIYdLoUy52reVO3Qwq2DA5+i73i2uut5wi M4R38I1neI/x5fSJssnegllDmNBO10E1ce/oN/BzLGPdvnXEuA9Qjarp+oRpiEec+QW/ tO0g== 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=ghVBTXH3aF3nmLUeIazcZZdSVhnpy8hUvTFWogJChyA=; b=K4jHaG7i9QfxFjO59cfYGoKlt0bo6yFbmy4LOq5ZqFetRjQV7woTGzu5KnxiOn7I2T HDXoqB06/5m4vgrFuZRAzjfNJiZQ7QBjl75qS/B9eKQCOfU7SP/CHEQ6gph+BL79X0Pm YcAPZB8xPesbBRs51ZFh1UuCakA/DCTOtxX6aSkQajH5Rp3wi2m4VbTp0WzW8NfkNVit p2Axay5OmpEdJTUTyuZwwb2WbEHI+gj6Gnj5xfjSE6G1b9mWzS1aSEdK0z68yIno2j9B fEIzj3BzeC+u4FH/FkXqhYTuQSoS3urUjuKIaeETtFk1WaiCr5eZb7+KMgTSsZA5GETb DqZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MwlOq91A; 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 f184si1863022jac.102.2021.05.20.03.39.48; Thu, 20 May 2021 03:40:08 -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=MwlOq91A; 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 S235684AbhETKjw (ORCPT + 99 others); Thu, 20 May 2021 06:39:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:55902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236882AbhETKYr (ORCPT ); Thu, 20 May 2021 06:24:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A8AD061C22; Thu, 20 May 2021 09:49:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504180; bh=yHeNw5XrD0xJO+tRISAzog9L/HQZ5m3hnns6KRmPw9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MwlOq91A+2CPwz9nKw8eS+Ue7vDMIQ9bs9YWZkF2rpM3HOiDqsWm8OfPJoFKv34Zt /vLpjcbxDk84lyZuhlwUdAYkJ7nPs4x8swYaNuvetf4/uNzrLpOrHt8ZYPd2b9Cg2O NM4S3lNM5vzbmZqnL8yXxFTYX5ve2wKP1kVt9G18= 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.14 127/323] drm/radeon: fix copy of uninitialized variable back to userspace Date: Thu, 20 May 2021 11:20:19 +0200 Message-Id: <20210520092124.463608385@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 @@ -531,6 +531,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: