]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
apparmor: fix: limit the number of levels of policy namespaces
authorJohn Johansen <john.johansen@canonical.com>
Tue, 3 Mar 2026 19:08:02 +0000 (11:08 -0800)
committerJohn Johansen <john.johansen@canonical.com>
Mon, 9 Mar 2026 23:05:43 +0000 (16:05 -0700)
commit306039414932c80f8420695a24d4fe10c84ccfb2
treed2fedc885647c60d67b62a7d66a8cf437bae9657
parentab09264660f9de5d05d1ef4e225aa447c63a8747
apparmor: fix: limit the number of levels of policy namespaces

Currently the number of policy namespaces is not bounded relying on
the user namespace limit. However policy namespaces aren't strictly
tied to user namespaces and it is possible to create them and nest
them arbitrarily deep which can be used to exhaust system resource.

Hard cap policy namespaces to the same depth as user namespaces.

Fixes: c88d4c7b049e8 ("AppArmor: core policy routines")
Reported-by: Qualys Security Advisory <qsa@qualys.com>
Reviewed-by: Ryan Lee <ryan.lee@canonical.com>
Reviewed-by: Cengiz Can <cengiz.can@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/include/policy_ns.h
security/apparmor/policy_ns.c