Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Qihang <q.h.hack.winter@gmail.com>
Cc: john.johansen@canonical.com, georgia.garcia@canonical.com,
	security@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] apparmor: make unpacked rename and attach strings owned copies
Date: Thu, 3 Sep 2026 06:38:17 +0200	[thread overview]
Message-ID: <2026090337-batboy-underpass-9507@gregkh> (raw)
In-Reply-To: <20260902160138.74264-1-q.h.hack.winter@gmail.com>

On Thu, Sep 03, 2026 at 12:01:38AM +0800, Qihang wrote:
> unpack_profile() stores the optional rename and attach strings using
> aa_unpack_str(), which returns pointers into the policy blob.
> profile->rename is later freed with kfree_sensitive(), causing an
> invalid free of an interior pointer on the failed-unpack path.
> profile->attach.xmatch_str can instead become a dangling pointer when
> the original policy blob is freed after compressed binary policy export.
> Use aa_unpack_strdup() for both strings and free xmatch_str with the
> attachment.
> 
> Fixes: 736ec752d95e9 ("AppArmor: policy routines for loading and unpacking policy")
> Cc: stable@vger.kernel.org
> Signed-off-by: Qihang <q.h.hack.winter@gmail.com>
> ---
>  security/apparmor/policy.c        | 1 +
>  security/apparmor/policy_unpack.c | 7 +++++--
>  2 files changed, 6 insertions(+), 2 deletions(-)

as this, and the other apparmor patch, are now public, please just do
this work on the public apparmor list, no need to get security@k.o
involved anymore.

thanks,

greg k-h

      reply	other threads:[~2026-09-03  4:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAH78GvvERK9_hkKDa=Td8vK_89kZ4SPRb9J6UW5L0sMRPiUOBA@mail.gmail.com>
2026-09-02 16:01 ` [PATCH] apparmor: make unpacked rename and attach strings owned copies Qihang
2026-09-03  4:38   ` Greg KH [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=2026090337-batboy-underpass-9507@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=georgia.garcia@canonical.com \
    --cc=john.johansen@canonical.com \
    --cc=q.h.hack.winter@gmail.com \
    --cc=security@kernel.org \
    --cc=stable@vger.kernel.org \
    /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