From: Christos Gkekas Date: Sat, 8 Jul 2017 19:50:21 +0000 (+0100) Subject: apparmor: Fix logical error in verify_header() X-Git-Tag: v4.14-rc2~11^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=86aea56f14929ff1c05eca1776e9068e907429d5;p=thirdparty%2Fkernel%2Flinux.git apparmor: Fix logical error in verify_header() verify_header() is currently checking whether interface version is less than 5 *and* greater than 7, which always evaluates to false. Instead it should check whether it is less than 5 *or* greater than 7. Signed-off-by: Christos Gkekas Signed-off-by: John Johansen --- diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index 2d5a1a007b062..bda0dce3b5829 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -832,7 +832,7 @@ static int verify_header(struct aa_ext *e, int required, const char **ns) * if not specified use previous version * Mask off everything that is not kernel abi version */ - if (VERSION_LT(e->version, v5) && VERSION_GT(e->version, v7)) { + if (VERSION_LT(e->version, v5) || VERSION_GT(e->version, v7)) { audit_iface(NULL, NULL, NULL, "unsupported interface version", e, error); return error;