Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp710813pxv; Thu, 15 Jul 2021 14:08:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZtApA3UtvGcipC4x5gI3uIkzDJ8iN8/R/QU0VR7nP+PZ3OkT1L1WUVyOin484LMyY20Hg X-Received: by 2002:a17:907:3d86:: with SMTP id he6mr7747384ejc.440.1626383303939; Thu, 15 Jul 2021 14:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383303; cv=none; d=google.com; s=arc-20160816; b=NeLGFDG2Z7FSQq2ZwrCV0F8TPH/S9dkZEQ2N8h/ymK9bgS+8P00afFbPl0w9c28nb5 m20frQNzZTJt5tVMhdIbjuYpNcAMcgBeX1W0pshx6JQ03RwenMYgZwzlqQPIXQsyA4fy NJK9F3CSCt1WWtGCB3O6kiIXU28Jw3ejChdSYQdA7WITzjRohGUXFFYSWffmrGywWetu 1KXrIx+UYSg4BZRwquzcUMhCWHLarE+/Yiv0IKIHxWqyZrsJvvfT3iTSOk6kMiEAnLOC iumavNg2c1onWkyjJxT51DBukRFGw+j9GVsNu5eVyySjk2Z1TmBf2veOlYjZJZLdhTQJ TAqA== 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=WJHkNAXfp/EB9wjnef3kqkjGnUB5u8wcF/wE/mTdDw4=; b=KqFYEXT823UtsqkNYHavvHDeR8jtufzU+CkHbUtnisdWzkNfRRgF7pKRE0PwZGnfzK x2gMMkZr3a8CUMR6zyf4WXEAsVdEU5v1prZSekC9tLjBydR0mN43gu4+KtJiRfmcQngl Lf82tXfJn3a+AKG18cw7W4BayRYFsedmVhnOS4W0FrGPEXmUYQJ/nF6kUrmOwANllUoZ CnAFx1yujEbeapJRknjw2KYyCgwnI+MCp2/l8acwFfsiKibeFFSTPKDTrAmPO1xm3pFM v6cWLc2AC4GgLwIBaMFfr+oU95NE+hKbMbcizWlKMLl5P52reWMtC9ax03TxQHrMnf08 efHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="pqhk1yP/"; 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 v16si8791579edy.327.2021.07.15.14.08.00; Thu, 15 Jul 2021 14:08:23 -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="pqhk1yP/"; 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 S245514AbhGOTTv (ORCPT + 99 others); Thu, 15 Jul 2021 15:19:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:39764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241861AbhGOTEp (ORCPT ); Thu, 15 Jul 2021 15:04:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D805061412; Thu, 15 Jul 2021 19:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375661; bh=ttQVaGB8SboQmHsifcEZIS+k4cOHnitcuUdP62zEDuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pqhk1yP/z+bbIMiD0meOqRMicw3DO6ccUQT/IM2b1U9bagbbZB0BURr7IDTbjL60N pn+LQ0ejy1ShMbUwKGL/Wdrroh6EQKNZZrQpbU3PnZjJNzA5E2vIMvPiEUP3xrwAMe WmuM2yyeiI4qrIz1zxtfLZyv1QCGlzdUprmJ/n3I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= , Rodrigo Vivi Subject: [PATCH 5.12 182/242] drm/i915/display: Do not zero past infoframes.vsc Date: Thu, 15 Jul 2021 20:39:04 +0200 Message-Id: <20210715182625.355413881@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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: Kees Cook commit 07b72960d2b4a087ff2445e286159e69742069cc upstream. intel_dp_vsc_sdp_unpack() was using a memset() size (36, struct dp_sdp) larger than the destination (24, struct drm_dp_vsc_sdp), clobbering fields in struct intel_crtc_state after infoframes.vsc. Use the actual target size for the memset(). Fixes: 1b404b7dbb10 ("drm/i915/dp: Read out DP SDPs") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: José Roberto de Souza Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20210617213301.1824728-1-keescook@chromium.org (cherry picked from commit c88e2647c5bb45d04dc4302018ebe6ebbf331823) Signed-off-by: Rodrigo Vivi Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -3913,7 +3913,7 @@ static int intel_dp_vsc_sdp_unpack(struc if (size < sizeof(struct dp_sdp)) return -EINVAL; - memset(vsc, 0, size); + memset(vsc, 0, sizeof(*vsc)); if (sdp->sdp_header.HB0 != 0) return -EINVAL;