Commit e9248abd authored by John Johansen's avatar John Johansen Committed by Zheng Zengkai
Browse files

apparmor: fix overlapping attachment computation

stable inclusion
from stable-v5.10.138
commit 2672f3eb7a7f8bc076a146c6f062233f56b1d3c1
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60QFD

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2672f3eb7a7f8bc076a146c6f062233f56b1d3c1



--------------------------------

commit 2504db20 upstream.

When finding the profile via patterned attachments, the longest left
match is being set to the static compile time value and not using the
runtime computed value.

Fix this by setting the candidate value to the greater of the
precomputed value or runtime computed value.

Fixes: 21f60661 ("apparmor: improve overlapping domain attachment resolution")
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
parent e99378fc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment