Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(923)

Unified Diff: src/trusted/validator_ragel/dfa_validate_32.c

Issue 1234393005: A mechanism to identify/forbid/"rewrite" non-temporal instructions (and other) (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Fixing nits Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/trusted/validator_ragel/dfa_validate_32.c
diff --git a/src/trusted/validator_ragel/dfa_validate_32.c b/src/trusted/validator_ragel/dfa_validate_32.c
index 1c02ccd25563172af3e9f051ee7ed1d7d319d8be..bdbe510a5745417d872ceb43a56ff5b50317dd13 100644
--- a/src/trusted/validator_ragel/dfa_validate_32.c
+++ b/src/trusted/validator_ragel/dfa_validate_32.c
@@ -30,6 +30,7 @@ NaClValidationStatus ApplyDfaValidator_x86_32(
uint8_t *data,
size_t size,
int stubout_mode,
+ uint32_t flags,
int readonly_text,
const NaClCPUFeatures *f,
const struct NaClValidationMetadata *metadata,
@@ -37,8 +38,10 @@ NaClValidationStatus ApplyDfaValidator_x86_32(
/* TODO(jfb) Use a safe cast here. */
NaClCPUFeaturesX86 *cpu_features = (NaClCPUFeaturesX86 *) f;
enum NaClValidationStatus status = NaClValidationFailed;
- int did_stubout = 0;
void *query = NULL;
+ struct StubOutCallbackData callback_data;
+ callback_data.flags = flags;
+ callback_data.did_rewrite = 0;
UNREFERENCED_PARAMETER(guest_addr);
if (stubout_mode)
@@ -72,8 +75,8 @@ NaClValidationStatus ApplyDfaValidator_x86_32(
status = NaClValidationSucceeded;
} else {
if (ValidateChunkIA32(data, size, 0 /*options*/, cpu_features,
- NaClDfaStubOutCPUUnsupportedInstruction,
- &did_stubout))
+ NaClDfaStubOutUnsupportedInstruction,
+ &callback_data))
status = NaClValidationSucceeded;
}
if (status != NaClValidationSucceeded && errno == ENOMEM)
@@ -81,7 +84,7 @@ NaClValidationStatus ApplyDfaValidator_x86_32(
/* Cache the result if validation succeeded and the code was not modified. */
if (query != NULL) {
- if (status == NaClValidationSucceeded && did_stubout == 0)
+ if (status == NaClValidationSucceeded && callback_data.did_rewrite == 0)
cache->SetKnownToValidate(query);
cache->DestroyQuery(query);
}

Powered by Google App Engine
This is Rietveld 408576698