[tracker-miners/tracker-miners-2.3: 1/2] seccomp: fix on musl
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/tracker-miners-2.3: 1/2] seccomp: fix on musl
- Date: Thu, 12 Dec 2019 10:36:32 +0000 (UTC)
commit c699f7b698046d13f55d837cd073541d959e144b
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]