File: 0006-Fix-bug-Added-syscalls-for-tasks-example.patch

package info (click to toggle)
kore 4.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,912 kB
  • sloc: ansic: 29,227; makefile: 344; sh: 278; python: 149; cpp: 34
file content (57 lines) | stat: -rw-r--r-- 2,007 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From: Dennis Dillert <dennis.dillert@gmail.com>
Date: Sun, 2 Apr 2023 19:54:29 +0200
Subject: Fix bug: Added syscalls for tasks example.

The tasks example stopped working on Linux (Ubuntu 22.04) due to the use of missing syscalls, which have been added in this fix. In addition, the definition files have been updated to include the newer clone3 system call (in the Linux kernel since 5.6) for new process and thread creation.
---
 examples/tasks/src/tasks.c      | 2 ++
 misc/linux/aarch64_syscall.h.in | 1 +
 misc/linux/arm_syscall.h.in     | 1 +
 misc/linux/x86_64_syscall.h.in  | 1 +
 4 files changed, 5 insertions(+)

diff --git a/examples/tasks/src/tasks.c b/examples/tasks/src/tasks.c
index e21a6ea..a7ee1ce 100644
--- a/examples/tasks/src/tasks.c
+++ b/examples/tasks/src/tasks.c
@@ -55,6 +55,8 @@ KORE_SECCOMP_FILTER("tasks",
 	KORE_SYSCALL_ALLOW(recvmsg),
 	KORE_SYSCALL_ALLOW(sendmmsg),
 	KORE_SYSCALL_ALLOW(getpeername),
+	KORE_SYSCALL_ALLOW(rseq),
+	KORE_SYSCALL_ALLOW(clone3),
 );
 #endif
 
diff --git a/misc/linux/aarch64_syscall.h.in b/misc/linux/aarch64_syscall.h.in
index 955e2ca..47d1d51 100644
--- a/misc/linux/aarch64_syscall.h.in
+++ b/misc/linux/aarch64_syscall.h.in
@@ -287,4 +287,5 @@
 #define __NR_fsconfig		431
 #define __NR_fsmount		432
 #define __NR_fspick		433
+#define __NR_clone3   435
 
diff --git a/misc/linux/arm_syscall.h.in b/misc/linux/arm_syscall.h.in
index a565a4e..86334ed 100644
--- a/misc/linux/arm_syscall.h.in
+++ b/misc/linux/arm_syscall.h.in
@@ -387,6 +387,7 @@
 #define __NR_fsconfig		431
 #define __NR_fsmount		432
 #define __NR_fspick		433
+#define __NR_clone3   435
 
 #define __ARM_NR_breakpoint	0x0f0001
 #define __ARM_NR_cacheflush	0x0f0002
diff --git a/misc/linux/x86_64_syscall.h.in b/misc/linux/x86_64_syscall.h.in
index 2d4634f..d2cab06 100644
--- a/misc/linux/x86_64_syscall.h.in
+++ b/misc/linux/x86_64_syscall.h.in
@@ -343,4 +343,5 @@
 #define __NR_fsconfig		431
 #define __NR_fsmount		432
 #define __NR_fspick		433
+#define __NR_clone3   435