Skip to content

Commit

Permalink
apparmor: Fix logical error in verify_header()
Browse files Browse the repository at this point in the history
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 <chris.gekas@gmail.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
  • Loading branch information
Christos Gkekas authored and John Johansen committed Sep 22, 2017
1 parent 19fe43a commit 86aea56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/apparmor/policy_unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 86aea56

Please sign in to comment.