On Tue, 2026-07-07 at 11:13 -0700, Ryan Lee via AppArmor wrote:

Acked-by: Georgia Garcia <[email protected]>

> Signed-off-by: Ryan Lee <[email protected]>
> ---
>  security/apparmor/task.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/security/apparmor/task.c b/security/apparmor/task.c
> index b9fb3738124e..4c6112ba63b7 100644
> --- a/security/apparmor/task.c
> +++ b/security/apparmor/task.c
> @@ -64,9 +64,10 @@ int aa_replace_current_label(struct aa_label *label)
>  
>       if (ctx->nnp && label_is_stale(ctx->nnp)) {
>               struct aa_label *tmp = ctx->nnp;
> +             bool needput;
>  
> -             ctx->nnp = aa_get_newest_label(tmp);
> -             aa_put_label(tmp);
> +             ctx->nnp = aa_get_newest_label_condref(tmp, &needput);
> +             aa_put_label_condref(tmp, needput);
>       }
>       if (unconfined(label) || (labels_ns(old) != labels_ns(label)))
>               /*


Reply via email to