After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777591 - tracker-seccomp: Add checks for mlock2() and getrandom() syscalls
tracker-seccomp: Add checks for mlock2() and getrandom() syscalls
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: tracker-general
tracker-general
Depends on:
Blocks:
 
 
Reported: 2017-01-21 23:11 UTC by Philip Withnall
Modified: 2017-01-23 13:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tracker-seccomp: Add checks for mlock2() and getrandom() syscalls (1.33 KB, patch)
2017-01-21 23:11 UTC, Philip Withnall
committed Details | Review
tracker-seccomp: Rewrap macros to make them clearer (1.29 KB, patch)
2017-01-23 13:32 UTC, Philip Withnall
committed Details | Review
tracker-seccomp: Check syscall availability at runtime not compile time (2.04 KB, patch)
2017-01-23 13:32 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2017-01-21 23:11:26 UTC
This should hopefully fix the build on jenkins.freedesktop.org (see the failure here: https://jenkins.freedesktop.org/job/coverity/job/coverity-scan-jhbuild/891/console).
Comment 1 Philip Withnall 2017-01-21 23:11:32 UTC
Created attachment 343962 [details] [review]
tracker-seccomp: Add checks for mlock2() and getrandom() syscalls

On older kernels, these syscalls did not exist, so the __NR_* syscall
number definition does not exist for them, and compilation fails. Make
the seccomp rules for them conditional on the syscall numbers existing.
Comment 2 Carlos Garnacho 2017-01-22 11:28:41 UTC
Comment on attachment 343962 [details] [review]
tracker-seccomp: Add checks for mlock2() and getrandom() syscalls

Looks good, thanks for looking into this :)
Comment 3 Philip Withnall 2017-01-22 13:06:23 UTC
Attachment 343962 [details] pushed as fd995f8 - tracker-seccomp: Add checks for mlock2() and getrandom() syscalls
Comment 4 Alexander Larsson 2017-01-23 10:19:50 UTC
Alternatively, we could perhaps use seccomp_syscall_resolve_name to resolve the syscalls. Then we're independent on the exact kernel headers tracker is built against.
Comment 5 Philip Withnall 2017-01-23 11:03:11 UTC
That would be a much better solution; I didn’t realise that function existed.
Comment 6 Carlos Garnacho 2017-01-23 12:01:17 UTC
Oh, me neither, thanks for the tip Alex :). I indeed prefer that solution, shall you Philip or shall I? :)

Anyway, very glad to see tracker being correctly built by j.f.o now \o/.
Comment 7 Philip Withnall 2017-01-23 13:32:07 UTC
Created attachment 344027 [details] [review]
tracker-seccomp: Rewrap macros to make them clearer

This introduces no functional changes.
Comment 8 Philip Withnall 2017-01-23 13:32:13 UTC
Created attachment 344028 [details] [review]
tracker-seccomp: Check syscall availability at runtime not compile time

This makes our seccomp() protection independent of the exact kernel
version Tracker is built against.
Comment 9 Carlos Garnacho 2017-01-23 13:52:35 UTC
Comment on attachment 344028 [details] [review]
tracker-seccomp: Check syscall availability at runtime not compile time

Looks good :). Perhaps some further checks could be done in the special cases below, but that can be handled separately.
Comment 10 Philip Withnall 2017-01-23 13:59:28 UTC
Attachment 344027 [details] pushed as bb65466 - tracker-seccomp: Rewrap macros to make them clearer
Attachment 344028 [details] pushed as 0eb74c1 - tracker-seccomp: Check syscall availability at runtime not compile time