Re: [PATCH v3 1/2] landlock: Fix layer composition of LANDLOCK_ACCESS_FS_REFER

From
sashiko-bot@kernel.org
Date
2026-11-12 07:04:52
Reply to
pandaWall, 2026-11-12
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] landlock: Signed-off-by trailer uses handle instead of real
  full name
--

commit cb46916a3af3329861df374b264b4d7fb8d1f7a6
Author: pandaWall [off-list ref]
landlock: Fix layer composition of LANDLOCK_ACCESS_FS_REFER

landlock_get_fs_access_mask() unconditionally ORs
_LANDLOCK_ACCESS_FS_INITIALLY_DENIED (i.e. LANDLOCK_ACCESS_FS_REFER)
into every layer's handled filesystem mask.  Layers created from
rulesets that only handle other rule types (network ports, scopes) or
only permissions therefore report REFER as handled even though
landlock_upgrade_handled_layer_config() only adds the bit when
handled.fs is non-zero, and no filesystem rule can ever clear a bit
of such a layer.

The consequence is that stacking any non-filesystem ruleset on top of
a filesystem ruleset makes link(2), rename(2) and
renameat2(RENAME_EXCHANGE) fail with -EXDEV/-EACCES even when each
ruleset individually allows the operation: landlock_unmask_layers()
requires every layer's mask to be cleared, and a non-filesystem
layer's mask can never be.

Only implicitly handle REFER for layers that already handle
filesystem access rights.

Fixes: fff69fb03dde ("landlock: Support network rules with TCP bind and connect")
Signed-off-by: pandaWall <redacted>
[Severity: High]
Documentation/process/submitting-patches.rst requires a real full name in
the Signed-off-by trailer and Author header rather than a single-word
handle or nickname ("pandaWall").

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261112065203.1066536-1-mangosteen922@126.com?part=1
Thread (12 messages) 12 messages, 3 authors, last reply 6d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help