]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
apparmor: Fix abi check to include v8 abi
authorJohn Johansen <john.johansen@canonical.com>
Sat, 7 May 2022 01:57:12 +0000 (18:57 -0700)
committerJohn Johansen <john.johansen@canonical.com>
Mon, 3 Oct 2022 21:49:03 +0000 (14:49 -0700)
The v8 abi is supported by the kernel but the userspace supported
version check does not allow for it. This was missed when v8 was added
due to a bug in the userspace compiler which was setting an older abi
version for v8 encoding (which is forward compatible except on the
network encoding). However it is possible to detect the network
encoding by checking the policydb network support which the code
does. The end result was that missing the abi flag worked until
userspace was fixed and began correctly checking for the v8 abi
version.

Fixes: 56974a6fcfef ("apparmor: add base infastructure for socket mediation")
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/policy_unpack.c

index 3ea591d31be7e0f28c1b82f471577aebe34d3b49..0203e43460b66f053cfb759f51680869ca5fd288 100644 (file)
@@ -1183,7 +1183,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, v8)) {
                audit_iface(NULL, NULL, NULL, "unsupported interface version",
                            e, error);
                return error;