[tracker-miners: 1/2] seccomp: fix on musl



commit 9195e54c5fb2d3b2a717f051999b3b730b6e7b62
Author: Rasmus Thomsen <oss cogitri dev>
Date:   Wed Dec 11 21:51:48 2019 +0100

    seccomp: fix on musl
    
    the syscalls being called may differ between libcs. As such two additional
    syscalls have to be called on musl and one has to be disabled due to it
    not being available.

 src/libtracker-miners-common/tracker-seccomp.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-miners-common/tracker-seccomp.c b/src/libtracker-miners-common/tracker-seccomp.c
index c5e8871e9..cea992767 100644
--- a/src/libtracker-miners-common/tracker-seccomp.c
+++ b/src/libtracker-miners-common/tracker-seccomp.c
@@ -138,7 +138,6 @@ tracker_seccomp_init (void)
        /* Descriptors */
        ALLOW_RULE (close);
        ALLOW_RULE (read);
-       ALLOW_RULE (pread64);
        ALLOW_RULE (lseek);
        ALLOW_RULE (_llseek);
        ALLOW_RULE (fadvise64);
@@ -209,6 +208,14 @@ tracker_seccomp_init (void)
                              SCMP_CMP(2, SCMP_CMP_MASKED_EQ, O_RDWR, O_RDWR)) < 0)
                goto out;
 
+       /* Syscalls may differ between libcs */
+#if !defined(__GLIBC__)
+       ALLOW_RULE (rt_sigreturn);
+       ALLOW_RULE (readv);
+#else
+       ALLOW_RULE (pread64);
+#endif
+
        g_debug ("Loading seccomp rules.");
 
        if (seccomp_load (ctx) >= 0) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]