]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
apparmor: make aa_set_current_onexec return void
authorQuanfa Fu <quanfafu@gmail.com>
Sat, 14 Jan 2023 16:49:52 +0000 (00:49 +0800)
committerJohn Johansen <john.johansen@canonical.com>
Mon, 10 Jul 2023 00:30:51 +0000 (17:30 -0700)
Change the return type to void since it always return 0, and no need
to do the checking in aa_set_current_onexec.

Signed-off-by: Quanfa Fu <quanfafu@gmail.com>
Reviewed-by: "Tyler Hicks (Microsoft)" <code@tyhicks.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/domain.c
security/apparmor/include/task.h
security/apparmor/task.c

index f3715cda59c52b4841a3561a5b3b5b81549c2815..68598557aef51e7d9abbbfb1361bd5555d54218e 100644 (file)
@@ -1446,7 +1446,7 @@ check:
                }
 
                /* full transition will be built in exec path */
-               error = aa_set_current_onexec(target, stack);
+               aa_set_current_onexec(target, stack);
        }
 
 audit:
index 13437d62c70f4657fbad8f08e51c125109807d14..01717fe432c3b4664f812f7b730f67b2f924c4eb 100644 (file)
@@ -30,7 +30,7 @@ struct aa_task_ctx {
 };
 
 int aa_replace_current_label(struct aa_label *label);
-int aa_set_current_onexec(struct aa_label *label, bool stack);
+void aa_set_current_onexec(struct aa_label *label, bool stack);
 int aa_set_current_hat(struct aa_label *label, u64 token);
 int aa_restore_previous_label(u64 cookie);
 struct aa_label *aa_get_task_label(struct task_struct *task);
index 84d16a29bfcbc3eab15dec89321690cffc82763a..5671a716fcd218851ed9354de6f8cc01f53946c2 100644 (file)
@@ -93,9 +93,8 @@ int aa_replace_current_label(struct aa_label *label)
  * aa_set_current_onexec - set the tasks change_profile to happen onexec
  * @label: system label to set at exec  (MAYBE NULL to clear value)
  * @stack: whether stacking should be done
- * Returns: 0 or error on failure
  */
-int aa_set_current_onexec(struct aa_label *label, bool stack)
+void aa_set_current_onexec(struct aa_label *label, bool stack)
 {
        struct aa_task_ctx *ctx = task_ctx(current);
 
@@ -103,8 +102,6 @@ int aa_set_current_onexec(struct aa_label *label, bool stack)
        aa_put_label(ctx->onexec);
        ctx->onexec = label;
        ctx->token = stack;
-
-       return 0;
 }
 
 /**