File tree 3 files changed +11
-19
lines changed
3 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -65,10 +65,6 @@ IMAGE_BASE:
65
65
/* The size in bytes of enclacve EH_FRM_HDR section */
66
66
globvar EH_FRM_HDR_SIZE 8
67
67
68
- .Lreentry_panic_msg:
69
- .asciz "Re-entered aborted enclave!"
70
- .Lreentry_panic_msg_end:
71
-
72
68
.org .Lxsave_clear+512
73
69
.Lxsave_header:
74
70
.int 0 , 0 /* XSTATE_BV */
@@ -210,10 +206,8 @@ sgx_entry:
210
206
/* end sgx_entry */
211
207
212
208
.Lreentry_panic:
213
- lea .Lreentry_panic_msg(%rip ),%rdi
214
- mov $.Lreentry_panic_msg_end-.Lreentry_panic_msg,%esi
215
209
orq $8 ,%rsp
216
- jmp panic_msg
210
+ jmp abort_reentry
217
211
218
212
/* This *MUST* be called with 6 parameters, otherwise register information */
219
213
/* might leak! */
@@ -279,10 +273,8 @@ usercall:
279
273
/*
280
274
The following functions need to be defined externally:
281
275
```
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() -> !;
286
278
287
279
// Called once when a TCS is first entered
288
280
extern "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) {
29
29
static RELOC_STATE : AtomicUsize = AtomicUsize :: new ( UNINIT ) ;
30
30
31
31
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!" )
33
33
}
34
34
35
35
// Try to atomically swap UNINIT with BUSY. The returned state can be:
@@ -92,3 +92,9 @@ pub(super) fn exit_with_code(code: isize) -> ! {
92
92
}
93
93
usercalls:: exit ( code != 0 ) ;
94
94
}
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 ;
2
2
use crate :: cmp;
3
3
use crate :: io:: { self , Write } ;
4
4
use crate :: mem;
@@ -48,9 +48,3 @@ impl Write for SgxPanicOutput {
48
48
Ok ( ( ) )
49
49
}
50
50
}
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