File tree Expand file tree Collapse file tree 3 files changed +11
-19
lines changed Expand file tree Collapse file tree 3 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -65,10 +65,6 @@ IMAGE_BASE:
6565 /* The size in bytes of enclacve EH_FRM_HDR section */
6666 globvar EH_FRM_HDR_SIZE 8
6767
68- .Lreentry_panic_msg:
69- .asciz "Re-entered aborted enclave!"
70- .Lreentry_panic_msg_end:
71-
7268.org .Lxsave_clear+512
7369.Lxsave_header:
7470 .int 0 , 0 /* XSTATE_BV */
@@ -210,10 +206,8 @@ sgx_entry:
210206/* end sgx_entry */
211207
212208.Lreentry_panic:
213- lea .Lreentry_panic_msg(%rip ),%rdi
214- mov $.Lreentry_panic_msg_end-.Lreentry_panic_msg,%esi
215209 orq $8 ,%rsp
216- jmp panic_msg
210+ jmp abort_reentry
217211
218212/* This *MUST* be called with 6 parameters, otherwise register information */
219213/* might leak! */
@@ -279,10 +273,8 @@ usercall:
279273/*
280274The following functions need to be defined externally:
281275```
282- // Called by entry code when it needs to panic
283- extern "C" fn panic_msg(msg: &'static str) -> ! {
284- panic!(msg)
285- }
276+ // Called by entry code on re-entry after exit
277+ extern "C" fn abort_reentry() -> !;
286278
287279// Called once when a TCS is first entered
288280extern "C" fn tcs_init(secondary: bool);
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ unsafe extern "C" fn tcs_init(secondary: bool) {
2929 static RELOC_STATE : AtomicUsize = AtomicUsize :: new ( UNINIT ) ;
3030
3131 if secondary && RELOC_STATE . load ( Ordering :: Relaxed ) != DONE {
32- panic :: panic_msg ( "Entered secondary TCS before main TCS!" )
32+ rtabort ! ( "Entered secondary TCS before main TCS!" )
3333 }
3434
3535 // Try to atomically swap UNINIT with BUSY. The returned state can be:
@@ -92,3 +92,9 @@ pub(super) fn exit_with_code(code: isize) -> ! {
9292 }
9393 usercalls:: exit ( code != 0 ) ;
9494}
95+
96+ #[ cfg( not( test) ) ]
97+ #[ no_mangle]
98+ extern "C" fn abort_reentry ( ) -> ! {
99+ usercalls:: exit ( false )
100+ }
Original file line number Diff line number Diff line change 1- use super :: usercalls:: { alloc:: UserRef , self } ;
1+ use super :: usercalls:: alloc:: UserRef ;
22use crate :: cmp;
33use crate :: io:: { self , Write } ;
44use crate :: mem;
@@ -48,9 +48,3 @@ impl Write for SgxPanicOutput {
4848 Ok ( ( ) )
4949 }
5050}
51-
52- #[ cfg_attr( not( test) , no_mangle) ]
53- pub extern "C" fn panic_msg ( msg : & str ) -> ! {
54- let _ = SgxPanicOutput :: new ( ) . map ( |mut out| out. write ( msg. as_bytes ( ) ) ) ;
55- usercalls:: exit ( true )
56- }
You can’t perform that action at this time.
0 commit comments