From cca93740e7aa22d4405d96e95ec403550c188831 Mon Sep 17 00:00:00 2001 From: Babis Chalios Date: Sun, 18 Oct 2026 17:16:55 +0200 Subject: [PATCH 1/2] fix(test): handle FaultKind::Minor in test_write_protect With both the linux5_7 and linux5_13 features enabled, FaultKind has a Minor variant, and the match on the fault kind in test_write_protect fails to compile as non-exhaustive. Add a Minor arm, compiled only with linux5_13, that panics, since the test doesn't register the mapping in minor mode. Signed-off-by: Babis Chalios --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 59c2ce8..cb49963 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -692,6 +692,9 @@ mod test { uffd.write_protect(mapping, PAGE_SIZE)?; uffd.wake(mapping, PAGE_SIZE)?; } + // The mapping is not registered in minor mode. + #[cfg(feature = "linux5_13")] + FaultKind::Minor => panic!("unexpected minor fault"), }, _ => panic!("unexpected event"), } From e73281f2766eb51e4c84230764d192591f871ad9 Mon Sep 17 00:00:00 2001 From: Babis Chalios Date: Sun, 18 Oct 2026 18:04:23 +0200 Subject: [PATCH 2/2] ci: run tests with the linux5_13 feature CI never built or tested the linux5_13 feature. Add a step for it, and one for linux5_7 and linux5_13 together. The kernel version features of the crate are independent of each other, so this is the only build that has both the WriteProtected and Minor fault kinds. Signed-off-by: Babis Chalios --- .github/workflows/rust.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ed3c9d2..9965b4a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -33,9 +33,12 @@ jobs: run: cargo test --verbose - name: Run tests (Linux 4.14 support) run: cargo test --verbose --features linux4_14 - - name: Run tests (Linux 5.7 support) run: cargo test --verbose --features linux5_7 + - name: Run tests (Linux 5.13 support) + run: cargo test --verbose --features linux5_13 + - name: Run tests (Linux 5.7 and 5.13 support) + run: cargo test --verbose --features linux5_7,linux5_13 audit: