[PATCH v1] security/apparmor: remove duplicate unpacking in unpack_perm function

Shen Lichuan shenlichuan at vivo.com
Wed Aug 21 07:22:38 UTC 2024


The code was unpacking the 'allow' parameter twice.
This change removes the duplicate part.

Signed-off-by: Shen Lichuan <shenlichuan at vivo.com>
---
 security/apparmor/policy_unpack.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index 5a570235427d..4ec1e1251012 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -649,7 +649,6 @@ static bool unpack_perm(struct aa_ext *e, u32 version, struct aa_perms *perm)
 		return false;
 
 	return	aa_unpack_u32(e, &perm->allow, NULL) &&
-		aa_unpack_u32(e, &perm->allow, NULL) &&
 		aa_unpack_u32(e, &perm->deny, NULL) &&
 		aa_unpack_u32(e, &perm->subtree, NULL) &&
 		aa_unpack_u32(e, &perm->cond, NULL) &&
-- 
2.17.1




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