diff options
author | John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> | 2020-08-17 13:12:14 +0200 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2021-03-08 19:55:32 -0500 |
commit | c12945db0b7e32f409ba3a68d18c6d6f6dd22b19 (patch) | |
tree | d87fc7447552cc09a1fe385a2a27a604c7717419 /src/arch-sh.c | |
parent | 83d7b022fa7ef8c24516cc668efc879e5398403f (diff) | |
download | libseccomp-c12945db0b7e32f409ba3a68d18c6d6f6dd22b19.tar.gz |
arch: Add SuperH 32-bit support
Initial support for seccomp for SuperH in Linux was added in 2.6.27-rc2,
support for SECCOMP_FILTER was added for Linux 5.9. This adds support
for SuperH in libseccomp, both for little-endian and big-endian mode.
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Acked-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'src/arch-sh.c')
-rw-r--r-- | src/arch-sh.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/arch-sh.c b/src/arch-sh.c new file mode 100644 index 0000000..d4641ea --- /dev/null +++ b/src/arch-sh.c @@ -0,0 +1,42 @@ +/* + * This library is free software; you can redistribute it and/or modify it + * under the terms of version 2.1 of the GNU Lesser General Public License as + * published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, see <http://www.gnu.org/licenses>. + */ + +#include <stdlib.h> +#include <errno.h> +#include <linux/audit.h> + +#include "arch.h" +#include "arch-sh.h" + +const struct arch_def arch_def_sheb = { + .token = SCMP_ARCH_SHEB, + .token_bpf = AUDIT_ARCH_SH, + .size = ARCH_SIZE_32, + .endian = ARCH_ENDIAN_BIG, + .syscall_resolve_name = sh_syscall_resolve_name, + .syscall_resolve_num = sh_syscall_resolve_num, + .syscall_rewrite = NULL, + .rule_add = NULL, +}; + +const struct arch_def arch_def_sh = { + .token = SCMP_ARCH_SH, + .token_bpf = AUDIT_ARCH_SHEL, + .size = ARCH_SIZE_32, + .endian = ARCH_ENDIAN_LITTLE, + .syscall_resolve_name = sh_syscall_resolve_name, + .syscall_resolve_num = sh_syscall_resolve_num, + .syscall_rewrite = NULL, + .rule_add = NULL, +}; |