From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68574101C0 for ; Mon, 15 May 2023 17:52:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3D9EC433D2; Mon, 15 May 2023 17:52:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684173178; bh=EAhqY54xVuv/AzRcxMobKGeeZIMQy3G4RrmuBodxlYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QVIZANZ2D1qkYqu58JNivi80O1W/hTGmwi8Vc8/wZgE+Y7pRkI/g5HKB5/dgOCRWA +R9QpbCBFPwYzzY/iBFDhdzpTi7nndqVO+zdlnbLHAvrxwoRhCaFEyR7PcSjZ8xK65 0E7oCS7of4bq8ybm/KJ4udATFBFtbcOAJ83252d4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+20dcf81733d43ddff661@syzkaller.appspotmail.com, Daniel Vetter , Javier Martinez Canillas , Thomas Zimmermann , Daniel Vetter Subject: [PATCH 5.4 003/282] drm/fb-helper: set x/yres_virtual in drm_fb_helper_check_var Date: Mon, 15 May 2023 18:26:21 +0200 Message-Id: <20230515161722.263543624@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515161722.146344674@linuxfoundation.org> References: <20230515161722.146344674@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Daniel Vetter commit 1935f0deb6116dd785ea64d8035eab0ff441255b upstream. Drivers are supposed to fix this up if needed if they don't outright reject it. Uncovered by 6c11df58fd1a ("fbmem: Check virtual screen sizes in fb_set_var()"). Reported-by: syzbot+20dcf81733d43ddff661@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?id=c5faf983bfa4a607de530cd3bb008888bf06cefc Cc: stable@vger.kernel.org # v5.4+ Cc: Daniel Vetter Cc: Javier Martinez Canillas Cc: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20230404194038.472803-1-daniel.vetter@ffwll.ch Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_fb_helper.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1340,6 +1340,9 @@ int drm_fb_helper_check_var(struct fb_va return -EINVAL; } + var->xres_virtual = fb->width; + var->yres_virtual = fb->height; + /* * Workaround for SDL 1.2, which is known to be setting all pixel format * fields values to zero in some cases. We treat this situation as a