Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4688048pxj; Tue, 8 Jun 2021 22:32:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/1LzGHGnjw5e2RBBu3F62CprNCKTMyTi4izUZYfytDeZZfX5h+DNjWCnITLtn/AmrybJV X-Received: by 2002:a17:906:ccd9:: with SMTP id ot25mr26676903ejb.386.1623216747565; Tue, 08 Jun 2021 22:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623216747; cv=none; d=google.com; s=arc-20160816; b=vBPBZugSFlzHTk1K3Ez2TgrPfnCkf1PW+l9ptZD+s92IfEcjieFTtuW3VYI6+ZnJwL 62w6mhggW1c8eY18gqsocDFagoJAU7U4pLEIm3Db154nF8GLYgR9dus9z6qYscmRFmPu k+YHC1GBc5Mc1S6uYU9dBcXUQ3voeDFQ7VTQtgqBoRKYZFigaQy3NwmATcjxgXbidQ0t IxIz7VF52LlkF5+zRW+2k3KvcYmF9whgUaIvOXtBk6+KKY1iSJ9hdqMh77A/pJiin9UA raHm+SaJ4geYNMMkG/m4pD0O0FhQ4tgy+K13EaC0pSgLGCcSYYlXGmWHFB3uMA7agfpp DB4w== 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 :message-id:date:subject:cc:to:from; bh=EWsJNMIobPfsEtbCDYNSKdDCaIgqib0KiNJWbnd+CWQ=; b=R7EgUwNXjZbpo2mMUisiqbGUq9EK41LClHVFhbtvKDIdxkrxE0war83VPWa1Bqr3af ct8P3JHMKdLt35B7anfiedmgtK/gCw1H94hAOdm/Jyby9BplXzPwu1+XeHJWZsLTvHmY w6GLO4+vbPgM/FHwmG3W936CObFfeAPo1PZOiN7HzTnkaEQ307IhfWVPBEyakbKNI0c9 /YYryx7z/7eXk3QIcu6Lsx8VapAiPbshLfiUx+NYqVsPJelgRQAMk6+Wax+04jKJmJEJ RVcpbHMfdP5prNppqYXtJ2bW9qU+LW+mTueggc3D/iXN2vN/NfQYO5dzB76D37MbP3nn 1+3w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h1si1787419ejo.462.2021.06.08.22.32.02; Tue, 08 Jun 2021 22:32:27 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232298AbhFHQPL (ORCPT + 99 others); Tue, 8 Jun 2021 12:15:11 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:40083 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229724AbhFHQPK (ORCPT ); Tue, 8 Jun 2021 12:15:10 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lqeLp-0000zO-PA; Tue, 08 Jun 2021 16:13:13 +0000 From: Colin King To: Dave Airlie , Gerd Hoffmann , Daniel Vetter , Alon Levy , virtualization@lists.linux-foundation.org, spice-devel@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm: qxl: ensure surf.data is ininitialized Date: Tue, 8 Jun 2021 17:13:13 +0100 Message-Id: <20210608161313.161922-1-colin.king@canonical.com> X-Mailer: git-send-email 2.31.1 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 The object surf is not fully initialized and the uninitialized field surf.data is being copied by the call to qxl_bo_create via the call to qxl_gem_object_create. Set surf.data to zero to ensure garbage data from the stack is not being copied. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: f64122c1f6ad ("drm: add new QXL driver. (v1.4)") Signed-off-by: Colin Ian King --- drivers/gpu/drm/qxl/qxl_dumb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_dumb.c b/drivers/gpu/drm/qxl/qxl_dumb.c index a635d9fdf8ac..d636ba685451 100644 --- a/drivers/gpu/drm/qxl/qxl_dumb.c +++ b/drivers/gpu/drm/qxl/qxl_dumb.c @@ -58,6 +58,8 @@ int qxl_mode_dumb_create(struct drm_file *file_priv, surf.height = args->height; surf.stride = pitch; surf.format = format; + surf.data = 0; + r = qxl_gem_object_create_with_handle(qdev, file_priv, QXL_GEM_DOMAIN_CPU, args->size, &surf, &qobj, -- 2.31.1