Skip to content

Commit aa9877d

Browse files
committed
landlock: Clean up hook_ptrace_access_check()
Make variable's scope minimal in hook_ptrace_access_check(). Cc: Günther Noack <gnoack3000@gmail.com> Link: https://lore.kernel.org/r/20251219193855.825889-3-mic@digikod.net Reviewed-by: Günther Noack <gnoack3000@gmail.com> Signed-off-by: Mickaël Salaün <mic@digikod.net>
1 parent 03a0ff9 commit aa9877d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

security/landlock/task.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ static int hook_ptrace_access_check(struct task_struct *const child,
8686
const unsigned int mode)
8787
{
8888
const struct landlock_cred_security *parent_subject;
89-
const struct landlock_ruleset *child_dom;
9089
int err;
9190

9291
/* Quick return for non-landlocked tasks. */
@@ -96,7 +95,8 @@ static int hook_ptrace_access_check(struct task_struct *const child,
9695

9796
scoped_guard(rcu)
9897
{
99-
child_dom = landlock_get_task_domain(child);
98+
const struct landlock_ruleset *const child_dom =
99+
landlock_get_task_domain(child);
100100
err = domain_ptrace(parent_subject->domain, child_dom);
101101
}
102102

0 commit comments

Comments
 (0)