Skip to contentSkip to conversation

selinux: drop the BUG() in cred_has_capability()

PATCH Applied Paul Moore 1 participant 2 messages Jan 14 – Jan 15 SELinux security module

lore
Share & tools
lore

Paul Moore

author maintainer
#0 lore raw

PATCH 1/1 selinux: drop the BUG() in cred_has_capability()

With the compile time check located immediately above the cred_has_capability() function ensuring that we will notice if the capability set grows beyond 63 capabilities, we can safely remove the BUG() call from the cred_has_capability().

---
 security/selinux/hooks.c | 1 -
 1 file changed, 1 deletion(-)
security/selinux/hooks.c +0 -1
index 9289ed89a8ec..feda34b18d83 100644
@@ -1659,7 +1659,6 @@ static int cred_has_capability(const struct cred *cred,
 		break;
 	default:
 		pr_err("SELinux:  out of range capability %d\n", cap);
-		BUG();
 		return -EINVAL;
 	}
 
Signature · 1 line
2.52.0
author maintainer Applied
#1 lore raw
Quoted 10 lines · Paul Moore

With the compile time check located immediately above the cred_has_capability() function ensuring that we will notice if the capability set grows beyond 63 capabilities, we can safely remove the BUG() call from the cred_has_capability().

---
 security/selinux/hooks.c | 1 -
 1 file changed, 1 deletion(-)

Merged into selinux/dev.

Signature · 1 line
paul-moore.com