[PATCH v2] apparmor: return 0 from unpack_tag_headers() on success
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Wed Dec 2 17:50:40 UTC 2026
> unpack_tag_headers() returns int, where 0 means success and a negative
> errno means failure, like unpack_strs_table() and unpack_tagsets() which
> unpack_tags() calls next to it. On success it returns true, which is 1.
>
> unpack_tags() tests the result with "if (error)", so a successfully
> unpacked "hdrs" array is treated as a failure: unpack_tags() destroys the
> tags, rewinds e->pos and returns 1. Its caller, unpack_pdb(), only checks
> for "< 0", so it carries on with the tags section unconsumed and the
> profile then fails to unpack with -EPROTO.
>
> Return 0 on success.
>
> Cc: stable at vger.kernel.org
> Fixes: 3d28e2397af7 ("apparmor: add support loading per permission tagging")
> Signed-off-by: Cong Nguyen <congnt264 at gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261202174721.3676225-1-congnt264@gmail.com?part=1
More information about the Linux-security-module-archive
mailing list