!4 openEuler-libseccomp

Merge pull request !4 from Liquor/master
This commit is contained in:
openeuler-ci-bot 2020-07-01 09:13:53 +08:00 committed by Gitee
commit 5c216c1d4c
4 changed files with 1134 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
From 5b03588343426c85f282f311d4247e6b17cfbacb Mon Sep 17 00:00:00 2001
From: Tom Hromatka <tom.hromatka@oracle.com>
Date: Thu, 5 Mar 2020 09:45:50 -0700
Subject: [PATCH] arch: Add riscv64 support to arch-syscall-dump
This patch adds support for riscv64 to arch-syscall-dump.c
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
---
src/arch-syscall-dump.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/arch-syscall-dump.c b/src/arch-syscall-dump.c
index 9601bc0..7c267fc 100644
--- a/src/arch-syscall-dump.c
+++ b/src/arch-syscall-dump.c
@@ -41,6 +41,7 @@
#include "arch-parisc.h"
#include "arch-ppc.h"
#include "arch-ppc64.h"
+#include "arch-riscv64.h"
#include "arch-s390.h"
#include "arch-s390x.h"
@@ -127,6 +128,9 @@ int main(int argc, char *argv[])
case SCMP_ARCH_PPC64LE:
sys = ppc64_syscall_iterate(iter);
break;
+ case SCMP_ARCH_RISCV64:
+ sys = riscv64_syscall_iterate(iter);
+ break;
case SCMP_ARCH_S390:
sys = s390_syscall_iterate(iter);
break;
--
1.8.3.1

View File

@ -0,0 +1,86 @@
From 00afcffb77141f8416ca156065c50eae471b8ad1 Mon Sep 17 00:00:00 2001
From: Tom Hromatka <tom.hromatka@oracle.com>
Date: Tue, 10 Mar 2020 12:32:37 -0600
Subject: [PATCH] arch: Add riscv64 support to syscall validate script
This patch adds riscv64 support to arch-syscall-validate.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
---
src/arch-syscall-validate | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/src/arch-syscall-validate b/src/arch-syscall-validate
index b9e0bce..a47eb63 100755
--- a/src/arch-syscall-validate
+++ b/src/arch-syscall-validate
@@ -393,6 +393,45 @@ function dump_lib_ppc64() {
}
#
+# Dump the riscv64 system syscall table
+#
+# Arguments:
+# 1 path to the kernel source
+#
+# Dump the architecture's syscall table to stdout.
+#
+function dump_sys_riscv64() {
+ gcc -E -dM -I$1/include/uapi \
+ -D__BITS_PER_LONG=64 -D__ARCH_WANT_NEW_STAT \
+ $1/include/uapi/asm-generic/unistd.h | \
+ grep "^#define __NR_" | \
+ sed -e '/__NR_syscalls/d' | \
+ sed -e '/__NR_arch_specific_syscall/d' | \
+ sed -e 's/#define[ \t]\+__NR_\([^ \t]\+\)[ \t]\+\(.*\)/\1\t\2/' | \
+ sed -e 's/__NR3264_fadvise64/223/' | \
+ sed -e 's/__NR3264_fcntl/25/' | \
+ sed -e 's/__NR3264_fstatat/79/' | \
+ sed -e 's/__NR3264_fstatfs/44/' | \
+ sed -e 's/__NR3264_ftruncate/46/' | \
+ sed -e 's/__NR3264_lseek/62/' | \
+ sed -e 's/__NR3264_mmap/222/' | \
+ sed -e 's/__NR3264_sendfile/71/' | \
+ sed -e 's/__NR3264_statfs/43/' | \
+ sed -e 's/__NR3264_truncate/45/' | \
+ sed -e 's/__NR3264_fstat/80/' | \
+ sort
+}
+
+#
+# Dump the riscv64 library syscall table
+#
+# Dump the library's syscall table to stdout.
+#
+function dump_lib_riscv64() {
+ dump_lib_arch riscv64
+}
+
+#
# Dump the s390 system syscall table
#
# Arguments:
@@ -487,6 +526,9 @@ function dump_sys() {
ppc64)
dump_sys_ppc64 "$2"
;;
+ riscv64)
+ dump_sys_riscv64 "$2"
+ ;;
s390)
dump_sys_s390 "$2"
;;
@@ -542,6 +584,9 @@ function dump_lib() {
ppc64)
dump_lib_ppc64 "$2"
;;
+ riscv64)
+ dump_lib_riscv64 "$2"
+ ;;
s390)
dump_lib_s390 "$2"
;;
--
1.8.3.1

View File

@ -1,11 +1,15 @@
Name: libseccomp
Version: 2.4.3
Release: 1
Release: 2
Summary: Interface to the syscall filtering mechanism
License: LGPLv2
URL: https://github.com/seccomp/libseccomp
Source0: https://github.com/seccomp/libseccomp/releases/download/v%{version}/%{name}-%{version}.tar.gz
Patch0000: 0001-arch-Add-RISC-V-64-bit-support.patch
Patch0001: 0002-arch-Add-riscv64-support-to-arch-syscall-dump.patch
Patch0002: 0003-arch-Add-riscv64-support-to-syscall-validate-script.patch
BuildRequires: gcc git gdb
%description
@ -67,6 +71,9 @@ make check
%{_mandir}/man*/*
%changelog
* Tue Jun 30 2020 Liquor <lirui130@huawei.com> - 2.4.3-2
- add the patch of support for RISC-V
* Fri Apr 24 2020 BruceGW <gyl93216@163.com> - 2.4.3-1
- update upstream to 2.4.3