summaryrefslogtreecommitdiff
path: root/security/landlock/domain.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-09-09 11:00:35 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-09-09 11:00:35 -0700
commit50d05c7c76c96b90462f24debacca971d2e86713 (patch)
tree25602b0e57ea0a59ae40f5f55a5e73bd99b29646 /security/landlock/domain.c
parent5e1287972b649aab54a894addeaf1fdd6bc23e6b (diff)
parentd41d0021a6ea3e9fcd14126a00fead47f981c46e (diff)
Merge tag 'landlock-7.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linuxHEADmaster
Pull Landlock fixes from Mickaël Salaün: "This fixes a use-after-free and a lockdep assert NULL dereferencing, and properly truncates too-long strings printed by a Landlock tracepoint. Most of the changes are brought by new tests" * tag 'landlock-7.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux: landlock: Test trace path output boundaries landlock: Bound escaped trace path output landlock: Clean up ruleset validation checks selftests/landlock: Test abstract socket trace name limits landlock: Fix use-after-free of the source's parent directory
Diffstat (limited to 'security/landlock/domain.c')
-rw-r--r--security/landlock/domain.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/security/landlock/domain.c b/security/landlock/domain.c
index 93c7104fd6b2..4031b581be07 100644
--- a/security/landlock/domain.c
+++ b/security/landlock/domain.c
@@ -439,10 +439,11 @@ landlock_merge_ruleset(struct landlock_domain *const parent,
int err;
might_sleep();
- lockdep_assert_held(&ruleset->lock);
if (WARN_ON_ONCE(!ruleset))
return ERR_PTR(-EINVAL);
+ lockdep_assert_held(&ruleset->lock);
+
if (parent) {
if (parent->num_layers >= LANDLOCK_MAX_NUM_LAYERS)
return ERR_PTR(-E2BIG);