Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 @ Copyright 2010 The Native Client Authors. All rights reserved. | |
|
bsy
2011/09/21 22:32:17
(c) 2011, be
jasonwkim
2011/09/26 21:35:52
done
| |
| 2 @ Use of this source code is governed by a BSD-style license that can | |
| 3 @ be found in the LICENSE file. | |
| 4 | |
| 5 .code 16 | |
| 6 .syntax unified | |
| 7 .globl _start | |
| 8 .thumb_func | |
| 9 _start: | |
| 10 @ Note: For some reason the start symbol does _NOT_ have the one bit set. | |
| 11 @ We test bundle-aligned and bundle-unaligned versions of jumps. | |
| 12 | |
| 13 @ Jump backwards to addresses that wrap around and have the top bit set. | |
| 14 @ Such destinations are outside the sandbox's address space and so | |
| 15 @ could be dangerous, although it's unlikely that anything is mapped | |
| 16 @ here in the range that an ARM jump instruction could reach. | |
| 17 b _start - 0x20000 @ disallowed | |
| 18 b _start - 0x20004 @ disallowed | |
| 19 | |
| 20 @ Jump backwards to the syscall trampoline page. | |
| 21 b _start - 0x8000 @ allowed | |
| 22 b _start - 0x73FC @ disallowed | |
| 23 b _start - 0x7fef @ allowed (16-aligned but not 32-aligned) | |
| 24 b _start - 0x7fdf @ allowed (32-aligned) | |
| 25 b _start - 0x7020 @ allowed | |
| 26 b _start - 0x1003 @ disallowed | |
| 27 | |
| 28 @ Jump forwards to addresses outside this chunk of code. | |
| 29 b _start + 0x1000 @ allowed | |
| 30 b _start + 0x1004 @ disallowed | |
| 31 | |
| 32 @ Jump forwards further. | |
| 33 b _start + 0x100000 @ allowed | |
| 34 b _start + 0x100004 @ disallowed | |
| 35 | |
| 36 @ Jump to zero page. | |
| 37 @ This is intended to be "b 0b111", but the assembler crashes if I write that. | |
| 38 @ Obviously this assumes that _start == 0x20000. | |
| 39 b _start - 0x10000 @ allowed (0b111) | |
| 40 b _start - 0x0fffc @ disallowed | |
| 41 | |
| 42 b end_of_code @ allowed | |
| 43 | |
| 44 end_of_code: | |
| 45 mov r0, r0 @ Necessary for jumping here to be legal (otherwise cs stops short, and umapped regions are treated like trampolines. | |
| OLD | NEW |