Index: src/trusted/service_runtime/sel_main.c |
=================================================================== |
--- src/trusted/service_runtime/sel_main.c (revision 6725) |
+++ src/trusted/service_runtime/sel_main.c (working copy) |
@@ -163,7 +163,7 @@ |
struct NaClApp *nap; |
struct GioFile gout; |
- NaClErrorCode errcode; |
+ NaClErrorCode errcode = LOAD_INTERNAL; |
struct GioMemoryFileSnapshot blob_file; |
int ret_code; |
@@ -856,6 +856,17 @@ |
PrintVmmap(nap); |
fflush(stdout); |
} |
+ /* |
+ * If there is a secure command channel, we sent an RPC reply with |
+ * the reason that the nexe was rejected. If we exit now, that |
+ * reply may still be in-flight and the various channel closure (esp |
+ * reverse channel) may be detected first. This would result in a |
+ * crash being reported, rather than the error in the RPC reply. |
+ * Instead, we wait for the hard-shutdown on the command channel. |
+ */ |
+ if (LOAD_OK != errcode) { |
+ NaClBlockIfCommandChannelExists(nap); |
+ } |
done_file_dtor: |
if (verbosity > 0) { |