From 7be15db5215b7a5b3ccdf0cf7847dad04f581c7c Mon Sep 17 00:00:00 2001
From: "Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com>
Date: Tue, 6 Oct 2026 15:27:35 +0800
Subject: [PATCH 2/2] UBUNTU: SAUCE: DEBUG: apparmor: log temporal cache insert
 races

Debug-only, do not merge. Log when a URESPONSE_NO_CACHE reply hits an
existing cache entry, i.e. the case where the expiry timer used to be
armed on an uncached node. Seeing this line under the Thunderbird snap
reproducer confirms the fixed path is exercised.

BugLink: https://bugs.launchpad.net/bugs/2168310
---
 security/apparmor/notify.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/security/apparmor/notify.c b/security/apparmor/notify.c
index b4d01c7f3dafa..95af1fb7dfce7 100644
--- a/security/apparmor/notify.c
+++ b/security/apparmor/notify.c
@@ -908,6 +908,9 @@ static void knotif_update_from_uresp_perm(struct aa_knotif *knotif,
 			INIT_DELAYED_WORK(&node->work, audit_cache_work_function);
 			schedule_delayed_work(&node->work,
 					      secs_to_jiffies(aa_cache_timeout));
+		} else {
+			pr_info_ratelimited("apparmor: LP2168310: id %lld: node %p not cached, timer not armed\n",
+					    knotif->id, node);
 		}
 	} /* cache_response */
 }
-- 
2.53.0

