Add support for Landlock ABI 5: control IOCTL commands on character and block devices with the new AccessFs::IoctlDev
right (PR #74).
Improved the CI to better test against different kernel versions (PR #72).
Add support for Landlock ABI 4: control TCP binding and connection according to specified network ports.
This is now possible with the AccessNet
rights and
the NetPort
rule
(PR #55).
The from_read()
and from_write()
methods moved from the Access
trait to the AccessFs
struct
(commit 68f066eba571).
Improve compatibility consistency and prioritize runtime errors against compatibility errors (PR #67).
Fixed a corner case where a ruleset was created on a kernel not supporting Landlock, while requesting to add a rule with an access right handled by the ruleset (BestEffort
).
When trying to enforce this ruleset, this led to a runtime error (i.e. wrong file descriptor) instead of a compatibility error.
To simplify compatibility management, always call prctl(PR_SET_NO_NEW_PRIVS, 1)
by default (see set_no_new_privs()
).
This was required to get a consistent compatibility management and it should not be an issue given that this feature is supported by all LTS kernels
(commit d99f75155bec).
Add RulesetCreated::try_clone()
(PR #38).
Add support for Landlock ABI 3: control truncate operations with the new
AccessFs::Truncate
right (PR #40).
Revamp the compatibility handling and add a new
set_compatibility()
method for Ruleset
, RulesetCreated
, and PathBeneath
.
We can now fine-tune the compatibility behavior according to the running kernel
and then the supported features thanks to three compatible levels:
best effort, soft requirement and hard requirement
(PR #12).
Add a new AccessFs::from_file()
helper (commit 0b3238c6dd70).
Deprecate the set_best_effort()
method and replace it with set_compatibility()
(PR #12).
Deprecate Ruleset::new()
and replace it with Ruleset::default()
(PR #44).
We now check that a ruleset really handles at least one access right,
which can now cause Ruleset::create()
to return an error if the ruleset compatibility level is
HardRequirement
or set_best_effort(false)
(commit 95addc13b4a8).
We now check that access rights passed to add_rule()
make sense according to the file type.
To handle most use cases,
path_beneath_rules()
now automatically check and downgrade access rights for files
(i.e. remove superfluous directory-only access rights,
commit 8e47940b3722).
Test coverage in the CI is greatly improved by running all tests on all relevant kernel versions: Linux 5.10, 5.15, 6.1, and 6.4 (PR #41).
Run each test in a dedicated thread to avoid inconsistent behavior (PR #46).
This is the first major release of this crate. It brings a high-level interface to the Landlock kernel interface.