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

Fix GH-11808: Live filesystem modified by tests (security) #13566

Closed
wants to merge 2 commits into from

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Mar 1, 2024

There's a test that tries to make /etc world-writable, and asserts that it fails. Although this test is guarded by a root user check, there are situations where you don't need to be root to be able to do this. This may thus have unwanted effects on your live filesystem.

The simple solution is to remove that part of the test. It doesn't really add value anyway: we're trying to test the chmod error path, but that exact same error path can be reached with any failure condition that the kernel gives. For example, trying to chmod a non-existent file will trigger the same code path.

While at it, also prefix the test path for the non-existent file such that we don't accidentally modify the filesystem.

There's a test that tries to make /etc world-writable, and asserts that
it fails. Although this test is guarded by a root user check, there are
situations where you don't need to be root to be able to do this.
This may thus have unwanted effects on your live filesystem.

The simple solution is to remove that part of the test. It doesn't
really add value anyway: we're trying to test the chmod error path, but
that exact same error path can be reached with any failure condition
that the kernel gives. For example, trying to chmod a non-existent file
will trigger the same code path.

While at it, also prefix the test path for the non-existent file such
that we don't accidentally modify the filesystem.
@nielsdos nielsdos requested a review from devnexen March 1, 2024 16:48
@nielsdos nielsdos linked an issue Mar 1, 2024 that may be closed by this pull request
Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

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

Makes sense removing these.

@orlitzky
Copy link
Contributor

orlitzky commented Mar 1, 2024

Thank you!

@nielsdos nielsdos closed this in 7c8a3e4 Mar 1, 2024
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.

Live filesystem modified by tests (security)
3 participants