pan/decode: Add static bounds checking utility
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 19 Aug 2019 22:14:48 +0000 (15:14 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 21 Aug 2019 15:40:53 +0000 (08:40 -0700)
commit4391c65f105fc1efcd7ead9f12c552dc21dce4bf
treef6b783b860da9ced2583554c60726cc4ae01abf8
parent9dfbc8dc03d2339c7deac0c1c44fe1968b402d4a
pan/decode: Add static bounds checking utility

Many structures in the command stream have a GPU address and size
determined statically. We should check that the pointers we are passed
are valid and the buffers they point to are big enough for the given
size. If they're not, an MMU fault would be raised.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/pandecode/decode.c