| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008, Google Inc. | 2 * Copyright 2008, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 /* | 32 /* |
| 33 * NaCl Secure Runtime | 33 * NaCl Secure Runtime |
| 34 */ | 34 */ |
| 35 | 35 |
| 36 #include "native_client/src/trusted/service_runtime/nacl_config.h" | 36 #include "native_client/src/trusted/service_runtime/nacl_config.h" |
| 37 | 37 |
| 38 .text | 38 .text |
| 39 .globl IDENTIFIER(NaClSwitch) | 39 .globl IDENTIFIER(NaClSwitch) |
| 40 HIDDEN(NaClSwitch) |
| 40 IDENTIFIER(NaClSwitch): | 41 IDENTIFIER(NaClSwitch): |
| 41 popl %eax /* throw away the return addr */ | 42 popl %eax /* throw away the return addr */ |
| 42 | 43 |
| 43 /* do not leak info to app */ | 44 /* do not leak info to app */ |
| 44 xorl %ecx, %ecx | 45 xorl %ecx, %ecx |
| 45 /* xorl will leave eflags in a known state, so no info leaks */ | 46 /* xorl will leave eflags in a known state, so no info leaks */ |
| 46 popl %ecx | 47 popl %ecx |
| 47 movl 0x30(%ecx), %edx /* new_eip */ | 48 movl 0x30(%ecx), %edx /* new_eip */ |
| 48 movl 0x14(%ecx), %ebp /* frame_ptr.ptr_32.ptr */ | 49 movl 0x14(%ecx), %ebp /* frame_ptr.ptr_32.ptr */ |
| 49 movl 0x8(%ecx), %edi /* edi */ | 50 movl 0x8(%ecx), %edi /* edi */ |
| 50 movl 0x4(%ecx), %esi /* esi */ | 51 movl 0x4(%ecx), %esi /* esi */ |
| 51 movl 0(%ecx), %ebx /* ebx */ | 52 movl 0(%ecx), %ebx /* ebx */ |
| 52 | 53 |
| 53 mov 0x2e(%ecx), %gs /* gs */ | 54 mov 0x2e(%ecx), %gs /* gs */ |
| 54 mov 0x2c(%ecx), %fs /* fs */ | 55 mov 0x2c(%ecx), %fs /* fs */ |
| 55 mov 0x2a(%ecx), %es /* es */ | 56 mov 0x2a(%ecx), %es /* es */ |
| 56 | 57 |
| 57 ljmp *0x38(%ecx) /* springboard address */ | 58 ljmp *0x38(%ecx) /* springboard address */ |
| OLD | NEW |