kernel: log unknown syscall numbers before returning ENOSYS
Added println! to the syscall dispatch catch-all to log the unknown syscall number and arguments when returning ENOSYS. Previously any unrecognized syscall number silently returned ENOSYS with no diagnostic, making it impossible to discover missing syscall implementations without application-level debugging. Found by comprehensive disguised-stub audit (47 patterns, 37 actionable). This is the most impactful remaining fix from that audit.
This commit is contained in:
+4
-1
@@ -276,7 +276,10 @@ pub fn syscall(
|
||||
SYS_MPROTECT => mprotect(b, c, MapFlags::from_bits_truncate(d), token).map(|()| 0),
|
||||
SYS_MREMAP => mremap(b, c, d, e, f, token),
|
||||
|
||||
_ => Err(Error::new(ENOSYS)),
|
||||
_ => {
|
||||
println!("KERNEL: unimplemented syscall a={:#x} b={:#x} c={:#x} d={:#x}", a, b, c, d);
|
||||
Err(Error::new(ENOSYS))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user