Skip to content

test-seccomp: assume socket filtering is broken on powerpc too#17722

Merged
poettering merged 1 commit intosystemd:masterfrom
keszybz:ppc-skip-socket-fitlering-test
Nov 26, 2020
Merged

test-seccomp: assume socket filtering is broken on powerpc too#17722
poettering merged 1 commit intosystemd:masterfrom
keszybz:ppc-skip-socket-fitlering-test

Conversation

@keszybz
Copy link
Copy Markdown
Member

@keszybz keszybz commented Nov 25, 2020

This partially reverts da1921a. Fixes #17559.

Quoting #17559:

libseccomp 2.5 added socket syscall multiplexing on ppc64(el):
seccomp/libseccomp#229

Like with i386, s390 and s390x this breaks socket argument filtering, so
RestrictAddressFamilies doesn't work.

This causes the unit test to fail:
/* test_restrict_address_families */
Operating on architecture: ppc
Failed to install socket family rules for architecture ppc, skipping: Operation canceled
Operating on architecture: ppc64
Failed to add socket() rule for architecture ppc64, skipping: Invalid argument
Operating on architecture: ppc64-le
Failed to add socket() rule for architecture ppc64-le, skipping: Invalid argument
Assertion 'fd < 0' failed at src/test/test-seccomp.c:424, function test_restrict_address_families(). Aborting.

The socket filters can't be added so socket(AF_UNIX, SOCK_DGRAM, 0); still
works, triggering the assertion.

Comment on lines 34 to 35
/* On these archs, socket() is implemented via the socketcall() syscall multiplexer,
* and we can't restrict it hence via seccomp. */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this comment sounds incompatible with the comment in seccomp_restrict_address_families():

/* These we know we support (i.e. are the ones that do not use socketcall()) */

Is it not necessary to revert the change for seccomp_restrict_address_families() in da1921a?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, a revert is in order. Updated in place.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This passes on ppc64 with libseccomp-2.5.0-3.fc33.ppc64le.

This reverts the gist of da1921a and
0d9fca7 (for ppc).

Quoting systemd#17559:
> libseccomp 2.5 added socket syscall multiplexing on ppc64(el):
> seccomp/libseccomp#229
>
> Like with i386, s390 and s390x this breaks socket argument filtering, so
> RestrictAddressFamilies doesn't work.
>
> This causes the unit test to fail:
> /* test_restrict_address_families */
> Operating on architecture: ppc
> Failed to install socket family rules for architecture ppc, skipping: Operation canceled
> Operating on architecture: ppc64
> Failed to add socket() rule for architecture ppc64, skipping: Invalid argument
> Operating on architecture: ppc64-le
> Failed to add socket() rule for architecture ppc64-le, skipping: Invalid argument
> Assertion 'fd < 0' failed at src/test/test-seccomp.c:424, function test_restrict_address_families(). Aborting.
>
> The socket filters can't be added so `socket(AF_UNIX, SOCK_DGRAM, 0);` still
> works, triggering the assertion.

Fixes systemd#17559.
@keszybz keszybz force-pushed the ppc-skip-socket-fitlering-test branch from 90f014d to 25e6e74 Compare November 26, 2020 10:26
@poettering poettering merged commit d5923e3 into systemd:master Nov 26, 2020
@poettering
Copy link
Copy Markdown
Member

(looks superficially ok, but I am no PPC person. Merged, since tests passed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

RestrictAddressFamilies fails on ppc64 with libseccomp 2.5

3 participants