fix: Landlock probe environment and autofallback to BW

This commit is contained in:
abhisek
2026-05-11 21:29:11 +05:30
parent 00fd6d2a9c
commit 81c161dba3
9 changed files with 265 additions and 12 deletions
+5 -1
View File
@@ -33,13 +33,17 @@ type landlockSandbox struct {
}
// newLandlockSandbox creates a new Landlock sandbox instance after verifying
// that both Landlock and seccomp user notification are available on the system.
// that Landlock and the no-NNP seccomp shim path are available on the system.
func newLandlockSandbox() (sandbox.Sandbox, error) {
abi, err := landlockDetectABI()
if err != nil {
return nil, fmt.Errorf("landlock not available: %w", err)
}
if err := landlockShimProbe(); err != nil {
return nil, fmt.Errorf("landlock shim not available: %w", err)
}
log.Debugf("Landlock ABI V%d detected (Refer=%v, Truncate=%v, Network=%v, IoctlDev=%v, Scoping=%v)",
abi.Version, abi.HasRefer, abi.HasTruncate, abi.HasNetwork, abi.HasIoctlDev, abi.HasScoping)