Skip to content

Commit

Permalink
refactor(seccomp): replace deprecated prctl with syscall
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
ShadowCurse committed Dec 6, 2024
1 parent fd45366 commit 412c3d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/vmm/src/seccomp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ pub fn apply_filter(bpf_filter: BpfProgramRef) -> Result<(), InstallationError>
};
let bpf_prog_ptr = &bpf_prog as *const SockFprog;
{
let rc = libc::prctl(
libc::PR_SET_SECCOMP,
libc::SECCOMP_MODE_FILTER,
let rc = libc::syscall(
libc::SYS_seccomp,
libc::SECCOMP_SET_MODE_FILTER,
0,
bpf_prog_ptr,
);
if rc != 0 {
Expand Down

0 comments on commit 412c3d2

Please sign in to comment.