Re: [chrony-dev] [PATCH] sys_linux: Fix build failure on ARM Cortex-A9

2023-09-05 Thread James R T
On Tue, Sep 5, 2023 at 2:21 PM Miroslav Lichvar  wrote:
>
> What libseccomp version do you have? I think such old syscalls should
> be handled there.
>

Hmm interesting. While the libseccomp version of the system that I
tested this on is indeed quite outdated (thanks for the note!),
checking the source code seems to show that these syscalls are already
handled anyway:
https://github.com/seccomp/libseccomp/blob/v2.3.1/include/seccomp.h.in

Not sure what is causing the build to fail without this patch. In any
case, I will just advocate updating to the latest libseccomp version
(and the latest chrony version as well for good measure). I hope that
such an update would automagically fix this issue.

Thank you!

Best regards,
James Raphael Tiovalen

--
To unsubscribe email [email protected] with "unsubscribe" 
in the subject.
For help email [email protected] with "help" in the 
subject.
Trouble?  Email [email protected].



Re: [chrony-dev] [PATCH] sys_linux: Fix build failure on ARM Cortex-A9

2023-09-04 Thread Miroslav Lichvar
On Tue, Sep 05, 2023 at 02:11:06PM +0800, James Raphael Tiovalen wrote:
> Guard references to syscalls not available on 32-bit ARM EABI
> (__ARM_EABI__).

What libseccomp version do you have? I think such old syscalls should
be handled there.

-- 
Miroslav Lichvar


-- 
To unsubscribe email [email protected] with "unsubscribe" 
in the subject.
For help email [email protected] with "help" in the 
subject.
Trouble?  Email [email protected].



[chrony-dev] [PATCH] sys_linux: Fix build failure on ARM Cortex-A9

2023-09-04 Thread James Raphael Tiovalen
Guard references to syscalls not available on 32-bit ARM EABI
(__ARM_EABI__).

Signed-off-by: James Raphael Tiovalen 
---
 sys_linux.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/sys_linux.c b/sys_linux.c
index 6849637..ce91dc9 100644
--- a/sys_linux.c
+++ b/sys_linux.c
@@ -485,7 +485,9 @@ SYS_Linux_EnableSystemCallFilter(int level, 
SYS_ProcessContext context)
 #endif
 SCMP_SYS(gettimeofday),
 SCMP_SYS(settimeofday),
+#ifdef __NR_time
 SCMP_SYS(time),
+#endif
 
 /* Process */
 SCMP_SYS(clone),
@@ -495,7 +497,9 @@ SYS_Linux_EnableSystemCallFilter(int level, 
SYS_ProcessContext context)
 SCMP_SYS(exit),
 SCMP_SYS(exit_group),
 SCMP_SYS(getpid),
+#ifdef __NR_getrlimit
 SCMP_SYS(getrlimit),
+#endif
 SCMP_SYS(getuid),
 SCMP_SYS(getuid32),
 #ifdef __NR_membarrier
@@ -510,12 +514,16 @@ SYS_Linux_EnableSystemCallFilter(int level, 
SYS_ProcessContext context)
 SCMP_SYS(set_tid_address),
 SCMP_SYS(sigreturn),
 SCMP_SYS(wait4),
+#ifdef __NR_waitpid
 SCMP_SYS(waitpid),
+#endif
 
 /* Memory */
 SCMP_SYS(brk),
 SCMP_SYS(madvise),
+#ifdef __NR_mmap
 SCMP_SYS(mmap),
+#endif
 SCMP_SYS(mmap2),
 SCMP_SYS(mprotect),
 SCMP_SYS(mremap),
@@ -539,7 +547,9 @@ SYS_Linux_EnableSystemCallFilter(int level, 
SYS_ProcessContext context)
 SCMP_SYS(lseek),
 SCMP_SYS(lstat),
 SCMP_SYS(lstat64),
+#ifdef __NR_newfstatat
 SCMP_SYS(newfstatat),
+#endif
 SCMP_SYS(readlink),
 SCMP_SYS(readlinkat),
 SCMP_SYS(rename),
@@ -576,7 +586,9 @@ SYS_Linux_EnableSystemCallFilter(int level, 
SYS_ProcessContext context)
 SCMP_SYS(sendto),
 SCMP_SYS(shutdown),
 /* TODO: check socketcall arguments */
+#ifdef __NR_socketcall
 SCMP_SYS(socketcall),
+#endif
 
 /* General I/O */
 SCMP_SYS(_newselect),
@@ -600,7 +612,9 @@ SYS_Linux_EnableSystemCallFilter(int level, 
SYS_ProcessContext context)
 #ifdef __NR_futex_time64
 SCMP_SYS(futex_time64),
 #endif
+#ifdef __NR_select
 SCMP_SYS(select),
+#endif
 SCMP_SYS(set_robust_list),
 SCMP_SYS(write),
 SCMP_SYS(writev),
-- 
2.42.0


-- 
To unsubscribe email [email protected] with "unsubscribe" 
in the subject.
For help email [email protected] with "help" in the 
subject.
Trouble?  Email [email protected].