[Mesa-dev] [PATCH] llvmpipe: fix possible constant buffer overflow

Brian Paul brianp at vmware.com
Thu Jan 16 08:27:35 PST 2014


On 01/15/2014 06:09 PM, Zack Rusin wrote:
> It's possible to bind a smaller buffer as a constant buffer, than
> what the shader actually uses/requires. This could cause nasty
> crashes. This patch adds the architecture to pass the maximum
> allowable constant buffer index to the jit to let it make
> sure that the constant buffer indices are always within bounds.
> The behavior follows the d3d10 spec, which says the overflow
> should always return all zeros, and overflow is only defined
> as access beyond the size of the currently bound buffer. Accesses
> beyond the declared shader constant register size are not
> considered an overflow and expected to return garbage but consistent
> garbage (we follow the behavior which some wlk tests expect which
> is to return the actual values from the bound buffer).
>
> Signed-off-by: Zack Rusin <zackr at vmware.com>

My only suggestion is the subject line.  How about "llvmpipe: do 
constant buffer bounds checking in shaders"?  I tend to think of 
overflow as an issue when writing, not reading.

Not a big deal though.  Nice work!

-Brian



More information about the mesa-dev mailing list