Fix building autotest on platforms where syscalls are not available
ClosedPublic

Authored by bshah on Dec 6 2017, 12:23 PM.

Details

Summary

On arm64 e.g SYS_open and few more syscalls are not available, this
results in build failure.

Test Plan

builds locally

Diff Detail

Repository
R133 KScreenLocker
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bshah created this revision.Dec 6 2017, 12:23 PM
Restricted Application added a project: Plasma. · View Herald TranscriptDec 6 2017, 12:23 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
bshah requested review of this revision.Dec 6 2017, 12:23 PM
davidedmundson added inline comments.
greeter/autotests/seccomp_test.cpp
103–104

Why is this not guarded?

bshah added inline comments.Dec 6 2017, 1:31 PM
greeter/autotests/seccomp_test.cpp
103–104

Those methods are available in fcntl whether syscalls are defined or not.

graesslin requested changes to this revision.Dec 6 2017, 4:19 PM
graesslin added a subscriber: graesslin.

I think you also need to adjust the actual seccomp filtering. I don't know whether the filter works at all if the syscalls don't exist.

This revision now requires changes to proceed.Dec 6 2017, 4:19 PM
fvogt added a comment.Dec 6 2017, 4:50 PM

I think you also need to adjust the actual seccomp filtering. I don't know whether the filter works at all if the syscalls don't exist.

It uses SCMP_SYS to get the syscall nrs. So it would fail to build. If with this patch kwin builds and tests run fine, it's ok.
I doubt it though.

bshah added a comment.Dec 7 2017, 11:23 AM

I think you also need to adjust the actual seccomp filtering. I don't know whether the filter works at all if the syscalls don't exist.

Can I submit this revision first and follow up with another later if filter is not working? Because currently it is not building on arm64 at all and I have no other way to test it without it getting build.

Can I submit this revision first and follow up with another later if filter is not working? Because currently it is not building on arm64 at all and I have no other way to test it without it getting build.

I'll test it

davidk added a subscriber: davidk.Jan 5 2018, 7:41 AM

Just adding my 2 cent: I think the filter should work fine, as SCMP_SYS is explicit available to support different platforms. If the syscall isn't available, it uses negative pseudo syscall numbers to ignore those syscalls.

davidedmundson accepted this revision.Jan 8 2018, 9:39 AM
This revision was not accepted when it landed; it landed in state Needs Revision.Jan 26 2018, 12:24 PM
This revision was automatically updated to reflect the committed changes.