Skip to content

Commit 66263bd

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 acee69f commit 66263bd

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
@@ -111,9 +111,10 @@ pub fn apply_filter(bpf_filter: BpfProgramRef) -> Result<(), InstallationError>
111111
};
112112
let bpf_prog_ptr = &bpf_prog as *const SockFprog;
113113
{
114-
let rc = libc::prctl(
115-
libc::PR_SET_SECCOMP,
116-
libc::SECCOMP_MODE_FILTER,
114+
let rc = libc::syscall(
115+
libc::SYS_seccomp,
116+
libc::SECCOMP_SET_MODE_FILTER,
117+
0,
117118
bpf_prog_ptr,
118119
);
119120
if rc != 0 {

0 commit comments

Comments
 (0)