Skip to content

fix: use Restrict() to avoid REFER permission denial#49

Open
charles-cooper wants to merge 1 commit intoZouuup:mainfrom
charles-cooper:fix-refer-permission
Open

fix: use Restrict() to avoid REFER permission denial#49
charles-cooper wants to merge 1 commit intoZouuup:mainfrom
charles-cooper:fix-refer-permission

Conversation

@charles-cooper
Copy link
Copy Markdown

@charles-cooper charles-cooper commented Jan 25, 2026

Using separate RestrictPaths() and RestrictNet() calls creates two Landlock rulesets. go-landlock's RestrictNet() clears handledAccessFS, and since REFER is "always denied by default when not in handled_access_fs" (per kernel docs), the second ruleset implicitly denies REFER.

This caused cross-directory rename/link operations to fail with EXDEV even when the directory was specified with --rw.

Fix by using Restrict() with combined rules, which creates a single ruleset with both FS and network rules, preserving REFER permission.

Fixes #48


Generated by pi + Claude claude-opus-4-5

Using separate RestrictPaths() and RestrictNet() calls creates two
Landlock rulesets. go-landlock's RestrictNet() clears handledAccessFS,
and since REFER is "always denied by default when not in handled_access_fs"
(per kernel docs), the second ruleset implicitly denies REFER.

This caused cross-directory rename/link operations to fail with EXDEV
even when the directory was specified with --rw.

Fix by using Restrict() with combined rules, which creates a single
ruleset with both FS and network rules, preserving REFER permission.

Fixes Zouuup#48

Generated-by: pi + Claude claude-opus-4-20250514
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REFER permission denied due to separate RestrictPaths/RestrictNet calls

1 participant