[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220123215606.fzycryooluavtar4@liuwe-devbox-debian-v2>
Date: Sun, 23 Jan 2022 21:56:06 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Haiyang Zhang <haiyangz@...rosoft.com>
Cc: "Michael Kelley (LINUX)" <mikelley@...rosoft.com>,
KY Srinivasan <kys@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
"wei.liu@...nel.org" <wei.liu@...nel.org>,
Wei Hu <weh@...rosoft.com>, Dexuan Cui <decui@...rosoft.com>,
"drawat.floss@...il.com" <drawat.floss@...il.com>,
hhei <hhei@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"linux-fbdev@...r.kernel.org" <linux-fbdev@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH 1/1] video: hyperv_fb: Fix validation of screen resolution
On Sun, Jan 16, 2022 at 09:53:06PM +0000, Haiyang Zhang wrote:
>
>
> > -----Original Message-----
> > From: Michael Kelley (LINUX) <mikelley@...rosoft.com>
> > Sent: Sunday, January 16, 2022 2:19 PM
> > To: KY Srinivasan <kys@...rosoft.com>; Haiyang Zhang <haiyangz@...rosoft.com>; Stephen
> > Hemminger <sthemmin@...rosoft.com>; wei.liu@...nel.org; Wei Hu <weh@...rosoft.com>; Dexuan
> > Cui <decui@...rosoft.com>; drawat.floss@...il.com; hhei <hhei@...hat.com>; linux-
> > kernel@...r.kernel.org; linux-hyperv@...r.kernel.org; linux-fbdev@...r.kernel.org; dri-
> > devel@...ts.freedesktop.org
> > Cc: Michael Kelley (LINUX) <mikelley@...rosoft.com>
> > Subject: [PATCH 1/1] video: hyperv_fb: Fix validation of screen resolution
> >
> > In the WIN10 version of the Synthetic Video protocol with Hyper-V,
> > Hyper-V reports a list of supported resolutions as part of the protocol
> > negotiation. The driver calculates the maximum width and height from
> > the list of resolutions, and uses those maximums to validate any screen
> > resolution specified in the video= option on the kernel boot line.
> >
> > This method of validation is incorrect. For example, the list of
> > supported resolutions could contain 1600x1200 and 1920x1080, both of
> > which fit in an 8 Mbyte frame buffer. But calculating the max width
> > and height yields 1920 and 1200, and 1920x1200 resolution does not fit
> > in an 8 Mbyte frame buffer. Unfortunately, this resolution is accepted,
> > causing a kernel fault when the driver accesses memory outside the
> > frame buffer.
> >
> > Instead, validate the specified screen resolution by calculating
> > its size, and comparing against the frame buffer size. Delete the
> > code for calculating the max width and height from the list of
> > resolutions, since these max values have no use. Also add the
> > frame buffer size to the info message to aid in understanding why
> > a resolution might be rejected.
> >
> > Fixes: 67e7cdb4829d ("video: hyperv: hyperv_fb: Obtain screen resolution from Hyper-V
> > host")
> > Signed-off-by: Michael Kelley <mikelley@...rosoft.com>
[...]
>
> Reviewed-by: Haiyang Zhang <haiyangz@...rosoft.com>
>
Applied to hyperv-fixes. Thanks.
Powered by blists - more mailing lists