File tree Expand file tree Collapse file tree 2 files changed +13
-23
lines changed Expand file tree Collapse file tree 2 files changed +13
-23
lines changed Original file line number Diff line number Diff line change 77#![ feature( compiler_builtins) ]
88#![ feature( core_intrinsics) ]
99#![ feature( linkage) ]
10+ #![ feature( asm_cfg) ]
1011#![ feature( naked_functions) ]
1112#![ feature( repr_simd) ]
1213#![ feature( macro_metavar_expr_concat) ]
Original file line number Diff line number Diff line change 5858#[ unsafe( naked) ]
5959#[ rustc_std_internal_symbol]
6060pub unsafe extern "custom" fn __rust_probestack ( ) {
61- #[ cfg( not( all( target_env = "sgx" , target_vendor = "fortanix" ) ) ) ]
62- macro_rules! ret {
63- ( ) => {
64- "ret"
65- } ;
66- }
67-
68- #[ cfg( all( target_env = "sgx" , target_vendor = "fortanix" ) ) ]
69- macro_rules! ret {
70- // for this target, [manually patch for LVI].
71- //
72- // [manually patch for LVI]: https://software.intel.com/security-software-guidance/insights/deep-dive-load-value-injection#specialinstructions
73- ( ) => {
74- "
75- pop %r11
76- lfence
77- jmp *%r11
78- "
79- } ;
80- }
81-
8261 core:: arch:: naked_asm!(
8362 "
8463 .cfi_startproc
@@ -128,8 +107,18 @@ pub unsafe extern "custom" fn __rust_probestack() {
128107 .cfi_def_cfa_register %rsp
129108 .cfi_adjust_cfa_offset -8
130109 " ,
131- ret!( ) ,
132- "
110+ #[ cfg( not( all( target_env = "sgx" , target_vendor = "fortanix" ) ) ) ]
111+ " ret" ,
112+ #[ cfg( all( target_env = "sgx" , target_vendor = "fortanix" ) ) ]
113+ "
114+ // for this target, [manually patch for LVI].
115+ //
116+ // [manually patch for LVI]: https://software.intel.com/security-software-guidance/insights/deep-dive-load-value-injection#specialinstructions
117+ pop %r11
118+ lfence
119+ jmp *%r11
120+ " ,
121+ "
133122 .cfi_endproc
134123 " ,
135124 options( att_syntax)
You can’t perform that action at this time.
0 commit comments