Skip to content

Commit 379d9af

Browse files
Zhen Leipcmoore
authored andcommitted
selinux: fix potential counting error in avc_add_xperms_decision()
The count increases only when a node is successfully added to the linked list. Cc: [email protected] Fixes: fa1aa14 ("selinux: extended permissions for ioctls") Signed-off-by: Zhen Lei <[email protected]> Acked-by: Stephen Smalley <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent 8400291 commit 379d9af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/selinux/avc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,12 @@ static int avc_add_xperms_decision(struct avc_node *node,
330330
{
331331
struct avc_xperms_decision_node *dest_xpd;
332332

333-
node->ae.xp_node->xp.len++;
334333
dest_xpd = avc_xperms_decision_alloc(src->used);
335334
if (!dest_xpd)
336335
return -ENOMEM;
337336
avc_copy_xperms_decision(&dest_xpd->xpd, src);
338337
list_add(&dest_xpd->xpd_list, &node->ae.xp_node->xpd_head);
338+
node->ae.xp_node->xp.len++;
339339
return 0;
340340
}
341341

0 commit comments

Comments
 (0)