[PATCH V4 10/31] x86/sgx: Create utility to validate user provided offset and length