Linux Security Modules development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH] apparmor: hold candidate profile reference during attachment lookup
Date: Sat, 07 Nov 2026 18:46:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-203185@kernel.org> (raw)
In-Reply-To: <20261107183514.1575928-2-bestswngs@gmail.com>

> find_attach() retains the best matching profile in candidate while walking
> the profile list under RCU.  When matching xattrs, it pins only the current
> profile and drops the RCU read lock around aa_xattrs_match().  A concurrent
> policy removal can therefore free an earlier candidate during this window.
> If the policy revision changes, the retry also preserves candidate and its
> ranking state because they are initialized above the restart label.  The
> final aa_get_newest_profile() then dereferences the freed profile.
> 
> The reproducer triggers:
> 
>   BUG: KASAN: slab-use-after-free in aa_get_newest_label
>   Read of size 8 by task poc
>   Call Trace:
>    aa_get_newest_label security/apparmor/include/label.h:413
>    find_attach security/apparmor/domain.c:505
> [ ... ]
> Fixes: 8c62ed27a12c ("apparmor: fix aa_xattrs_match() may sleep while holding a RCU lock")
> Reported-by: Shuangpeng Bai <shuangpeng.kernel@gmail.com>
> Closes: https://lore.kernel.org/linux-security-module/20261105164839.66760-1-shuangpeng.kernel@gmail.com/
> Cc: stable@vger.kernel.org
> Signed-off-by: Weiming Shi <bestswngs@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261107183514.1575928-2-bestswngs@gmail.com?part=1


      reply	other threads:[~2026-11-07 18:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07 18:35 [PATCH] apparmor: hold candidate profile reference during attachment lookup Weiming Shi
2026-11-07 18:46 ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-203185@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox