- Added support for Landlock ABI 9:
control connections to pathname UNIX domain sockets with the new
AccessFs::ResolveUnixright (PR #135).
- Added support for Landlock ABI 8:
atomically apply the sandbox to all threads of the calling process with
all_threads()(shared betweenRulesetCreatedandRestrictSelf) (PR #130).
- Added support for Landlock ABI 7:
control audit logging behavior with
log_same_exec(),log_new_exec()(domain-specific), andlog_subdomains()(shared betweenRulesetCreatedandRestrictSelf) (PR #120). - Added
RestrictSelfbuilder for callinglandlock_restrict_self()without creating a Landlock domain (e.g., muting subdomain audit logs). - Extended
RestrictionStatuswith three new public fields (log_same_exec,log_new_exec,log_subdomains) reporting the effective audit-logging flag state afterrestrict_self()andapply(). - Added
Erratumbitflags enum andErratum::current()for querying fixed kernel bugs before building a ruleset (PR #119).
Deprecate the set_no_new_privs()
method and replace it with
no_new_privs()
(PR #122).
- Bumped MSRV to Rust 1.71.
- Extended CI to test against Linux 6.15.
- Added errata tests verifying the
From<ABI>mapping matches CI kernel errata. - Added
SoftRequirementtest coverage forscope()and restrict_self flags. - Added
try_compat_binary()unit tests for the binary compat dispatch.
- Synced the sandboxer example with the kernel's
sandboxer.c: addedLL_FORCE_LOGenvironment variable for audit logging (PR #120).
- Added support for all architectures (PR #111).
- Added
LandlockStatustype to query the running kernel and display information about available Landlock features (PR #103 and PR #113).
- Bumped MSRV to Rust 1.68 (PR #112).
- Extended CI to build and test on i686 architecture (PR #111).
- Enhanced sandboxer example to print helpful hints about Landlock status (PR #103).
- Implemented common traits (e.g.,
Debug) for public types (PR #108).
- Extended CONTRIBUTING.md documentation with additional testing and development guidelines (PR #95).
- Added more background information to
path_beneath_rules()documentation (PR #94).
- Added test case for
AccessFs::from_file()method (PR #92).
- Added support for Landlock ABI 6: control abstract UNIX sockets and signal scoping with the new
Ruleset::scope()method taking aScopeenum (PR #96 and PR #98). - Added
From<RulesetCreated>implementation forOption<OwnedFd>(PR #104) - Introduced a new
HandledAccesstrait specific toAccessFsandAccessNet(commit 554217dda0b7). - Added a new
Errnotype to improve FFI support (PR #86 and PR #102). - Exposed
From<i32>implementation forABI(PR #88).
- Added clarifying notes about
AccessFs::WriteFilebehavior andpath_beneath_rulesusage (PR #80). - Introduced CONTRIBUTING.md with testing workflow explanations (PR #76).
- Enhanced test coverage for new API and added testing against Linux 6.12 (PR #96).
- Updated CI configuration to use the latest Ubuntu versions (PR #87 and PR #97).
- Modified default
LANDLOCK_CRATE_TEST_ABIto match the current kernel for more convenient local testing (PR #76).
- Synchronized the sandboxer example with the C version (PR #101): improved error handling for inaccessible file paths and enhanced help documentation.
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.