Commit 72971e6f authored by John Johansen's avatar John Johansen
Browse files

apparmor: fix unpack_tags to properly return error in failure cases



error is initialized to -EPROTO but set by some of the internal
functions, unfortunately the last two checks assume error is set to
-EPROTO already for the failure case. Ensure it is by setting it
before these checks.

Fixes: 3d28e239 ("apparmor: add support loading per permission tagging")
Reported-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent f17b68f0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -863,6 +863,7 @@ static int unpack_tags(struct aa_ext *e, struct aa_tags_struct *tags,
			*info = "failed to unpack profile tag.sets";
			goto fail;
		}
		error = -EPROTO;
		if (!aa_unpack_nameX(e, AA_STRUCTEND, NULL))
			goto fail;