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 and test unsupported rule #68

Merged
merged 1 commit into from
Jun 11, 2024
Merged

Conversation

l0kod
Copy link
Member

@l0kod l0kod commented Jun 11, 2024

We should never try to add real rules to a ruleset that wasn't really created (i.e. with a -1 file descriptor).

Fix the From implementation for Compatibilty to always use CompatState::Init as an initial state. This is now possible because of the changes in create(), especially the new handling of no_new_privs.

Simplify Ruleset:create() to only rely on compatibility state, which is now always correct. This is more future proof and this will help for upcoming restrictions.

Extend the abi_v3_truncate() test to check with a new rule which may be incompatible.

Fixes #67

We should never try to add real rules to a ruleset that wasn't really
created (i.e. with a -1 file descriptor).

Fix the From implementation for Compatibilty to always use
CompatState::Init as an initial state.  This is now possible because of
the changes in create(), especially the new handling of no_new_privs.

Simplify Ruleset:create() to only rely on compatibility state, which is
now always correct.  This is more future proof and this will help for
upcoming restrictions.

Extend the abi_v3_truncate() test to check with a new rule which may be
incompatible.

Fixes: ccb5a58 ("compat: Prioritize error over incompatibility")
Signed-off-by: Mickaël Salaün <[email protected]>
@l0kod l0kod merged commit d8c4cad into landlock-lsm:main Jun 11, 2024
5 checks passed
@l0kod l0kod deleted the fix-compat-state branch June 11, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant