Linux kernel -stable discussions
 help / color / mirror / Atom feed
* Re: [PATCH 1/1] video: fbdev: fix divide error in fbcon_switch
       [not found] ` <ad87c5c1-061d-8a81-7b2c-43a8687a464f@suse.de>
@ 2020-10-26 17:00   ` Saeed Mirzamohammadi
  2020-10-27  6:22     ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Saeed Mirzamohammadi @ 2020-10-26 17:00 UTC (permalink / raw)
  To: stable
  Cc: Thomas Zimmermann, linux-kernel, linux-fbdev, b.zolnierkie,
	jani.nikula, daniel.vetter, gustavoars, dri-devel, akpm, rppt

Thanks, adding stable.

Saeed

> On Oct 22, 2020, at 12:34 AM, Thomas Zimmermann <tzimmermann@suse.de> wrote:
> 
> Hi
> 
> On 22.10.20 01:57, saeed.mirzamohammadi@oracle.com wrote:
>> From: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
>> 
>> This patch fixes the issue due to:
>> 
>> [   89.572883] divide_error: 0000 [#1] SMP KASAN PTI
>> [   89.572897] CPU: 3 PID: 16083 Comm: repro Not tainted 5.9.0-rc7.20200930.rc1.allarch-19-g3e32d0d.syzk #5
>> [   89.572902] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.5.1 01/01/2011
>> [   89.572934] RIP: 0010:cirrusfb_check_var+0x84/0x1260
> 
> BTW, if you run qemu with cirrus, there's also a DRM driver named
> cirrus.ko. Might be a better choice than the old fbdev driver. If you
> just care about qemu, but not the actual graphics device, take a look at
> 
>  https://urldefense.com/v3/__https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful/__;!!GqivPVa7Brio!LmgeM-pVBVH80uVELF1P1nBGAbAlhvnxKKE_ZrEc9d76AznvAAgP1FAp3_zNa2frKaIUZteK$ 
> 
> Anyway, thanks for your patch.
> 
> Best regards
> Thomas
> 
>> 
>> The error happens when the pixels value is calculated before performing the sanity checks on bits_per_pixel.
>> A bits_per_pixel set to zero causes divide by zero error.
>> 
>> This patch moves the calculation after the sanity check.
>> 
>> Signed-off-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
>> Tested-by: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
>> ---
>> drivers/video/fbdev/cirrusfb.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/video/fbdev/cirrusfb.c b/drivers/video/fbdev/cirrusfb.c
>> index 15a9ee7cd734..a7749101b094 100644
>> --- a/drivers/video/fbdev/cirrusfb.c
>> +++ b/drivers/video/fbdev/cirrusfb.c
>> @@ -531,7 +531,7 @@ static int cirrusfb_check_var(struct fb_var_screeninfo *var,
>> {
>> 	int yres;
>> 	/* memory size in pixels */
>> -	unsigned pixels = info->screen_size * 8 / var->bits_per_pixel;
>> +	unsigned int pixels;
>> 	struct cirrusfb_info *cinfo = info->par;
>> 
>> 	switch (var->bits_per_pixel) {
>> @@ -573,6 +573,7 @@ static int cirrusfb_check_var(struct fb_var_screeninfo *var,
>> 		return -EINVAL;
>> 	}
>> 
>> +	pixels = info->screen_size * 8 / var->bits_per_pixel;
>> 	if (var->xres_virtual < var->xres)
>> 		var->xres_virtual = var->xres;
>> 	/* use highest possible virtual resolution */
>> 
> 
> -- 
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Software Solutions Germany GmbH
> Maxfeldstr. 5, 90409 Nürnberg, Germany
> (HRB 36809, AG Nürnberg)
> Geschäftsführer: Felix Imendörffer


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] video: fbdev: fix divide error in fbcon_switch
  2020-10-26 17:00   ` [PATCH 1/1] video: fbdev: fix divide error in fbcon_switch Saeed Mirzamohammadi
@ 2020-10-27  6:22     ` Greg KH
       [not found]       ` <2DA9AE6D-93D6-4142-9FC4-EEACB92B7203@oracle.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2020-10-27  6:22 UTC (permalink / raw)
  To: Saeed Mirzamohammadi
  Cc: stable, Thomas Zimmermann, linux-kernel, linux-fbdev,
	b.zolnierkie, jani.nikula, daniel.vetter, gustavoars, dri-devel,
	akpm, rppt

On Mon, Oct 26, 2020 at 10:00:11AM -0700, Saeed Mirzamohammadi wrote:
> Thanks, adding stable.

Why?  What are we supposed to do with this?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] video: fbdev: fix divide error in fbcon_switch
       [not found]       ` <2DA9AE6D-93D6-4142-9FC4-EEACB92B7203@oracle.com>
@ 2020-10-29 11:03         ` Greg KH
  2020-10-29 11:13           ` Jani Nikula
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2020-10-29 11:03 UTC (permalink / raw)
  To: Saeed Mirzamohammadi
  Cc: stable, Thomas Zimmermann, linux-kernel, linux-fbdev,
	b.zolnierkie, jani.nikula, daniel.vetter, gustavoars, dri-devel,
	akpm, rppt

On Tue, Oct 27, 2020 at 10:12:49AM -0700, Saeed Mirzamohammadi wrote:
> Hi Greg,
> 
> Sorry for the confusion. I’m requesting stable maintainers to cherry-pick this patch into stable 5.4 and 5.8.
> commit cc07057c7c88fb8eff3b1991131ded0f0bcfa7e3
> Author: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
> Date:   Wed Oct 21 16:57:58 2020 -0700
> 
>     video: fbdev: fix divide error in fbcon_switch

I do not see that commit in Linus's tree, do you?

confused,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] video: fbdev: fix divide error in fbcon_switch
  2020-10-29 11:03         ` Greg KH
@ 2020-10-29 11:13           ` Jani Nikula
  2020-10-29 11:30             ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2020-10-29 11:13 UTC (permalink / raw)
  To: Greg KH, Saeed Mirzamohammadi
  Cc: linux-fbdev, b.zolnierkie, daniel.vetter, linux-kernel, stable,
	gustavoars, dri-devel, Thomas Zimmermann, akpm, rppt

On Thu, 29 Oct 2020, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Tue, Oct 27, 2020 at 10:12:49AM -0700, Saeed Mirzamohammadi wrote:
>> Hi Greg,
>> 
>> Sorry for the confusion. I’m requesting stable maintainers to cherry-pick this patch into stable 5.4 and 5.8.
>> commit cc07057c7c88fb8eff3b1991131ded0f0bcfa7e3
>> Author: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
>> Date:   Wed Oct 21 16:57:58 2020 -0700
>> 
>>     video: fbdev: fix divide error in fbcon_switch
>
> I do not see that commit in Linus's tree, do you?

It's in drm-misc-next, IIUC heading for Linus' tree in the next merge
window in 6-8 weeks. Which is to say this should probably have been
applied to drm-misc-fixes branch heading for v5.10-rcX, with a Cc:
stable tag, to begin with.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] video: fbdev: fix divide error in fbcon_switch
  2020-10-29 11:13           ` Jani Nikula
@ 2020-10-29 11:30             ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2020-10-29 11:30 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Saeed Mirzamohammadi, linux-fbdev, b.zolnierkie, daniel.vetter,
	linux-kernel, stable, gustavoars, dri-devel, Thomas Zimmermann,
	akpm, rppt

On Thu, Oct 29, 2020 at 01:13:01PM +0200, Jani Nikula wrote:
> On Thu, 29 Oct 2020, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Tue, Oct 27, 2020 at 10:12:49AM -0700, Saeed Mirzamohammadi wrote:
> >> Hi Greg,
> >> 
> >> Sorry for the confusion. I’m requesting stable maintainers to cherry-pick this patch into stable 5.4 and 5.8.
> >> commit cc07057c7c88fb8eff3b1991131ded0f0bcfa7e3
> >> Author: Saeed Mirzamohammadi <saeed.mirzamohammadi@oracle.com>
> >> Date:   Wed Oct 21 16:57:58 2020 -0700
> >> 
> >>     video: fbdev: fix divide error in fbcon_switch
> >
> > I do not see that commit in Linus's tree, do you?
> 
> It's in drm-misc-next, IIUC heading for Linus' tree in the next merge
> window in 6-8 weeks. Which is to say this should probably have been
> applied to drm-misc-fixes branch heading for v5.10-rcX, with a Cc:
> stable tag, to begin with.

Ok, nothing I can do with this now, please email stable@vger.kernel.org
when it hits Linus's tree and we can take it then.

Saeed, please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-29 11:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20201021235758.59993-1-saeed.mirzamohammadi@oracle.com>
     [not found] ` <ad87c5c1-061d-8a81-7b2c-43a8687a464f@suse.de>
2020-10-26 17:00   ` [PATCH 1/1] video: fbdev: fix divide error in fbcon_switch Saeed Mirzamohammadi
2020-10-27  6:22     ` Greg KH
     [not found]       ` <2DA9AE6D-93D6-4142-9FC4-EEACB92B7203@oracle.com>
2020-10-29 11:03         ` Greg KH
2020-10-29 11:13           ` Jani Nikula
2020-10-29 11:30             ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox