bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: video mem access with oskit-mach


From: Roland McGrath
Subject: Re: video mem access with oskit-mach
Date: Mon, 10 Dec 2001 22:17:49 -0500 (EST)

I checked in some ds_mem.c changes that should robustify vs overflow.
Please try it out.

As to that special_mem_device call, I'm not sure exactly what I was
thinking.  The comment makes sense, but the code doesn't match.  It looks
like libstore uses size_t in place of dev_status_t, and so it will widen
without sign extension and not cause a problem any more.  But you still
can't accurately represent it with a block size of 1, because the size of
4GB wraps around to 0.  The code that would match this comment is:

 ~(vm_offset_t)0 - 3, 4,

But I think it would work as well now to use:

 ~(vm_offset_t)0, 1,

and this should let you try to access every address but the last byte.
The ds_mem_map code explicitly lets you address the final partial page, 
so this should not be a problem in practice.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]