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

Side by Side Diff: src/trusted/validator_arm/model.h

Issue 11361222: ARM validator: fix sandbox escape with SP update at the end of the last bundle (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H
8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H
9 9
10 /* 10 /*
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 // The number of bits in a word of a THUMB instruction. 279 // The number of bits in a word of a THUMB instruction.
280 static const int kThumbWordSize = 16; 280 static const int kThumbWordSize = 16;
281 281
282 // Special ARM instructions for sandboxing. 282 // Special ARM instructions for sandboxing.
283 static const uint32_t kLiteralPoolHead = NACL_INSTR_ARM_LITERAL_POOL_HEAD; 283 static const uint32_t kLiteralPoolHead = NACL_INSTR_ARM_LITERAL_POOL_HEAD;
284 static const uint32_t kBreakpoint = NACL_INSTR_ARM_BREAKPOINT; 284 static const uint32_t kBreakpoint = NACL_INSTR_ARM_BREAKPOINT;
285 static const uint32_t kHaltFill = NACL_INSTR_ARM_HALT_FILL; 285 static const uint32_t kHaltFill = NACL_INSTR_ARM_HALT_FILL;
286 static const uint32_t kAbortNow = NACL_INSTR_ARM_ABORT_NOW; 286 static const uint32_t kAbortNow = NACL_INSTR_ARM_ABORT_NOW;
287 static const uint32_t kFailValidation = NACL_INSTR_ARM_FAIL_VALIDATION; 287 static const uint32_t kFailValidation = NACL_INSTR_ARM_FAIL_VALIDATION;
288 288
289 // Not-so-special instructions.
290 static const uint32_t kNop = NACL_INSTR_ARM_NOP;
Mark Seaborn 2012/11/13 00:30:18 Would it make sense for the code to refer to NACL_
JF 2012/11/13 00:49:42 It's following the pattern above of having validat
291
289 // Models an instruction, either a 32-bit ARM instruction of unspecified type, 292 // Models an instruction, either a 32-bit ARM instruction of unspecified type,
290 // or one word (16-bit) and two word (32-bit) THUMB instructions. 293 // or one word (16-bit) and two word (32-bit) THUMB instructions.
291 // 294 //
292 // This class is designed for efficiency: 295 // This class is designed for efficiency:
293 // - Its public methods for bitfield extraction are short and inline. 296 // - Its public methods for bitfield extraction are short and inline.
294 // - It has no vtable, so on 32-bit platforms it's exactly the size of the 297 // - It has no vtable, so on 32-bit platforms it's exactly the size of the
295 // instruction it models. 298 // instruction it models.
296 // - API's exist for accessing both ARM (32-bit) instructions and 299 // - API's exist for accessing both ARM (32-bit) instructions and
297 // THUMB instructions (which are 1 or two (16-bit) words). 300 // THUMB instructions (which are 1 or two (16-bit) words).
298 class Instruction { 301 class Instruction {
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 } 520 }
518 521
519 private: 522 private:
520 uint32_t bits_; 523 uint32_t bits_;
521 Instruction& operator=(const Instruction& insn); // Disallow assignment. 524 Instruction& operator=(const Instruction& insn); // Disallow assignment.
522 }; 525 };
523 526
524 } // namespace nacl_arm_dec 527 } // namespace nacl_arm_dec
525 528
526 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H 529 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_V2_MODEL_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698