param test: x86-32: use ip-relative addressing for RSEQ_INJECT_ASM
[librseq.git] / tests / disable-rseq-syscall.c
CommitLineData
01bd794d
MJ
1// SPDX-License-Identifier: MIT
2// SPDX-FileCopyrightText: 2024 Michael Jeanson <mjeanson@efficios.com>
3
4#include <errno.h>
5#include <seccomp.h>
6
7/*
8 * Library constructor.
9 *
10 * Apply a seccomp policy that blocks access to the rseq syscall and returns
11 * ENOSYS.
12 */
13static __attribute__((constructor))
14void disable_rseq_syscall(void)
15{
16 scmp_filter_ctx ctx;
17
18 ctx = seccomp_init(SCMP_ACT_ALLOW);
19 seccomp_rule_add(ctx, SCMP_ACT_ERRNO(ENOSYS), SCMP_SYS(rseq), 0);
20 seccomp_load(ctx);
21}
This page took 0.023264 seconds and 4 git commands to generate.