[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMhUBjmm6ADp2Fr89CCQNX5FnhmBBrwFE0EQ3sq7CLER0J3ZEg@mail.gmail.com>
Date: Fri, 8 Apr 2022 09:58:10 +0800
From: Zheyu Ma <zheyuma97@...il.com>
To: Helge Deller <deller@....de>
Cc: Linux Fbdev development list <linux-fbdev@...r.kernel.org>,
DRI Development <dri-devel@...ts.freedesktop.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/7] video: fbdev: i740fb: Error out if 'pixclock' equals zero
On Fri, Apr 8, 2022 at 3:50 AM Helge Deller <deller@....de> wrote:
>
> On 4/4/22 10:47, Zheyu Ma wrote:
> > The userspace program could pass any values to the driver through
> > ioctl() interface. If the driver doesn't check the value of 'pixclock',
> > it may cause divide error.
> >
> > Fix this by checking whether 'pixclock' is zero in the function
> > i740fb_check_var().
> >
> > The following log reveals it:
> >
> > divide error: 0000 [#1] PREEMPT SMP KASAN PTI
> > RIP: 0010:i740fb_decode_var drivers/video/fbdev/i740fb.c:444 [inline]
> > RIP: 0010:i740fb_set_par+0x272f/0x3bb0 drivers/video/fbdev/i740fb.c:739
> > Call Trace:
> > fb_set_var+0x604/0xeb0 drivers/video/fbdev/core/fbmem.c:1036
> > do_fb_ioctl+0x234/0x670 drivers/video/fbdev/core/fbmem.c:1112
> > fb_ioctl+0xdd/0x130 drivers/video/fbdev/core/fbmem.c:1191
> > vfs_ioctl fs/ioctl.c:51 [inline]
> > __do_sys_ioctl fs/ioctl.c:874 [inline]
> >
> > Signed-off-by: Zheyu Ma <zheyuma97@...il.com>
>
> Hello Zheyu,
>
> I've applied the patches #2-#7 of this series, but left
> out this specific patch (for now).
> As discussed on the mailing list we can try to come up with a
> better fix (to round up the pixclock when it's invalid).
> If not, I will apply this one later.
I'm also looking forward to a more appropriate patch for this driver!
Thanks,
Zheyu Ma
Powered by blists - more mailing lists