Skip to content

Commit 6dd1e4c

Browse files
Zhen Leipcmoore
authored andcommitted
selinux: add the processing of the failure of avc_add_xperms_decision()
When avc_add_xperms_decision() fails, the information recorded by the new avc node is incomplete. In this case, the new avc node should be released instead of replacing the old avc node. Cc: [email protected] Fixes: fa1aa14 ("selinux: extended permissions for ioctls") Suggested-by: Stephen Smalley <[email protected]> Signed-off-by: Zhen Lei <[email protected]> Acked-by: Stephen Smalley <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent 379d9af commit 6dd1e4c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

security/selinux/avc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,11 @@ static int avc_update_node(u32 event, u32 perms, u8 driver, u8 xperm, u32 ssid,
907907
node->ae.avd.auditdeny &= ~perms;
908908
break;
909909
case AVC_CALLBACK_ADD_XPERMS:
910-
avc_add_xperms_decision(node, xpd);
910+
rc = avc_add_xperms_decision(node, xpd);
911+
if (rc) {
912+
avc_node_kill(node);
913+
goto out_unlock;
914+
}
911915
break;
912916
}
913917
avc_node_replace(node, orig);

0 commit comments

Comments
 (0)