diff options
| author | Mickaël Salaün <mic@digikod.net> | 2025-12-19 22:38:49 +0300 |
|---|---|---|
| committer | Mickaël Salaün <mic@digikod.net> | 2025-12-26 22:39:01 +0300 |
| commit | aa9877d74c07045f712a4ec82105505e69cd5efe (patch) | |
| tree | 312c8dba4b664b19022744c10c2920bef5ba9002 | |
| parent | 03a0ff99ef2e4958141f7b4c573722fc8f4b9539 (diff) | |
| download | linux-aa9877d74c07045f712a4ec82105505e69cd5efe.tar.xz | |
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>
| -rw-r--r-- | security/landlock/task.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/landlock/task.c b/security/landlock/task.c index 2385017418ca..bf4ed15a7f01 100644 --- a/security/landlock/task.c +++ b/security/landlock/task.c @@ -86,7 +86,6 @@ static int hook_ptrace_access_check(struct task_struct *const child, const unsigned int mode) { const struct landlock_cred_security *parent_subject; - const struct landlock_ruleset *child_dom; int err; /* Quick return for non-landlocked tasks. */ @@ -96,7 +95,8 @@ static int hook_ptrace_access_check(struct task_struct *const child, scoped_guard(rcu) { - child_dom = landlock_get_task_domain(child); + const struct landlock_ruleset *const child_dom = + landlock_get_task_domain(child); err = domain_ptrace(parent_subject->domain, child_dom); } |
