[PATCH] apparmor: return 0 from unpack_tag_headers() on success

sashiko-bot at kernel.org sashiko-bot at kernel.org
Fri Nov 27 08:05:32 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 continues without the tags.
> 
> Return 0 on success.
> 
> 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/20261127080132.266236-1-congnt264@gmail.com?part=1



More information about the Linux-security-module-archive mailing list