apparmor: Fix regression in stacking due to label flags
authorJohn Johansen <john.johansen@canonical.com>
Tue, 20 Sep 2022 11:01:28 +0000 (04:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:29 +0000 (13:32 +0100)
commitf024bf13d4ff0a31549aa2d41a3f71098c7ebfaf
treed29dae76f656bce1a26a0ee2932776de8f2e2db1
parent72a5b5641cac472bd37d4fd6b120d53926d622cb
apparmor: Fix regression in stacking due to label flags

[ Upstream commit 1f939c6bd1512d0b39b470396740added3cb403f ]

The unconfined label flag is not being computed correctly. It
should only be set if all the profiles in the vector are set, which
is different than what is required for the debug and stale flag
that are set if any on the profile flags are set.

Fixes: c1ed5da19765 ("apparmor: allow label to carry debug flags")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/apparmor/label.c