blob: 187898a6efc6dc55e088ba7f324124ff42615000 [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From f35e07aceb4a16121d83b47ee77990018bec98ea Mon Sep 17 00:00:00 2001
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08002From: Joe Slater <jslater@windriver.com>
3Date: Thu, 9 Mar 2017 10:58:06 -0800
Brad Bishop26bdd442019-08-16 17:08:17 -04004Subject: [PATCH] chrony: fix build failure for arma9
Brad Bishop316dfdd2018-06-25 12:45:53 -04005
Brad Bishop7f28bc52017-12-03 23:42:40 -05006 Eliminate references to syscalls not available
7 for ARM_EABI. Also add a dependency on libseccomp
8 which is needed for scfilter to work.
Brad Bishop316dfdd2018-06-25 12:45:53 -04009
Brad Bishop7f28bc52017-12-03 23:42:40 -050010 Set PACKAGECONFIG to not enable scfilter, since
11 kernel CONFIG_SECCOMP is unlikely to be set. This
12 aligns the usage of libseccomp with that of other packages.
13
14 Upstream-Status: Pending
Brad Bishop316dfdd2018-06-25 12:45:53 -040015
Brad Bishop7f28bc52017-12-03 23:42:40 -050016 Signed-off-by: Joe Slater <jslater@windriver.com>
17
Brad Bishop316dfdd2018-06-25 12:45:53 -040018 Refresh patch for new upstream version.
19
20 Signed-off-by: Robert Joslyn <robert.joslyn@redrectangle.org>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021---
Brad Bishop26bdd442019-08-16 17:08:17 -040022 sys_linux.c | 20 ++++++++++++++------
23 1 file changed, 14 insertions(+), 6 deletions(-)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080024
25diff --git a/sys_linux.c b/sys_linux.c
Brad Bishop26bdd442019-08-16 17:08:17 -040026index 898dc7a..b268ad1 100644
Brad Bishop7f28bc52017-12-03 23:42:40 -050027--- a/sys_linux.c
28+++ b/sys_linux.c
Brad Bishop26bdd442019-08-16 17:08:17 -040029@@ -479,14 +479,14 @@ SYS_Linux_EnableSystemCallFilter(int level)
Brad Bishop7f28bc52017-12-03 23:42:40 -050030 const int syscalls[] = {
31 /* Clock */
Brad Bishop316dfdd2018-06-25 12:45:53 -040032 SCMP_SYS(adjtimex), SCMP_SYS(clock_gettime), SCMP_SYS(gettimeofday),
33- SCMP_SYS(settimeofday), SCMP_SYS(time),
34+ SCMP_SYS(settimeofday),
Brad Bishop7f28bc52017-12-03 23:42:40 -050035 /* Process */
Brad Bishop316dfdd2018-06-25 12:45:53 -040036 SCMP_SYS(clone), SCMP_SYS(exit), SCMP_SYS(exit_group), SCMP_SYS(getpid),
37- SCMP_SYS(getrlimit), SCMP_SYS(rt_sigaction), SCMP_SYS(rt_sigreturn),
38+ SCMP_SYS(rt_sigaction), SCMP_SYS(rt_sigreturn),
39 SCMP_SYS(rt_sigprocmask), SCMP_SYS(set_tid_address), SCMP_SYS(sigreturn),
Brad Bishop26bdd442019-08-16 17:08:17 -040040 SCMP_SYS(wait4), SCMP_SYS(waitpid),
Brad Bishop7f28bc52017-12-03 23:42:40 -050041 /* Memory */
42- SCMP_SYS(brk), SCMP_SYS(madvise), SCMP_SYS(mmap), SCMP_SYS(mmap2),
43+ SCMP_SYS(brk), SCMP_SYS(madvise), SCMP_SYS(mmap2),
44 SCMP_SYS(mprotect), SCMP_SYS(mremap), SCMP_SYS(munmap), SCMP_SYS(shmdt),
45 /* Filesystem */
Brad Bishop26bdd442019-08-16 17:08:17 -040046 SCMP_SYS(_llseek), SCMP_SYS(access), SCMP_SYS(chmod), SCMP_SYS(chown),
47@@ -499,14 +499,22 @@ SYS_Linux_EnableSystemCallFilter(int level)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080048 SCMP_SYS(bind), SCMP_SYS(connect), SCMP_SYS(getsockname), SCMP_SYS(getsockopt),
Brad Bishop26bdd442019-08-16 17:08:17 -040049 SCMP_SYS(recv), SCMP_SYS(recvfrom), SCMP_SYS(recvmmsg), SCMP_SYS(recvmsg),
50 SCMP_SYS(send), SCMP_SYS(sendmmsg), SCMP_SYS(sendmsg), SCMP_SYS(sendto),
Brad Bishop7f28bc52017-12-03 23:42:40 -050051- /* TODO: check socketcall arguments */
52- SCMP_SYS(socketcall),
53 /* General I/O */
Brad Bishop316dfdd2018-06-25 12:45:53 -040054 SCMP_SYS(_newselect), SCMP_SYS(close), SCMP_SYS(open), SCMP_SYS(openat), SCMP_SYS(pipe),
Brad Bishop26bdd442019-08-16 17:08:17 -040055 SCMP_SYS(pipe2), SCMP_SYS(poll), SCMP_SYS(ppoll), SCMP_SYS(pselect6), SCMP_SYS(read),
56- SCMP_SYS(futex), SCMP_SYS(select), SCMP_SYS(set_robust_list), SCMP_SYS(write),
57+ SCMP_SYS(futex), SCMP_SYS(set_robust_list), SCMP_SYS(write),
Brad Bishop7f28bc52017-12-03 23:42:40 -050058 /* Miscellaneous */
Brad Bishop316dfdd2018-06-25 12:45:53 -040059 SCMP_SYS(getrandom), SCMP_SYS(sysinfo), SCMP_SYS(uname),
Brad Bishop7f28bc52017-12-03 23:42:40 -050060+ /* not always available */
61+#if ! defined(__ARM_EABI__)
62+ SCMP_SYS(time),
63+ SCMP_SYS(getrlimit),
64+ SCMP_SYS(select),
65+ SCMP_SYS(mmap),
66+ /* TODO: check socketcall arguments */
67+ SCMP_SYS(socketcall),
68+#endif
Brad Bishop26bdd442019-08-16 17:08:17 -040069+
Brad Bishop7f28bc52017-12-03 23:42:40 -050070 };
71
72 const int socket_domains[] = {
Brad Bishop26bdd442019-08-16 17:08:17 -040073--
742.17.1
75