Skip to content

Commit cc6e244

Browse files
committed
[guest/{security_cookie,security_check,entrypoint,lib}] remove usage of __security_cookie symbol
The __security_cookie symbol and its usage were only required by the MSVC toolchain. W/ the removal of PE support, we can remove it from the guest lib. Signed-off-by: danbugs <[email protected]>
1 parent 0eb5afa commit cc6e244

File tree

4 files changed

+1
-46
lines changed

4 files changed

+1
-46
lines changed

src/hyperlight_guest/src/entrypoint.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use crate::exceptions::{gdt::load_gdt, idtr::load_idt};
2727
use crate::guest_function_call::dispatch_function;
2828
use crate::guest_logger::init_logger;
2929
use crate::host_function_call::outb;
30-
use crate::{__security_cookie, HEAP_ALLOCATOR, MIN_STACK_ADDRESS, OS_PAGE_SIZE, P_PEB};
30+
use crate::{HEAP_ALLOCATOR, MIN_STACK_ADDRESS, OS_PAGE_SIZE, P_PEB};
3131

3232
#[inline(never)]
3333
pub fn halt() {
@@ -85,7 +85,6 @@ pub extern "C" fn entrypoint(peb_address: u64, seed: u64, ops: u64, max_log_leve
8585
unsafe {
8686
P_PEB = Some(peb_address as *mut HyperlightPEB);
8787
let peb_ptr = P_PEB.unwrap();
88-
__security_cookie = peb_address ^ seed;
8988

9089
let srand_seed = ((peb_address << 8 ^ seed >> 4) >> 32) as u32;
9190

src/hyperlight_guest/src/guest_error.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ pub(crate) fn set_error(error_code: ErrorCode, message: &str) {
4040
write_error(error_code, Some(message));
4141
}
4242

43-
pub(crate) fn set_error_and_halt(error_code: ErrorCode, message: &str) {
44-
set_error(error_code, message);
45-
halt();
46-
}
47-
4843
/// Exposes a C API to allow the guest to set an error
4944
///
5045
/// # Safety

src/hyperlight_guest/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ pub mod host_function_call;
4141
pub(crate) mod guest_logger;
4242
pub mod memory;
4343
pub mod print;
44-
pub(crate) mod security_check;
4544

4645
pub mod error;
4746
#[cfg(target_arch = "x86_64")]
@@ -74,11 +73,6 @@ fn panic(info: &core::panic::PanicInfo) -> ! {
7473
#[global_allocator]
7574
pub(crate) static HEAP_ALLOCATOR: LockedHeap<32> = LockedHeap::<32>::empty();
7675

77-
///cbindgen:ignore
78-
#[no_mangle]
79-
#[clippy::allow(clippy::non_upper_case_globals)]
80-
pub(crate) static mut __security_cookie: u64 = 0;
81-
8276
pub(crate) static mut P_PEB: Option<*mut HyperlightPEB> = None;
8377
pub static mut MIN_STACK_ADDRESS: u64 = 0;
8478

src/hyperlight_guest/src/security_check.rs

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)