Index: ppapi/native_client/src/untrusted/pnacl_irt_shim/shim_ppapi.c |
diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/shim_ppapi.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/shim_ppapi.c |
index 27f6ee7e5a96781de41140f80b8536dac0a78f00..5e111c14c0db63056967fdd3e4335ba80db7ee87 100644 |
--- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/shim_ppapi.c |
+++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/shim_ppapi.c |
@@ -7,88 +7,17 @@ |
#include "ppapi/native_client/src/untrusted/pnacl_irt_shim/shim_ppapi.h" |
#include <string.h> |
-#include "native_client/src/include/nacl_macros.h" |
#include "native_client/src/untrusted/irt/irt.h" |
-#include "native_client/src/untrusted/irt/irt_dev.h" |
#include "ppapi/nacl_irt/irt_ppapi.h" |
#include "ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h" |
#include "ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.h" |
-/* |
- * This is a whitelist of NaCl IRT interfaces that are exposed under |
- * PNaCl. This list omits the following: |
- * |
- * * The old versions of "irt-memory", v0.1 and v0.2, which contain |
- * the deprecated sysbrk() function. See: |
- * https://code.google.com/p/nativeclient/issues/detail?id=3542 |
- * |
- * * "irt-mutex", "irt-cond" and "irt-sem", which are deprecated and |
- * are superseded by the "irt-futex" interface. See: |
- * https://code.google.com/p/nativeclient/issues/detail?id=3484 |
- * |
- * * "irt-dyncode", which is not supported under PNaCl because |
- * dynamically loading architecture-specific native code is not |
- * portable. |
- * |
- * * "irt-exception-handling", which is not supported under PNaCl |
- * because it exposes non-portable, architecture-specific register |
- * state. See: |
- * https://code.google.com/p/nativeclient/issues/detail?id=3444 |
- * |
- * * "irt-blockhook", which is deprecated. It was provided for |
- * implementing thread suspension for conservative garbage |
- * collection, but this is probably not a portable use case under |
- * PNaCl, so this interface is disabled under PNaCl. See: |
- * https://code.google.com/p/nativeclient/issues/detail?id=3539 |
- * |
- * * "irt-resource-open". This was primarily provided for use by |
- * nacl-glibc's dynamic linker, which is not supported under PNaCl. |
- * open_resource() returns a file descriptor, but it is the only |
- * interface in NaCl to do so inside Chromium. This is |
- * inconsistent with PPAPI, which does not expose file descriptors |
- * (except in private/dev interfaces). See: |
- * https://code.google.com/p/nativeclient/issues/detail?id=3574 |
- * |
- * * "irt-fdio" and "irt-filename". Under PNaCl, where |
- * open_resource() open is disallowed, these are only useful for |
- * debugging. They are only allowed via the "dev" query strings; |
- * the non-"dev" query strings are disallowed. |
- * |
- * We omit these because they are only "dev" interfaces: |
- * |
- * * "irt-dev-getpid" |
- * * "irt-dev-list-mappings" |
- */ |
-static const char *const irt_interface_whitelist[] = { |
- NACL_IRT_BASIC_v0_1, |
- NACL_IRT_MEMORY_v0_3, |
- NACL_IRT_THREAD_v0_1, |
- NACL_IRT_FUTEX_v0_1, |
- NACL_IRT_TLS_v0_1, |
- NACL_IRT_PPAPIHOOK_v0_1, |
- NACL_IRT_RANDOM_v0_1, |
- NACL_IRT_CLOCK_v0_1, |
- /* Allowed for debugging purposes: */ |
- NACL_IRT_DEV_FDIO_v0_1, |
- NACL_IRT_DEV_FILENAME_v0_2, |
-}; |
- |
/* Use local strcmp to avoid dependency on libc. */ |
static int mystrcmp(const char* s1, const char *s2) { |
while((*s1 && *s2) && (*s1++ == *s2++)); |
return *(--s1) - *(--s2); |
} |
-static int is_irt_interface_whitelisted(const char *interface_name) { |
- int i; |
- for (i = 0; i < NACL_ARRAY_SIZE(irt_interface_whitelist); i++) { |
- if (mystrcmp(interface_name, irt_interface_whitelist[i]) == 0) { |
- return 1; |
- } |
- } |
- return 0; |
-} |
- |
TYPE_nacl_irt_query __pnacl_real_irt_interface = NULL; |
/* |
@@ -139,9 +68,6 @@ static int wrap_ppapi_start(const struct PP_StartFunctions *funcs) { |
size_t __pnacl_irt_interface_wrapper(const char *interface_ident, |
void *table, size_t tablesize) { |
- if (!is_irt_interface_whitelisted(interface_ident)) |
- return 0; |
- |
/* |
* Note there is a benign race in initializing the wrapper. |
* We build the "hook" structure by copying from the IRT's hook and then |