Skip to content

Commit c0f6eaa

Browse files
pavitrabhallaclaude
andcommitted
fix(jailer): use ABI::V7 and bump landlock to 0.4.5
Per the Landlock crate maintainer's guidance, the ABI parameter should be the highest version that has been tested, not a pinned older version. Ruleset::default() uses SoftRequirement by default, so the crate automatically downgrades to whatever the running kernel supports — no behaviour change on older kernels. - Bump landlock dependency from 0.4.4 to 0.4.5 (adds ABI::V7 support, Linux 6.15). - Switch from ABI::V4 to ABI::V7. - Update the prepare_ruleset doc comment to reflect best-effort semantics (no error on kernels with partial/no Landlock support). Signed-off-by: Pavitra Bhalla <pavitra@superserve.ai> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 68c88c5 commit c0f6eaa

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ and this project adheres to
7979
`rng-seed` FDT node for aarch64 guests which provides an initial random seed
8080
for the guest to use. This helps older aarch64 machines which do not have
8181
hardware random generators.
82+
8283
- Added support for Linux 6.18 host kernels alongside the existing 5.10 and 6.1
8384
host kernels. See the [kernel support policy](docs/kernel-policy.md) for
8485
details.

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jailer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bench = false
1515
tracing = ["log-instrument", "utils/tracing"]
1616

1717
[dependencies]
18-
landlock = "0.4.4"
18+
landlock = "0.4.5"
1919
libc = "0.2.186"
2020
log-instrument = { path = "../log-instrument", optional = true }
2121
regex = { version = "1.12.3", default-features = false, features = ["std"] }

src/jailer/src/landlock.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@ use crate::JailerError;
3535
///
3636
/// # Errors
3737
///
38-
/// Returns [`JailerError::Landlock`] if the kernel does not support Landlock,
39-
/// if `jail_dir` cannot be opened, or if any ruleset syscall fails.
38+
/// Returns [`JailerError::Landlock`] if `jail_dir` cannot be opened or if any
39+
/// ruleset syscall fails. On kernels with partial or no Landlock support the
40+
/// ruleset is silently downgraded to the highest ABI the kernel supports
41+
/// (best-effort, per [`Ruleset::default`] semantics).
4042
pub fn prepare_ruleset(jail_dir: &Path) -> Result<RulesetCreated, JailerError> {
41-
let abi = ABI::V4;
43+
// V7 is the highest tested ABI. The crate's default SoftRequirement mode
44+
// automatically downgrades to whatever the running kernel supports.
45+
let abi = ABI::V7;
4246

4347
let path_fd = PathFd::new(jail_dir).map_err(|err| {
4448
JailerError::Landlock(format!(

0 commit comments

Comments
 (0)