mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-11-13 11:45:58 +08:00
fix(isolation): harden runtime boundary controls
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
This commit is contained in:
@@ -193,6 +193,7 @@ pub fn prepare(sandbox_tgid: u32) -> io::Result<ChildHardeningProgram> {
|
||||
for syscall in [
|
||||
libc::SYS_prlimit64,
|
||||
libc::SYS_sched_setaffinity,
|
||||
libc::SYS_sched_setattr,
|
||||
libc::SYS_sched_setparam,
|
||||
libc::SYS_sched_setscheduler,
|
||||
] {
|
||||
@@ -418,6 +419,18 @@ mod tests {
|
||||
{
|
||||
unsafe { libc::_exit(5) };
|
||||
}
|
||||
if unsafe {
|
||||
libc::syscall(
|
||||
libc::SYS_sched_setattr,
|
||||
sandbox_tgid,
|
||||
std::ptr::null::<libc::c_void>(),
|
||||
0,
|
||||
)
|
||||
} != -1
|
||||
|| io::Error::last_os_error().raw_os_error() != Some(libc::EPERM)
|
||||
{
|
||||
unsafe { libc::_exit(11) };
|
||||
}
|
||||
if unsafe { libc::fcntl(libc::STDIN_FILENO, libc::F_SETOWN, sandbox_tgid) } != -1
|
||||
|| io::Error::last_os_error().raw_os_error() != Some(libc::EPERM)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user