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

Side by Side Diff: src/trusted/service_runtime/sel_main.c

Issue 3539011: Enable check for DEP / NX page protection (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Modify windows check to use Noel's signal interface Created 10 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
« no previous file with comments | « src/trusted/service_runtime/sel_ldr.c ('k') | src/trusted/service_runtime/sel_main_chrome.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The Native Client Authors. All rights reserved. 2 * Copyright 2008 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can 3 * Use of this source code is governed by a BSD-style license that can
4 * be found in the LICENSE file. 4 * be found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * NaCl Simple/secure ELF loader (NaCl SEL). 8 * NaCl Simple/secure ELF loader (NaCl SEL).
9 */ 9 */
10 #include "native_client/src/include/portability.h" 10 #include "native_client/src/include/portability.h"
(...skipping 10 matching lines...) Expand all
21 #include <malloc.h> 21 #include <malloc.h>
22 #endif 22 #endif
23 23
24 #include "native_client/src/shared/gio/gio.h" 24 #include "native_client/src/shared/gio/gio.h"
25 #include "native_client/src/shared/imc/nacl_imc_c.h" 25 #include "native_client/src/shared/imc/nacl_imc_c.h"
26 #include "native_client/src/shared/platform/nacl_log.h" 26 #include "native_client/src/shared/platform/nacl_log.h"
27 #include "native_client/src/shared/platform/nacl_sync.h" 27 #include "native_client/src/shared/platform/nacl_sync.h"
28 #include "native_client/src/shared/platform/nacl_sync_checked.h" 28 #include "native_client/src/shared/platform/nacl_sync_checked.h"
29 #include "native_client/src/shared/srpc/nacl_srpc.h" 29 #include "native_client/src/shared/srpc/nacl_srpc.h"
30 30
31 #include "native_client/src/trusted/platform_qualify/nacl_dep_qualify.h"
31 #include "native_client/src/trusted/platform_qualify/nacl_os_qualify.h" 32 #include "native_client/src/trusted/platform_qualify/nacl_os_qualify.h"
32 33
33 #ifdef NACL_BREAKPAD 34 #ifdef NACL_BREAKPAD
34 #include "native_client/src/trusted/nacl_breakpad/nacl_breakpad.h" 35 #include "native_client/src/trusted/nacl_breakpad/nacl_breakpad.h"
35 #endif 36 #endif
36 #include "native_client/src/trusted/service_runtime/env_cleanser.h" 37 #include "native_client/src/trusted/service_runtime/env_cleanser.h"
37 #include "native_client/src/trusted/service_runtime/nacl_app.h" 38 #include "native_client/src/trusted/service_runtime/nacl_app.h"
38 #include "native_client/src/trusted/service_runtime/nacl_all_modules.h" 39 #include "native_client/src/trusted/service_runtime/nacl_all_modules.h"
39 #include "native_client/src/trusted/service_runtime/nacl_config_dangerous.h" 40 #include "native_client/src/trusted/service_runtime/nacl_config_dangerous.h"
40 #include "native_client/src/trusted/service_runtime/nacl_debug.h" 41 #include "native_client/src/trusted/service_runtime/nacl_debug.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 * Ensure this operating system platform is supported. 444 * Ensure this operating system platform is supported.
444 */ 445 */
445 if (!skip_qualification && !NaClOsIsSupported()) { 446 if (!skip_qualification && !NaClOsIsSupported()) {
446 errcode = LOAD_UNSUPPORTED_OS_PLATFORM; 447 errcode = LOAD_UNSUPPORTED_OS_PLATFORM;
447 nap->module_load_status = errcode; 448 nap->module_load_status = errcode;
448 fprintf(stderr, "Error while loading \"%s\": %s\n", 449 fprintf(stderr, "Error while loading \"%s\": %s\n",
449 nacl_file, 450 nacl_file,
450 NaClErrorString(errcode)); 451 NaClErrorString(errcode));
451 } 452 }
452 453
454 /*
455 * Ensure this platform has Data Execution Prevention enabled.
456 */
457 if (!skip_qualification && !NaClCheckDEP()) {
458 errcode = LOAD_DEP_UNSUPPORTED;
459 nap->module_load_status = errcode;
460 fprintf(stderr, "Error while loading \"%s\": %s\n",
461 nacl_file,
462 NaClErrorString(errcode));
463 }
464
453 if (LOAD_OK == errcode) { 465 if (LOAD_OK == errcode) {
454 errcode = NaClAppLoadFile((struct Gio *) &gf, nap, check_abi); 466 errcode = NaClAppLoadFile((struct Gio *) &gf, nap, check_abi);
455 if (LOAD_OK != errcode) { 467 if (LOAD_OK != errcode) {
456 nap->module_load_status = errcode; 468 nap->module_load_status = errcode;
457 fprintf(stderr, "Error while loading \"%s\": %s\n", 469 fprintf(stderr, "Error while loading \"%s\": %s\n",
458 nacl_file, 470 nacl_file,
459 NaClErrorString(errcode)); 471 NaClErrorString(errcode));
460 fprintf(stderr, 472 fprintf(stderr,
461 ("Using the wrong type of nexe (nacl-x86-32" 473 ("Using the wrong type of nexe (nacl-x86-32"
462 " on an x86-64 or vice versa)\n" 474 " on an x86-64 or vice versa)\n"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 printf("Done.\n"); 729 printf("Done.\n");
718 } 730 }
719 fflush(stdout); 731 fflush(stdout);
720 732
721 NaClAllModulesFini(); 733 NaClAllModulesFini();
722 734
723 WINDOWS_EXCEPTION_CATCH; 735 WINDOWS_EXCEPTION_CATCH;
724 736
725 _exit(ret_code); 737 _exit(ret_code);
726 } 738 }
OLDNEW
« no previous file with comments | « src/trusted/service_runtime/sel_ldr.c ('k') | src/trusted/service_runtime/sel_main_chrome.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698