From: Aurelien Jarno <aurelien@aurel32.net>
To: Maciek Borzecki <maciek.borzecki@gmail.com>
Cc: apparmor@lists.ubuntu.com,
John Johansen <john.johansen@canonical.com>,
Georgia Garcia <georgia.garcia@canonical.com>,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] apparmor: handle NULL peer label in AF_UNIX context updates
Date: Tue, 29 Sep 2026 20:54:08 +0200 [thread overview]
Message-ID: <arwJUDS1vbUq_KKT@aurel32.net> (raw)
In-Reply-To: <9a2d420a1757516f1e9ad4e9a0e9f17b9ba92c72.1789628002.git.maciek.borzecki@gmail.com>
Hi,
On 2026-09-17 09:15, Maciek Borzecki wrote:
> When a confined process performs the first file permission revalidation on
> an AF_UNIX socket, both update_sk_ctx() and update_peer_ctx() can be called
> before the socket's peer label cache (ctx->peer) has been populated. In
> those cases they pass NULL as a label argument to aa_label_is_subset() or
> aa_label_merge(), which immediately dereferences label->size and causes an
> Oops:
>
> RIP: __aa_label_next_not_in_set+0xd/0x110
> CR2: 000000000000004c
> Call Trace:
> aa_label_is_subset
> aa_unix_file_perm
> aa_file_perm
> apparmor_file_permission
> security_file_permission
> rw_verify_area
> vfs_write
> ksys_write
>
> Observed on Arch Linux kernels 7.2.4-arch1-2 and 7.2.6-arch2-1, triggered
> by snapd unit tests writing to a connected AF_UNIX socket. The issue
> persists across those stable updates.
>
It appears to be the same issue as reported here:
https://bugs.debian.org/1145111
And a patch that looks similar to yours has already been posted:
https://lore.kernel.org/20260824155822.9214-1-maxime.belair@canonical.com
As it seems you have looked at the bug in details, you can maybe comment
it and add a Tested-by: and/or Reviewed-by:, that might help to make
things progress.
Regards
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
next prev parent reply other threads:[~2026-09-29 18:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 7:15 [PATCH] apparmor: handle NULL peer label in AF_UNIX context updates Maciek Borzecki
2026-09-29 18:54 ` Aurelien Jarno [this message]
2026-09-30 10:20 ` Fabian Grünbichler
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=arwJUDS1vbUq_KKT@aurel32.net \
--to=aurelien@aurel32.net \
--cc=apparmor@lists.ubuntu.com \
--cc=georgia.garcia@canonical.com \
--cc=john.johansen@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=maciek.borzecki@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.