Skip to contentSkip to conversation

Security: Fix return value of avc_has_perm_noaudit() in security/selinux/avc.c

PATCH In review [email protected] 2 participants 2 messages Mar 10, 2010 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Security: Fix return value of avc_has_perm_noaudit() in security/selinux/avc.c

avc_has_perm_noaudit() is not check the return value of avc_update_node, avc_update_node() delcared as int.

---
 security/selinux/avc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
security/selinux/avc.c +1 -1
index f2dde26..8bbce96 100644
@@ -763,7 +763,7 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid,
 		if (flags & AVC_STRICT)
 			rc = -EACCES;
 		else if (!selinux_enforcing || (avd->flags & AVD_FLAGS_PERMISSIVE))
-			avc_update_node(AVC_CALLBACK_GRANT, requested, ssid,
+			rc = avc_update_node(AVC_CALLBACK_GRANT, requested, ssid,
 					tsid, tclass, avd->seqno);
 		else
 			rc = -EACCES;
Signature · 1 line
1.6.5.3
#1 lore raw
Quoted 3 lines · On Thu, 2010-03-11 at 04:53 +0800, [email protected] wrote:

avc_has_perm_noaudit() is not check the return value of avc_update_node, avc_update_node() delcared as int.

NAK. Just cast to void instead. This is on the permissive code path and failure to update the node is non-fatal (just means we'll try again next time) and should not cause the permission to be denied.

Quoted 18 lines
---
 security/selinux/avc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
security/selinux/avc.c +1 -1
index f2dde26..8bbce96 100644
@@ -763,7 +763,7 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid,
 		if (flags & AVC_STRICT)
 			rc = -EACCES;
 		else if (!selinux_enforcing || (avd->flags & AVD_FLAGS_PERMISSIVE))
-			avc_update_node(AVC_CALLBACK_GRANT, requested, ssid,
+			rc = avc_update_node(AVC_CALLBACK_GRANT, requested, ssid,
 					tsid, tclass, avd->seqno);
 		else
 			rc = -EACCES;
Signature · 2 lines
Stephen Smalley
National Security Agency