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

Side by Side Diff: src/untrusted/irt/irt_interfaces.c

Issue 11141016: mprotect system call exposed to the untrusted code. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Bump the IRT memory interface version. Created 8 years, 2 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 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 #include <string.h> 7 #include <string.h>
8 8
9 #include "native_client/src/include/nacl_macros.h" 9 #include "native_client/src/include/nacl_macros.h"
10 #include "native_client/src/untrusted/irt/irt.h" 10 #include "native_client/src/untrusted/irt/irt.h"
11 #include "native_client/src/untrusted/irt/irt_interfaces.h" 11 #include "native_client/src/untrusted/irt/irt_interfaces.h"
12 12
13 struct nacl_interface_table { 13 struct nacl_interface_table {
14 const char *name; 14 const char *name;
15 const void *table; 15 const void *table;
16 size_t size; 16 size_t size;
17 }; 17 };
18 18
19 static const struct nacl_interface_table irt_interfaces[] = { 19 static const struct nacl_interface_table irt_interfaces[] = {
20 { NACL_IRT_BASIC_v0_1, &nacl_irt_basic, sizeof(nacl_irt_basic) }, 20 { NACL_IRT_BASIC_v0_1, &nacl_irt_basic, sizeof(nacl_irt_basic) },
21 { NACL_IRT_FDIO_v0_1, &nacl_irt_fdio, sizeof(nacl_irt_fdio) }, 21 { NACL_IRT_FDIO_v0_1, &nacl_irt_fdio, sizeof(nacl_irt_fdio) },
22 { NACL_IRT_FILENAME_v0_1, &nacl_irt_filename, sizeof(nacl_irt_filename) }, 22 { NACL_IRT_FILENAME_v0_1, &nacl_irt_filename, sizeof(nacl_irt_filename) },
23 { NACL_IRT_MEMORY_v0_1, &nacl_irt_memory, sizeof(nacl_irt_memory) }, 23 { NACL_IRT_MEMORY_v0_1, &nacl_irt_memory, sizeof(nacl_irt_memory) },
Mark Seaborn 2012/10/18 00:27:23 The fact that querying for v0_1 with an overly-lar
24 { NACL_IRT_MEMORY_v0_2, &nacl_irt_memory, sizeof(nacl_irt_memory) },
24 { NACL_IRT_DYNCODE_v0_1, &nacl_irt_dyncode, sizeof(nacl_irt_dyncode) }, 25 { NACL_IRT_DYNCODE_v0_1, &nacl_irt_dyncode, sizeof(nacl_irt_dyncode) },
25 { NACL_IRT_THREAD_v0_1, &nacl_irt_thread, sizeof(nacl_irt_thread) }, 26 { NACL_IRT_THREAD_v0_1, &nacl_irt_thread, sizeof(nacl_irt_thread) },
26 { NACL_IRT_MUTEX_v0_1, &nacl_irt_mutex, sizeof(nacl_irt_mutex) }, 27 { NACL_IRT_MUTEX_v0_1, &nacl_irt_mutex, sizeof(nacl_irt_mutex) },
27 { NACL_IRT_COND_v0_1, &nacl_irt_cond, sizeof(nacl_irt_cond) }, 28 { NACL_IRT_COND_v0_1, &nacl_irt_cond, sizeof(nacl_irt_cond) },
28 { NACL_IRT_SEM_v0_1, &nacl_irt_sem, sizeof(nacl_irt_sem) }, 29 { NACL_IRT_SEM_v0_1, &nacl_irt_sem, sizeof(nacl_irt_sem) },
29 { NACL_IRT_TLS_v0_1, &nacl_irt_tls, sizeof(nacl_irt_tls) }, 30 { NACL_IRT_TLS_v0_1, &nacl_irt_tls, sizeof(nacl_irt_tls) },
30 { NACL_IRT_BLOCKHOOK_v0_1, &nacl_irt_blockhook, sizeof(nacl_irt_blockhook) }, 31 { NACL_IRT_BLOCKHOOK_v0_1, &nacl_irt_blockhook, sizeof(nacl_irt_blockhook) },
31 { NACL_IRT_RESOURCE_OPEN_v0_1, &nacl_irt_resource_open, 32 { NACL_IRT_RESOURCE_OPEN_v0_1, &nacl_irt_resource_open,
32 sizeof(nacl_irt_resource_open) }, 33 sizeof(nacl_irt_resource_open) },
33 #ifdef IRT_PPAPI 34 #ifdef IRT_PPAPI
(...skipping 15 matching lines...) Expand all
49 const size_t size = irt_interfaces[i].size; 50 const size_t size = irt_interfaces[i].size;
50 if (size <= tablesize) { 51 if (size <= tablesize) {
51 memcpy(table, irt_interfaces[i].table, size); 52 memcpy(table, irt_interfaces[i].table, size);
52 return size; 53 return size;
53 } 54 }
54 break; 55 break;
55 } 56 }
56 } 57 }
57 return 0; 58 return 0;
58 } 59 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698