Skip to content

Commit 412c3d2

Browse files
committed
refactor(seccomp): replace deprecated prctl with syscall
According to https://www.man7.org/linux/man-pages/man2/PR_SET_SECCOMP.2const.html using `prctl` for setting seccomp filer is deprecated, so switch to using `syscall` instead. Signed-off-by: Egor Lazarchuk <[email protected]>
1 parent fd45366 commit 412c3d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vmm/src/seccomp.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ pub fn apply_filter(bpf_filter: BpfProgramRef) -> Result<(), InstallationError>
114114
};
115115
let bpf_prog_ptr = &bpf_prog as *const SockFprog;
116116
{
117-
let rc = libc::prctl(
118-
libc::PR_SET_SECCOMP,
119-
libc::SECCOMP_MODE_FILTER,
117+
let rc = libc::syscall(
118+
libc::SYS_seccomp,
119+
libc::SECCOMP_SET_MODE_FILTER,
120+
0,
120121
bpf_prog_ptr,
121122
);
122123
if rc != 0 {

0 commit comments

Comments
 (0)