libipt, image: validate an image section

Validate that a given section would be returned by an image lookup.

This allows image users who want to cache image sections provided by
pt_image_find() to check if their cached section would still be returned by
another call to pt_image_find().

For performance reasons we allow sporadic validation fails.  They will require
the user to re-fetch the cached section with another call to pt_image_find(),
which causes a small loss of performance but is otherwise harmless.

Change-Id: I674e08969c2a29dc41e289b0faec1f5d09f27175
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
3 files changed