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

Side by Side Diff: src/trusted/service_runtime/sel_ldr.h

Issue 10914138: Split secure command channel and untrusted application channel (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: CommandSetup SRPC call added to secure command service. 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 /* 7 /*
8 * NaCl Simple/secure ELF loader (NaCl SEL). 8 * NaCl Simple/secure ELF loader (NaCl SEL).
9 * 9 *
10 * This loader can only process NaCl object files as produced using 10 * This loader can only process NaCl object files as produced using
(...skipping 29 matching lines...) Expand all
40 #include "native_client/src/shared/srpc/nacl_srpc.h" 40 #include "native_client/src/shared/srpc/nacl_srpc.h"
41 41
42 #include "native_client/src/trusted/interval_multiset/nacl_interval_multiset.h" 42 #include "native_client/src/trusted/interval_multiset/nacl_interval_multiset.h"
43 #include "native_client/src/trusted/interval_multiset/nacl_interval_range_tree.h " 43 #include "native_client/src/trusted/interval_multiset/nacl_interval_range_tree.h "
44 44
45 #include "native_client/src/trusted/service_runtime/dyn_array.h" 45 #include "native_client/src/trusted/service_runtime/dyn_array.h"
46 #include "native_client/src/trusted/service_runtime/nacl_error_code.h" 46 #include "native_client/src/trusted/service_runtime/nacl_error_code.h"
47 #include "native_client/src/trusted/service_runtime/nacl_kernel_service.h" 47 #include "native_client/src/trusted/service_runtime/nacl_kernel_service.h"
48 #include "native_client/src/trusted/service_runtime/nacl_resource.h" 48 #include "native_client/src/trusted/service_runtime/nacl_resource.h"
49 49
50 #include "native_client/src/trusted/service_runtime/nacl_secure_service.h"
51
50 #include "native_client/src/trusted/service_runtime/sel_mem.h" 52 #include "native_client/src/trusted/service_runtime/sel_mem.h"
51 #include "native_client/src/trusted/service_runtime/sel_util.h" 53 #include "native_client/src/trusted/service_runtime/sel_util.h"
52 #include "native_client/src/trusted/service_runtime/sel_rt.h" 54 #include "native_client/src/trusted/service_runtime/sel_rt.h"
53 55
54 #include "native_client/src/trusted/service_runtime/name_service/name_service.h" 56 #include "native_client/src/trusted/service_runtime/name_service/name_service.h"
55 57
56 #include "native_client/src/trusted/validator/cpufeatures.h" 58 #include "native_client/src/trusted/validator/cpufeatures.h"
57 #include "native_client/src/trusted/validator/ncvalidate.h" 59 #include "native_client/src/trusted/validator/ncvalidate.h"
58 60
59 EXTERN_C_BEGIN 61 EXTERN_C_BEGIN
60 62
61 #define NACL_SERVICE_PORT_DESCRIPTOR 3 63 #define NACL_SERVICE_PORT_DESCRIPTOR 3
62 #define NACL_SERVICE_ADDRESS_DESCRIPTOR 4 64 #define NACL_SERVICE_ADDRESS_DESCRIPTOR 4
63 65
64 #define NACL_DEFAULT_STACK_MAX (16 << 20) /* main thread stack */ 66 #define NACL_DEFAULT_STACK_MAX (16 << 20) /* main thread stack */
65 67
66 #define NACL_SANDBOX_CHROOT_FD "SBX_D" 68 #define NACL_SANDBOX_CHROOT_FD "SBX_D"
67 69
68 struct NaClAppThread; 70 struct NaClAppThread;
69 struct NaClDesc; /* see native_client/src/trusted/desc/nacl_desc_base.h */ 71 struct NaClDesc; /* see native_client/src/trusted/desc/nacl_desc_base.h */
70 struct NaClDynamicRegion; 72 struct NaClDynamicRegion;
71 struct NaClManifestProxy; 73 struct NaClManifestProxy;
72 struct NaClReverseQuotaInterface; 74 struct NaClReverseQuotaInterface;
73 struct NaClSecureService;
74 struct NaClSecureReverseService;
75 struct NaClSignalContext; 75 struct NaClSignalContext;
76 struct NaClThreadInterface; /* see sel_ldr_thread_interface.h */ 76 struct NaClThreadInterface; /* see sel_ldr_thread_interface.h */
77 struct NaClValidationCache; 77 struct NaClValidationCache;
78 78
79 struct NaClDebugCallbacks { 79 struct NaClDebugCallbacks {
80 void (*thread_create_hook)(struct NaClAppThread *natp); 80 void (*thread_create_hook)(struct NaClAppThread *natp);
81 void (*thread_exit_hook)(struct NaClAppThread *natp); 81 void (*thread_exit_hook)(struct NaClAppThread *natp);
82 void (*process_exit_hook)(int exit_status); 82 void (*process_exit_hook)(int exit_status);
83 }; 83 };
84 84
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 * Name service must launch after mu, cv, vm_hole_may_exit, 239 * Name service must launch after mu, cv, vm_hole_may_exit,
240 * threads_launching are initialized. 240 * threads_launching are initialized.
241 */ 241 */
242 struct NaClNameService *name_service; /* default name server */ 242 struct NaClNameService *name_service; /* default name server */
243 struct NaClDesc *name_service_conn_cap; 243 struct NaClDesc *name_service_conn_cap;
244 244
245 struct NaClSecureService *secure_service; 245 struct NaClSecureService *secure_service;
246 struct NaClManifestProxy *manifest_proxy; 246 struct NaClManifestProxy *manifest_proxy;
247 struct NaClKernelService *kernel_service; 247 struct NaClKernelService *kernel_service;
248 248
249 int num_secure_channel;
250
249 struct NaClResourceNaClApp resources; 251 struct NaClResourceNaClApp resources;
250 enum NaClResourcePhase resource_phase; 252 enum NaClResourcePhase resource_phase;
251 253
252 struct NaClSecureReverseClient *reverse_client; 254 struct NaClSecureReverseClient *reverse_client;
253 enum NaClReverseChannelInitializationState { 255 enum NaClReverseChannelInitializationState {
254 NACL_REVERSE_CHANNEL_UNINITIALIZED, 256 NACL_REVERSE_CHANNEL_UNINITIALIZED,
255 NACL_REVERSE_CHANNEL_INITIALIZATION_STARTED, 257 NACL_REVERSE_CHANNEL_INITIALIZATION_STARTED,
256 NACL_REVERSE_CHANNEL_INITIALIZED 258 NACL_REVERSE_CHANNEL_INITIALIZED
257 } reverse_channel_initialization_state; 259 } reverse_channel_initialization_state;
258 struct NaClSrpcChannel reverse_channel; 260 struct NaClSrpcChannel reverse_channel;
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 596
595 void NaClAppDescriptorHookupCheck(struct NaClApp *nap); 597 void NaClAppDescriptorHookupCheck(struct NaClApp *nap);
596 598
597 void NaClCreateServiceSocket(struct NaClApp *nap); 599 void NaClCreateServiceSocket(struct NaClApp *nap);
598 600
599 void NaClSetUpBootstrapChannel(struct NaClApp *nap, 601 void NaClSetUpBootstrapChannel(struct NaClApp *nap,
600 NaClHandle inherited_desc); 602 NaClHandle inherited_desc);
601 603
602 void NaClSecureCommandChannel(struct NaClApp *nap); 604 void NaClSecureCommandChannel(struct NaClApp *nap);
603 605
604 int NaClSecureReverseClientInsertHandler( 606 void NaClSecureChannelCountIncr(struct NaClApp *nap);
605 struct NaClSecureReverseClient *self, 607
606 void (*handler)( 608 void NaClSecureChannelCountDecr(struct NaClApp *nap);
607 void *handler_state,
608 struct NaClThreadInterface *thread_if,
609 struct NaClDesc *new_conn),
610 void *handler_state) NACL_WUR;
611 609
612 NaClErrorCode NaClWaitForLoadModuleStatus(struct NaClApp *nap) NACL_WUR; 610 NaClErrorCode NaClWaitForLoadModuleStatus(struct NaClApp *nap) NACL_WUR;
613 611
614 NaClErrorCode NaClWaitForStartModuleCommand(struct NaClApp *nap) NACL_WUR; 612 NaClErrorCode NaClWaitForStartModuleCommand(struct NaClApp *nap) NACL_WUR;
615 613
616 /* 614 /*
617 * NaClBlockIfCommandChannelExists is used during error exit. If 615 * NaClBlockIfCommandChannelExists is used during error exit. If
618 * there is a secure command channel, we sent an RPC reply with the 616 * there is a secure command channel, we sent an RPC reply with the
619 * reason that the nexe was rejected. If we exit immediately, that 617 * reason that the nexe was rejected. If we exit immediately, that
620 * reply may still be in-flight and the various channel closure (esp 618 * reply may still be in-flight and the various channel closure (esp
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 UNREFERENCED_PARAMETER(argc_p); 785 UNREFERENCED_PARAMETER(argc_p);
788 UNREFERENCED_PARAMETER(argv_p); 786 UNREFERENCED_PARAMETER(argv_p);
789 } 787 }
790 #endif 788 #endif
791 789
792 int NaClPostTestInjectionMain(int argc, char **argv); 790 int NaClPostTestInjectionMain(int argc, char **argv);
793 791
794 EXTERN_C_END 792 EXTERN_C_END
795 793
796 #endif /* NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_SEL_LDR_H_ */ 794 #endif /* NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_SEL_LDR_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698