mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-25 06:52:13 +00:00
agent: Ignore unknown seccomp system calls
If Kata agent cannot resolve the system calls given by seccomp profiles, the agent ignores the system calls and continues to run without an error. Fixes: #2957 Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
This commit is contained in:
parent
4be2c8b190
commit
c66b56683b
@ -68,7 +68,14 @@ pub fn init_seccomp(scmp: &LinuxSeccomp) -> Result<()> {
|
||||
}
|
||||
|
||||
for name in &syscall.names {
|
||||
let syscall_num = get_syscall_from_name(name, None)?;
|
||||
let syscall_num = match get_syscall_from_name(name, None) {
|
||||
Ok(num) => num,
|
||||
Err(_) => {
|
||||
// If we cannot resolve the given system call, we assume it is not supported
|
||||
// by the kernel. Hence, we skip it without generating an error.
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
if syscall.args.is_empty() {
|
||||
filter.add_rule(action, syscall_num, None)?;
|
||||
|
Loading…
Reference in New Issue
Block a user