Chromium Code Reviews| Index: src/trusted/service_runtime/sel_validate_image.c |
| diff --git a/src/trusted/service_runtime/sel_validate_image.c b/src/trusted/service_runtime/sel_validate_image.c |
| index b08b2312a7743f7bb6d9be7fc24563e15e79c010..f02418a42322eb2d54b31b673108284c709f267c 100644 |
| --- a/src/trusted/service_runtime/sel_validate_image.c |
| +++ b/src/trusted/service_runtime/sel_validate_image.c |
| @@ -29,7 +29,12 @@ int NaClValidateCode(struct NaClApp *nap, uintptr_t guest_addr, |
| uint8_t *data, size_t size) { |
| NaClValidationStatus status = NaClValidationSucceeded; |
| enum NaClSBKind sb_kind = NACL_SB_DEFAULT; |
| + |
| + NaClValidationCache *cache = nap->validation_cache; |
| + |
| if (nap->validator_stub_out_mode) { |
| + /* Validation caching is currently incompatible with stubout. */ |
|
Mark Seaborn
2012/03/01 00:26:20
Technically, the second pass is not incompatible.
Nick Bray (chromium)
2012/03/01 01:25:16
Based on future plans, validating code twice witho
|
| + cache = NULL; |
| /* In stub out mode, we do two passes. The second pass acts as a |
| sanity check that bad instructions were indeed overwritten with |
| allowable HLTs. */ |
| @@ -39,7 +44,8 @@ int NaClValidateCode(struct NaClApp *nap, uintptr_t guest_addr, |
| sb_kind, |
| NaClApplyValidationDoStubout, |
| guest_addr, data, size, |
| - nap->bundle_size, &nap->cpu_features); |
| + nap->bundle_size, &nap->cpu_features, |
| + cache); |
| } |
| if (status == NaClValidationSucceeded) { |
| status = NACL_SUBARCH_NAME(ApplyValidator, |
| @@ -48,7 +54,8 @@ int NaClValidateCode(struct NaClApp *nap, uintptr_t guest_addr, |
| sb_kind, |
| NaClApplyCodeValidation, |
| guest_addr, data, size, |
| - nap->bundle_size, &nap->cpu_features); |
| + nap->bundle_size, &nap->cpu_features, |
| + cache); |
| } |
| return NaClValidateStatus(status); |
| } |