From d350ae4d96f11566fe2857eceaecd196d286d05b Mon Sep 17 00:00:00 2001 From: Stefano Garzarella Date: Mon, 16 Dec 2024 16:37:24 +0100 Subject: [PATCH] kernel/protocols/vtpm: add missing safety comment Add SAFETY comment around `from_raw_parts_mut()` call. Signed-off-by: Stefano Garzarella --- kernel/src/protocols/vtpm.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/src/protocols/vtpm.rs b/kernel/src/protocols/vtpm.rs index 66333cfb9..05dd80435 100644 --- a/kernel/src/protocols/vtpm.rs +++ b/kernel/src/protocols/vtpm.rs @@ -239,6 +239,7 @@ fn vtpm_command_request(params: &RequestParams) -> Result<(), SvsmReqError> { return Err(SvsmReqError::unsupported_call()); } + // SAFETY: vaddr is just mapped, and its size is PAGE_SIZE let buffer = unsafe { from_raw_parts_mut(vaddr.as_mut_ptr::(), PAGE_SIZE) }; let response_size = match cmd {