Always take syscall_head/tail into account during the integrity check

Previously it wouldn't be taken into account if currently used by the
kernel.
This commit is contained in:
bjorn3
2025-09-26 23:26:06 +02:00
parent ede9a47f9c
commit 4c85131e36
3 changed files with 62 additions and 44 deletions
+3 -2
View File
@@ -6,6 +6,7 @@ use spin::RwLock;
use crate::{
context::{
context::SyscallFrame,
memory::{AddrSpace, Grant, PageSpan},
ContextRef,
},
@@ -37,8 +38,8 @@ pub fn exit_this_context(excp: Option<syscall::Exception>, token: &mut CleanLock
addrspace_opt = context
.set_addr_space(None)
.and_then(|a| Arc::try_unwrap(a).ok());
drop(context.syscall_head.take());
drop(context.syscall_tail.take());
drop(mem::replace(&mut context.syscall_head, SyscallFrame::Dummy));
drop(mem::replace(&mut context.syscall_tail, SyscallFrame::Dummy));
}
// Files must be closed while context is valid so that messages can be passed