Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: mask: use test paths rather than /sys #1121

Merged
merged 1 commit into from
Oct 19, 2016
Merged

tests: mask: use test paths rather than /sys #1121

merged 1 commit into from
Oct 19, 2016

Conversation

cyphar
Copy link
Member

@cyphar cyphar commented Oct 18, 2016

In certain circumstances (such as the rootless containers patchset), it
is not possible to test things using /sys/firmware. In addition, we
should be testing our own functionality rather than testing protection
against /sys attacks (for which the system might already have extra
protections).

Instead, just make some fake paths in the rootfs that we then mask.
Oddly I noticed that one of the errors changed when doing this (because
before we tested removing a file from /sys/firmware which is -EPERM). So
the old test was broken.

Fixes: 5317955 ("MaskPaths: support directory")
Fixes: #1068
Signed-off-by: Aleksa Sarai asarai@suse.de

In certain circumstances (such as the rootless containers patchset), it
is not possible to test things using /sys/firmware. In addition, we
should be testing our own functionality rather than testing protection
against /sys attacks (for which the system might already have extra
protections).

Instead, just make some fake paths in the rootfs that we then mask.
Oddly I noticed that one of the errors changed when doing this (because
before we tested removing a file from /sys/firmware which is -EPERM). So
the old test was broken.

Fixes: 5317955 ("MaskPaths: support directory")
Fixes: #1068
Signed-off-by: Aleksa Sarai <asarai@suse.de>
@mrunalp
Copy link
Contributor

mrunalp commented Oct 18, 2016

LGTM

Approved with PullApprove

1 similar comment
@crosbymichael
Copy link
Member

crosbymichael commented Oct 19, 2016

LGTM

Approved with PullApprove

@crosbymichael crosbymichael merged commit b827292 into opencontainers:master Oct 19, 2016
@cyphar cyphar deleted the fix-masked-paths-test branch October 20, 2016 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants