Please apply to 6.6.y:
1af5aa82c976 ("apparmor: free the allocated pdb objects")
8ead196be219 ("apparmor: Fix memory leak in unpack_profile()")
Both fix 98b824ff8984 ("apparmor: refcount the pdb"), which is in 6.6.
Neither fix is in 6.6.157 or queue-6.6. 6.1 predates the pdb refcount,
6.12 and later have both fixes.
Without them every policy load leaks the file pdb of each profile, and
every freed pdb leaks its own allocation, so memory grows with each
profile reload. kmemleak on 6.6.157 (Debian 13 userspace, 107 profiles):
after boot: 76 objects from aa_alloc_pdb
after 10x apparmor_parser -r /etc/apparmor.d/: 2258
With both commits cherry-picked (they apply cleanly, in this order):
0 and 0. KASAN, UBSAN and lockdep quiet on the same runs.