aboutsummaryrefslogtreecommitdiffstats
path: root/security/capability.c
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2013-07-23 17:38:38 -0400
committerEric Paris <eparis@redhat.com>2013-07-25 13:01:25 -0400
commit2e5aa86609ec1cf37bcc204fd7ba6c24c2f49fec (patch)
treedfe240f974ba5437143fa8869813ac634731d860 /security/capability.c
parent8bb495e3f02401ee6f76d1b1d77f3ac9f079e376 (diff)
lsm: split the xfrm_state_alloc_security() hook implementation
The xfrm_state_alloc_security() LSM hook implementation is really a multiplexed hook with two different behaviors depending on the arguments passed to it by the caller. This patch splits the LSM hook implementation into two new hook implementations, which match the LSM hooks in the rest of the kernel: * xfrm_state_alloc * xfrm_state_alloc_acquire Also included in this patch are the necessary changes to the SELinux code; no other LSMs are affected. Signed-off-by: Paul Moore <pmoore@redhat.com> Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'security/capability.c')
-rw-r--r--security/capability.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/security/capability.c b/security/capability.c
index 1728d4e375db..67afc679719a 100644
--- a/security/capability.c
+++ b/security/capability.c
@@ -767,9 +767,15 @@ static int cap_xfrm_policy_delete_security(struct xfrm_sec_ctx *ctx)
767 return 0; 767 return 0;
768} 768}
769 769
770static int cap_xfrm_state_alloc_security(struct xfrm_state *x, 770static int cap_xfrm_state_alloc(struct xfrm_state *x,
771 struct xfrm_user_sec_ctx *sec_ctx, 771 struct xfrm_user_sec_ctx *sec_ctx)
772 u32 secid) 772{
773 return 0;
774}
775
776static int cap_xfrm_state_alloc_acquire(struct xfrm_state *x,
777 struct xfrm_sec_ctx *polsec,
778 u32 secid)
773{ 779{
774 return 0; 780 return 0;
775} 781}
@@ -1084,7 +1090,8 @@ void __init security_fixup_ops(struct security_operations *ops)
1084 set_to_cap_if_null(ops, xfrm_policy_clone_security); 1090 set_to_cap_if_null(ops, xfrm_policy_clone_security);
1085 set_to_cap_if_null(ops, xfrm_policy_free_security); 1091 set_to_cap_if_null(ops, xfrm_policy_free_security);
1086 set_to_cap_if_null(ops, xfrm_policy_delete_security); 1092 set_to_cap_if_null(ops, xfrm_policy_delete_security);
1087 set_to_cap_if_null(ops, xfrm_state_alloc_security); 1093 set_to_cap_if_null(ops, xfrm_state_alloc);
1094 set_to_cap_if_null(ops, xfrm_state_alloc_acquire);
1088 set_to_cap_if_null(ops, xfrm_state_free_security); 1095 set_to_cap_if_null(ops, xfrm_state_free_security);
1089 set_to_cap_if_null(ops, xfrm_state_delete_security); 1096 set_to_cap_if_null(ops, xfrm_state_delete_security);
1090 set_to_cap_if_null(ops, xfrm_policy_lookup); 1097 set_to_cap_if_null(ops, xfrm_policy_lookup);