Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795100373; b=fmO5ligsa6ciMgg8OOlhCCGL6deuVfE4kaLERvsu82h6c5hKDjSh4p33GLd8RIgVhMZo FQJF6HZck5dZDz203VxBtIARKQfR3oIEh5QzeRi2c8eO2WXiSQu/Gn1ysfruRF8CmX73x T8C1fKVD969BKPexOlGkox3Q+QNE/YoY4m/9LndQ5yNnlFYdMThqD9UbH0dqpexrLk8mA kLZ9Yd6Z77JzFPvUTMEaitytAUrpvY6N1Noo/U4U8A5+tOBRUzKkY9egaAsOLmiuxg9L4 B5WRlo+0EsONR4yyZglRW3u5i8TUUXCojDb5WEBB70FzLUb3k2faZuc481Gu6Y7nYXg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795100373; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: Reply-To:MIME-Version:Lines:X-Developer-Signature:X-Developer-Key: Content-Transfer-Encoding; bh=lyG3lZTsyHAm6zweBOGzPXZkdS+gLMwJOEKuARnan60=; b=D5ifoxQH1/d3XqY1JY7b10eODid7iNqIFma+5ljxrjNUtDlUe7+KHj8OTzdZwOkDZYqx wARsjS7kj1ZYbr8yeMLA7NPI4t/m0yfKnPCBpnYEHMIJCqrOzuYlJPWfAaoxXa/qfT9Qn uYGcVEbgn/F1OfiWg144C7uOpJPW8uiOqm2qoHLg8e0TzLfK1KnkrNVidnn3eaN079ptg dUPnNNBJel78cXVXFoVhW8nx/Xw5PZ2z5gxG9UR2MRgDpG3IkS3ZinmjywbMZcmpwS1TT MjtAr/I1s3pnyoqLGfhhKNlcyvb9aqfUqjrAsKS5umE6dHVeJEj/88rTMIR0YpBD+bA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=U5+fW5D+; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DCC2606A320 for ; Thu, 19 Nov 2026 14:59:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=U5+fW5D+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 679EA1F000C5; Thu, 19 Nov 2026 14:59:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795100373; bh=lyG3lZTsyHAm6zweBOGzPXZkdS+gLMwJOEKuARnan60=; h=From:To:Cc:Subject:Date:Reply-To; b=U5+fW5D+T7uvcRL3VSmcRhc7WW/SQluSmbdNJ8RBUQkRUofL7xAU+nCwQvnamDtTg xjh03Rsww60hBJAHtWNSPvhl4ZwPvIRG5jKSWw11hQDLA1gLammnxBduG4YSx6FPPL EOAsv4ro/x390i6/Ge5F7SpMyS5nANAMuJ/yzDyc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99505: apparmor: fix a use-after-free in aa_lookupn_ns() Date: Thu, 19 Nov 2026 15:26:43 +0100 Message-ID: <2026111917-CVE-2026-99505-0fe8@gregkh> X-Mailer: git-send-email 2.56.0 Reply-To: , X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3949; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=pCHXo0Q/NW04i5uXkme2t37M2dPUkAt9cA+zuoEW7co=; b=owGbwMvMwCRo6H6F97bub03G02pJDFn/2SbqnJ25++LurruegTuPX/P9O33n4difW+2P73Exu vTKaLby9o5YFgZBJgZZMUWWL9t4ju6vOKToZWh7GmYOKxPIEAYuTgGYyIw9DAumZtSt6M50n1Cy 9P/U2AU97aGXd+xhmJ/ku2fq9vic1R1Pzu0JXCDlsHv1/G8A X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: apparmor: fix a use-after-free in aa_lookupn_ns() aa_lookupn_ns() takes a reference on the namespace it finds with aa_get_ns(), which is kref_get() on the reference count that the namespace is released through, without checking whether the namespace is still in use. A concurrent removal of a ":"-prefixed namespace looks the same namespace up and only then takes the parent lock to remove it, so the last reference can be dropped between the lookup and the aa_get_ns() call: the reference count then reports the increment on a zero count and the kernel classifies the following use of the object as a use-after-free. A user with CAP_MAC_ADMIN can trigger this by writing a ":" removal and a ":/" removal to /sys/kernel/security/apparmor/.remove concurrently. refcount_t: addition on 0; use-after-free. WARNING: lib/refcount.c:25 at refcount_warn_saturate+0xc0/0xe0, CPU#6 Call Trace: aa_lookupn_ns+0xa9/0xc0 aa_remove_profiles+0x4fb/0x730 ? __kvmalloc_node_noprof+0x219/0x5c0 ? __pfx_aa_remove_profiles+0x10/0x10 ? aa_loaddata_alloc+0x65/0x1f0 ? _copy_from_user+0x2d/0x80 ? aa_loaddata_alloc+0x111/0x1f0 profile_remove+0x2ee/0x4a0 vfs_write+0x21e/0xcf0 ? rcu_core+0x29c/0x1740 ? timerqueue_linked_add+0x1f4/0x3d0 ? __pfx_vfs_write+0x10/0x10 ? mutex_lock+0x81/0xe0 ? __pfx_mutex_lock+0x10/0x10 ? __pfx_rcu_core+0x10/0x10 ? __pfx_hrtimer_update_next_event+0x10/0x10 ? mutex_unlock+0x7b/0xd0 ? fdget_pos+0x24d/0x4b0 ksys_write+0xf7/0x1c0 ? __pfx_ksys_write+0x10/0x10 ? restore_fpregs_from_fpstate+0x37/0xc0 do_syscall_64+0xf9/0x540 entry_SYSCALL_64_after_hwframe+0x77/0x7f Fix by rejecting a namespace whose reference count is zero. The Linux kernel CVE team has assigned CVE-2026-99505 to this issue. Affected and fixed versions =========================== Issue introduced in 4.13 with commit 3664268f19ea07bec55df92fe53ff9ed28968bcc and fixed in 6.12.117 with commit 2588c5693f4535e856841976cb1e1532bae77109 Issue introduced in 4.13 with commit 3664268f19ea07bec55df92fe53ff9ed28968bcc and fixed in 6.18.61 with commit 174b4b90ec6731934cf84eb267a86ad7152267fa Issue introduced in 4.13 with commit 3664268f19ea07bec55df92fe53ff9ed28968bcc and fixed in 7.3.2 with commit 8db1a8614b4f8f3da11c568e2b5af4fe56eef360 Issue introduced in 4.13 with commit 3664268f19ea07bec55df92fe53ff9ed28968bcc and fixed in 7.4-rc1 with commit f292873ceb4bd3a1a0f75f884361cd556e457692 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-99505 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: security/apparmor/include/policy_ns.h security/apparmor/policy_ns.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/2588c5693f4535e856841976cb1e1532bae77109 https://git.kernel.org/stable/c/174b4b90ec6731934cf84eb267a86ad7152267fa https://git.kernel.org/stable/c/8db1a8614b4f8f3da11c568e2b5af4fe56eef360 https://git.kernel.org/stable/c/f292873ceb4bd3a1a0f75f884361cd556e457692