Re: FBdev: Signal 11 when setting pixels ca. 5 > xdim/ydim

Search this archive.

From: Chris Purnell (cjp@lost.org.uk)
Date: Sun 18 Mar 2001 - 06:36:22 IST


On Fri, Mar 16, 2001 at 06:31:03AM -0600, Burkhard Kohl wrote:

> I have a couple of applications which generate some pixels far 
> outside xdim/ydim. When running vith VESA this is no problem, 
> vga_setpixel handles these properly. But with FBdev my applications
> receive a signal 11, which I believe is not the proper behaviour.
> I am running a VESA FBdev with Mode 23 (1024x768x32K) on a Riva128
> based card (kernel 2.2.18) and svgalib-1.9.7.

I think you mean vga_drawpixel.  vga_drawpixel() does no bounds
checking on the x/y values.  This is not normally fatal because
of the paged access of the memory on the vga cards.  However the
fbdev driver emulates this paged memory.  The crash occurs because
fbdev_setpage() has no bounds checking.

The following patch should make the fbdev driver better emulate
the behaviour of the other drivers.

--- fbdev.c.orig	Sun Mar 18 03:49:32 2001
+++ fbdev.c	Sun Mar 18 04:09:39 2001
@@ -124,6 +124,8 @@
 {
 	static int oldpage = 0;
 
+	page &= (fbdev_startaddressrange >> 16);
+
 	if (page != oldpage)
 	{
 //		munmap(BANKED_MEM_POINTER, __svgalib_banked_mem_size);

-- 
Christopher John Purnell  | I thought I'd found a reason to live
http://www.lost.org.uk/   | Just like before when I was a child
--------------------------| Only to find that dreams made of sand
What gods do you pray to? | Would just fall apart and slip through my hands

------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST