Thread exception channel shouldn't get the process

This commit is contained in:
Ben Pig Chu 2020-07-15 01:07:14 +08:00
parent e9cdd14e79
commit d133237224
2 changed files with 4 additions and 1 deletions

View File

@ -166,7 +166,7 @@ pub enum ExceptionType {
}
#[repr(u32)]
#[derive(Copy, Clone)]
#[derive(Copy, Clone,PartialEq)]
pub enum ExceptionChannelType {
None = 0,
Debugger = 1,

View File

@ -73,6 +73,9 @@ impl Syscall<'_> {
let proc = self.thread.proc();
let exception =
proc.get_object_with_rights::<ExceptionObject>(exception, Rights::default())?;
if exception.get_exception().get_current_channel_type() == ExceptionChannelType::Thread {
return Err(ZxError::ACCESS_DENIED)
}
let (object, right) = exception.get_exception().get_process_and_rights();
let handle = proc.add_handle(Handle::new(object, right));
out.write(handle)?;