linux: Provide dummy seccomp(2)

Don't emit messages; this isn't any different from a Linux kernel
built without OPTIONS_SECCOMP, so the userspace already needs to know
how to deal with it.  This is also similar with how we handle seccomp
in linux_prctl().

Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D33808
This commit is contained in:
Edward Tomasz Napierala 2022-01-28 10:55:11 +00:00
parent 612d42e5dc
commit 99454d3e98
3 changed files with 19 additions and 2 deletions

View File

@ -112,8 +112,6 @@ DUMMY(kcmp);
DUMMY(finit_module);
DUMMY(sched_setattr);
DUMMY(sched_getattr);
/* Linux 3.17: */
DUMMY(seccomp);
/* Linux 3.18: */
DUMMY(bpf);
/* Linux 3.19: */

View File

@ -2880,3 +2880,19 @@ linux_poll(struct thread *td, struct linux_poll_args *args)
tsp, NULL, 0));
}
#endif /* __i386__ || __amd64__ */
int
linux_seccomp(struct thread *td, struct linux_seccomp_args *args)
{
switch (args->op) {
case LINUX_SECCOMP_GET_ACTION_AVAIL:
return (EOPNOTSUPP);
default:
/*
* Ignore unknown operations, just like Linux kernel built
* without CONFIG_SECCOMP.
*/
return (EINVAL);
}
}

View File

@ -153,6 +153,9 @@ extern int stclohz;
/* Linux syslog flags */
#define LINUX_SYSLOG_ACTION_READ_ALL 3
/* Linux seccomp flags */
#define LINUX_SECCOMP_GET_ACTION_AVAIL 2
#if defined(__aarch64__) || (defined(__amd64__) && !defined(COMPAT_LINUX32))
int linux_ptrace_status(struct thread *td, int pid, int status);
#endif